/* Clever Members — shopping cart on the website (Shopping Cart Elements,
 * product pages, search results, View Cart and checkout). */

.cmsc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Product cards ----------------------------------------------------- */
.cmsc-grid {
	display: grid;
	grid-template-columns: repeat(var(--cmsc-cols, 3), minmax(0, 1fr));
	gap: 22px;
}
.cmsc-card {
	display: flex; flex-direction: column;
	background: #fff; border: 1px solid #e2e4e7; border-radius: 12px; overflow: hidden;
	color: inherit; text-decoration: none;
	box-shadow: 0 1px 3px rgba(0,0,0,.05);
	transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.cmsc-card:hover, .cmsc-card:focus-visible { box-shadow: 0 10px 26px rgba(0,0,0,.10); transform: translateY(-2px); border-color: #d0d4d9; color: inherit; text-decoration: none; }
.cmsc-card:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }
.cmsc-card-img { display: block; aspect-ratio: 1 / 1; background: #f4f5f6; overflow: hidden; }
.cmsc-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.cmsc-card:hover .cmsc-card-img img { transform: scale(1.03); }
.cmsc-card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.cmsc-card-name { font-weight: 600; font-size: 1em; line-height: 1.35; }
.cmsc-card-price { font-weight: 700; color: #1a7f37; }
.cmsc-noimg { display: block; width: 100%; height: 100%; min-height: 80px; background: linear-gradient(135deg, #f0f0f1, #e2e4e7); }
.cmsc-el-featured .cmsc-grid[style*="--cmsc-cols:1"] { max-width: 340px; }

/* ---- Search bar -------------------------------------------------------- */
.cmsc-search { display: flex; max-width: 480px; width: 100%; margin: 0; }
.cmsc-align-center .cmsc-search { margin: 0 auto; }
.cmsc-align-right .cmsc-search { margin-left: auto; }
.cmsc-search input[type="search"] {
	flex: 1 1 auto; min-width: 0; margin: 0;
	padding: 10px 14px; font-size: 15px; line-height: 1.4;
	border: 1px solid #c3c4c7; border-right: 0; border-radius: 8px 0 0 8px; background: #fff; color: #1d2327;
}
.cmsc-search input[type="search"]:focus { outline: none; border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1 inset; }
.cmsc-search-btn {
	flex: 0 0 auto; margin: 0; padding: 10px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
	background: #2271b1; color: #fff; border: 1px solid #2271b1; border-radius: 0 8px 8px 0;
}
.cmsc-search-btn:hover, .cmsc-search-btn:focus { background: #135e96; border-color: #135e96; color: #fff; }

/* ---- View Cart Icon ---------------------------------------------------- */
.cmsc-cart-icon { position: relative; display: inline-block; color: #1d2327; line-height: 0; text-decoration: none; }
.cmsc-cart-icon:hover { opacity: .8; }
.cmsc-cart-icon svg { display: block; width: 100%; height: 100%; }
.cmsc-count {
	position: absolute; top: -8px; right: -10px;
	min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
	background: #d63638; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
	box-shadow: 0 0 0 2px #fff;
}
.cmsc-count[hidden] { display: none; }

/* ---- Shop pages (product / search / cart) ------------------------------ */
.cmsc-page-body { max-width: 1180px; margin: 0 auto; padding: 36px 20px 56px; box-sizing: border-box; }
.cmsc-page-body *, .cmsc-page-body *::before, .cmsc-page-body *::after { box-sizing: border-box; }
.cmsc-back { display: inline-block; margin-top: 18px; color: #2271b1; text-decoration: none; font-weight: 500; }
.cmsc-back:hover { text-decoration: underline; }
.cmsc-empty-box, .cmsc-thanks { text-align: center; padding: 50px 20px; background: #fff; border: 1px solid #e2e4e7; border-radius: 14px; }
.cmsc-empty-box p { font-size: 17px; margin: 0 0 18px; }
.cmsc-thanks h2 { margin: 12px 0 8px; }
.cmsc-thanks p { margin: 0 auto 16px; max-width: 560px; }

.cmsc-product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.cmsc-product-media { background: #f4f5f6; border-radius: 16px; overflow: hidden; aspect-ratio: 1 / 1; }
.cmsc-product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmsc-product-cat { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600; color: #646970; margin-bottom: 6px; }
.cmsc-product-name { margin: 0 0 10px; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.15; }
.cmsc-product-price { font-size: 26px; font-weight: 700; color: #1a7f37; margin-bottom: 18px; }
.cmsc-product-desc { line-height: 1.65; margin-bottom: 22px; color: #3c434a; }
.cmsc-product-desc p { margin: 0 0 12px; }
.cmsc-product-buy { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.cmsc-qty-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #50575e; }
.cmsc-qty-input { width: 84px; padding: 10px; font-size: 16px; border: 1px solid #c3c4c7; border-radius: 8px; margin: 0; }
.cmsc-product-buy .cmsc-add-to-cart { font-size: 16px; padding: 12px 30px; border: 0; cursor: pointer; }

.cmsc-results-title, .cmsc-cart-title { margin: 0 0 18px; font-size: clamp(24px, 3vw, 32px); }
.cmsc-results .cmsc-search { margin-bottom: 18px; }
.cmsc-results-count { color: #646970; margin: 0 0 14px; }
.cmsc-results-none { padding: 30px 0; color: #50575e; }

/* ---- Added-to-cart dialog ----------------------------------------------- */
.cmsc-dialog-overlay {
	position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,.5);
	display: flex; align-items: center; justify-content: center; padding: 16px;
	animation: cmscFade .15s ease;
}
.cmsc-dialog { position: relative; background: #fff; color: #1d2327; border-radius: 16px; padding: 30px 26px 24px; width: 420px; max-width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.cmsc-dialog-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: #8c8f94; padding: 4px; }
.cmsc-dialog-close:hover { color: #1d2327; }
.cmsc-dialog-check { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 50%; background: #e7f5ea; color: #1a7f37; font-size: 28px; line-height: 54px; font-weight: 700; }
.cmsc-dialog-title { font-weight: 600; font-size: 17px; margin: 0 0 6px; }
.cmsc-dialog-sub { color: #646970; margin: 0 0 20px; }
.cmsc-dialog-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@keyframes cmscFade { from { opacity: 0; } to { opacity: 1; } }

/* ---- View Cart --------------------------------------------------------- */
.cmsc-cart-loading { padding: 30px 0; color: #646970; }
.cmsc-cart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 30px; align-items: start; }
.cmsc-table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e2e4e7; border-radius: 12px; }
.cmsc-cart-table { width: 100%; border-collapse: collapse; margin: 0; }
.cmsc-cart-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #646970; padding: 12px 14px; border-bottom: 1px solid #e2e4e7; background: #f8f9fa; font-weight: 600; }
.cmsc-cart-table td { padding: 14px; border-bottom: 1px solid #f0f0f1; vertical-align: middle; }
.cmsc-cart-table tr:last-child td { border-bottom: 0; }
.cmsc-c-img { width: 76px; }
.cmsc-c-img img, .cmsc-c-img .cmsc-noimg { width: 60px; height: 60px; min-height: 0; border-radius: 8px; object-fit: cover; display: block; }
.cmsc-c-name { font-weight: 600; }
.cmsc-c-each { font-weight: 400; font-size: 13px; color: #646970; margin-top: 2px; }
.cmsc-c-total { font-weight: 700; white-space: nowrap; }
.cmsc-qty { display: inline-flex; align-items: center; border: 1px solid #c3c4c7; border-radius: 8px; overflow: hidden; }
.cmsc-qty-btn { width: 32px; height: 32px; border: 0; background: #f6f7f7; color: #1d2327; cursor: pointer; font-size: 16px; line-height: 1; padding: 0; margin: 0; }
.cmsc-qty-btn:hover:not(:disabled) { background: #e2e4e7; }
.cmsc-qty-n { min-width: 34px; text-align: center; font-weight: 600; }
.cmsc-remove { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: #8c8f94; padding: 4px 8px; margin: 0; }
.cmsc-remove:hover:not(:disabled) { color: #d63638; }
.cmsc-cart-table button:disabled { opacity: .45; cursor: not-allowed; }

.cmsc-coupon { margin-top: 20px; max-width: 520px; }
.cmsc-coupon-label { display: block; font-weight: 600; margin-bottom: 6px; }
.cmsc-coupon-row { display: flex; gap: 8px; }
.cmsc-coupon-row input { flex: 1 1 auto; min-width: 0; padding: 10px 12px; border: 1px solid #c3c4c7; border-radius: 8px; font-size: 15px; margin: 0; }
.cmsc-coupon-row .cmpe-btn-front { padding: 10px 18px; cursor: pointer; }
.cmsc-coupon-note { font-size: 12.5px; color: #646970; margin: 6px 0 0; }
.cmsc-coupon-msg { background: #fcf0f1; color: #8a2424; border-left: 3px solid #d63638; padding: 8px 12px; border-radius: 6px; font-size: 14px; margin-bottom: 8px; }
.cmsc-chip { display: inline-flex; align-items: center; gap: 6px; background: #e7f5ea; color: #185c2c; border-radius: 20px; padding: 5px 6px 5px 12px; font-size: 13.5px; margin: 8px 8px 0 0; }
.cmsc-chip-x { background: none; border: 0; font-size: 18px; line-height: 1; cursor: pointer; color: #185c2c; padding: 0 4px; margin: 0; }

.cmsc-cart-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 20px; }
.cmsc-box { background: #fff; border: 1px solid #e2e4e7; border-radius: 12px; padding: 18px 20px; }
.cmsc-box-title { margin: 0 0 12px; font-size: 18px; }
.cmsc-trow { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px; }
.cmsc-trow-coupon { color: #1a7f37; }
.cmsc-trow-due { border-top: 1px solid #e2e4e7; margin-top: 6px; padding-top: 12px; font-size: 19px; font-weight: 700; }

.cmsc-form { display: flex; flex-wrap: wrap; gap: 10px; }
.cmsc-f { flex: 1 1 100%; display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #3c434a; margin: 0; }
.cmsc-f.cmsc-half { flex-basis: calc(50% - 5px); }
.cmsc-f.cmsc-quarter { flex-basis: calc(25% - 7.5px); }
.cmsc-f input, .cmsc-f select { width: 100%; padding: 9px 11px; font-size: 15px; font-weight: 400; border: 1px solid #c3c4c7; border-radius: 8px; background: #fff; color: #1d2327; margin: 0; min-height: 40px; }
.cmsc-f input:focus, .cmsc-f select:focus { outline: none; border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; }
.cmsc-f [aria-invalid="true"] { border-color: #d63638; box-shadow: 0 0 0 1px #d63638; }
.cmsc-f input:disabled, .cmsc-f select:disabled { background: #f6f7f7; color: #50575e; }
.cmsc-pay-msg { margin: 12px 0 0; color: #b32d2e; font-size: 14px; }
.cmsc-pay-msg:empty { display: none; }
.cmsc-pay-msg.is-ok, .cmsc-pay-msg.cm-renew-ok { color: #1a7f37; }
.cmsc-pay-start { width: 100%; margin-top: 14px; padding: 13px 18px; font-size: 16px; border: 0; cursor: pointer; }
.cmsc-pay-start:disabled { opacity: .55; cursor: not-allowed; }
.cmsc-pay-box { margin-top: 14px; }
.cmsc-pay-box .cm-card-box { border: 1px solid #c3c4c7; border-radius: 8px; padding: 10px; background: #fff; margin-bottom: 10px; }
.cmsc-pay-box .cm-card-pay { width: 100%; padding: 12px; font-size: 16px; font-weight: 600; border-radius: 8px; border: 0; background: #2271b1; color: #fff; cursor: pointer; }
.cmsc-pay-box .cm-card-pay:disabled { opacity: .55; cursor: not-allowed; }
.cmsc-pay-box .cm-card-note, .cmsc-pay-note { font-size: 12.5px; color: #646970; margin: 8px 0; }
.cmsc-linkbtn { background: none; border: 0; padding: 0; margin-top: 12px; color: #2271b1; cursor: pointer; font-size: 14px; }
.cmsc-linkbtn:hover { text-decoration: underline; }

/* ---- Phones / tablets -------------------------------------------------- */
@media (max-width: 1024px) {
	.cmsc-grid:not([style*="--cmsc-cols:1;"]):not([style*="--cmsc-cols:2;"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cmsc-cart-grid { grid-template-columns: 1fr; }
	.cmsc-cart-side { position: static; }
}
@media (max-width: 782px) {
	.cmsc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
	.cmsc-el-featured .cmsc-grid[style*="--cmsc-cols:1"] { grid-template-columns: 1fr; margin: 0 auto; }
	.cmsc-card-body { padding: 10px 12px 12px; }
	.cmsc-product { grid-template-columns: 1fr; gap: 22px; }
	.cmsc-page-body { padding: 22px 16px 40px; }
	.cmsc-cart-table th:first-child, .cmsc-c-img { display: none; }
	.cmsc-cart-table td { padding: 12px 10px; }
	.cmsc-f.cmsc-half, .cmsc-f.cmsc-quarter { flex-basis: calc(50% - 5px); }
}
@media (max-width: 420px) {
	.cmsc-grid { grid-template-columns: 1fr; }
	.cmsc-f.cmsc-half { flex-basis: 100%; }
}

/* ---- Fit the space the theme gives the page (container queries) -------- */
.cmsc-page-body { container-type: inline-size; }
.cmsc-el-featured, .cmsc-el-grid { container-type: inline-size; }
@container (max-width: 900px) {
	.cmsc-cart-grid { grid-template-columns: 1fr; }
	.cmsc-cart-side { position: static; }
}
@container (max-width: 700px) {
	.cmsc-product { grid-template-columns: 1fr; gap: 22px; }
	.cmsc-results .cmsc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 560px) {
	.cmsc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
	.cmsc-el-featured .cmsc-grid[style*="--cmsc-cols:1;"] { grid-template-columns: 1fr; }
	.cmsc-cart-table th:first-child, .cmsc-c-img { display: none; }
	.cmsc-cart-table td { padding: 12px 10px; }
}
@container (max-width: 340px) {
	.cmsc-grid { grid-template-columns: 1fr; }
}

/* View Cart link in the Navigation Menu */
.cmsc-menu-count { position: static; display: inline-block; margin-left: 5px; vertical-align: 1px; box-shadow: none; min-width: 18px; height: 18px; line-height: 18px; font-size: 10.5px; }
.cmsc-menu-count[hidden] { display: none; }

/* Stripe card field (Settings > Payment Processor > Stripe) */
.cm-card-field.cm-card-stripe { padding: 12px 14px; border: 1px solid #c3c4c7; border-radius: 6px; background: #fff; min-height: 0; }
