/* Smart Side Cart — Frontend Styles v1.2 */

/* ═══════════════════════════════════════════ */
/* OVERLAY & DRAWER                            */
/* ═══════════════════════════════════════════ */

.ssc-overlay {
	position: fixed; inset: 0;
	background: rgba(0,0,0,0.45);
	z-index: 99998;
	opacity: 0; visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	backdrop-filter: blur(2px);
}
.ssc-overlay.open { opacity: 1; visibility: visible; }

.ssc-drawer {
	position: fixed; top: 0; right: 0;
	width: 420px; max-width: 100vw; height: 100vh; height: 100dvh;
	background: #fff;
	z-index: 99999;
	display: flex; flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
	box-shadow: -4px 0 30px rgba(0,0,0,0.15);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: #111;
	/* FIX: prevent flex children from overflowing */
	overflow: hidden;
}
.ssc-drawer.open { transform: translateX(0); }

/* ═══════════════════════════════════════════ */
/* HEADER — fixed height, never shrinks        */
/* ═══════════════════════════════════════════ */

.ssc-drawer-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1.5px solid #f0f0f0;
	background: #fff;
	flex-shrink: 0; /* CRITICAL — never shrink */
}
.ssc-header-left { display: flex; align-items: center; gap: 10px; }
.ssc-drawer-title { font-size: 17px; font-weight: 700; color: #111; margin: 0; line-height: 1; }
.ssc-item-count { font-size: 14px; font-weight: 400; color: #777; }
.ssc-close-btn {
	background: none; border: none; cursor: pointer; color: #111;
	padding: 6px; display: flex; align-items: center;
	border-radius: 50%; transition: background 0.15s; flex-shrink: 0;
}
.ssc-close-btn:hover { background: #f5f5f5; }

/* ═══════════════════════════════════════════ */
/* INNER WRAPPER — flex column, fills space    */
/* ═══════════════════════════════════════════ */

.ssc-inner {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;   /* FIX: clip children */
	min-height: 0;      /* FIX: allow flex child to shrink */
	position: relative;
}

/* ═══════════════════════════════════════════ */
/* TOP FIXED AREA — banner + tier + notice     */
/* These must never push scroll body away      */
/* ═══════════════════════════════════════════ */

.ssc-top-fixed {
	flex-shrink: 0; /* CRITICAL */
	display: flex;
	flex-direction: column;
}

/* ═══════════════════════════════════════════ */
/* ANNOUNCEMENT BANNER                         */
/* ═══════════════════════════════════════════ */

.ssc-banner {
	padding: 10px 20px;
	font-size: 12.5px; font-weight: 600;
	text-align: center; letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════ */
/* TIER PROGRESS BAR                           */
/* ═══════════════════════════════════════════ */

.ssc-tier-section {
	padding: 14px 20px 8px;
	border-bottom: 1px solid #f0f0f0;
}
.ssc-tier-labels {
	position: relative; height: 22px; margin-bottom: 6px;
}
.ssc-tier-label-item {
	position: absolute; transform: translateX(-50%);
	font-size: 10.5px; font-weight: 600; color: #bbb;
	white-space: nowrap; top: 0; text-align: center;
	transition: color 0.3s;
}
.ssc-tier-label-item.reached { color: #111; }

.ssc-progress-track {
	position: relative; height: 6px;
	background: #ebebeb; border-radius: 999px;
	margin: 6px 0 10px;
}
.ssc-progress-fill {
	position: absolute; left: 0; top: 0; height: 100%;
	background: #111; border-radius: 999px;
	transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.ssc-tier-node {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 18px; height: 18px;
	background: #ebebeb; border: 2px solid #ddd;
	border-radius: 3px; rotate: 45deg;
	display: flex; align-items: center; justify-content: center;
	transition: background 0.3s, border-color 0.3s;
}
.ssc-tier-node svg { rotate: -45deg; }
.ssc-tier-node.reached { background: #111; border-color: #111; }

.ssc-tier-hint {
	font-size: 11.5px; color: #666; margin: 0;
	text-align: center; line-height: 1.5;
}
.ssc-tier-hint strong { color: #111; }
.ssc-tier-max { color: #2a7a2a; }

/* ═══════════════════════════════════════════ */
/* DYNAMIC NOTICE BAR                          */
/* ═══════════════════════════════════════════ */

.ssc-notice-bar {
	overflow: hidden; max-height: 0; padding: 0 20px;
	font-size: 12.5px; font-weight: 500;
	text-align: center;
	background: #f7f7f7; color: #333;
	border-bottom: 1px solid #ececec;
	transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.3s ease;
	opacity: 0;
}
.ssc-notice-bar.visible { max-height: 60px; padding: 10px 20px; opacity: 1; }
.ssc-notice-reward  { background: #f0fff0; color: #1a5c1a; border-bottom-color: #c3e6c3; }
.ssc-notice-coupon  { background: #fff8e6; color: #6b4800; border-bottom-color: #f5dba0; }
.ssc-notice-freebie { background: #f0f0ff; color: #3a3a8c; border-bottom-color: #c5c5f0; }
.ssc-notice-tier    { background: #f0fff0; color: #1a5c1a; border-bottom-color: #c3e6c3; }

/* ═══════════════════════════════════════════ */
/* SCROLL BODY — takes all remaining space     */
/* ═══════════════════════════════════════════ */

.ssc-scroll-body {
	flex: 1;           /* FIX: take remaining space */
	min-height: 0;     /* FIX: allow shrinking in flex */
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}
.ssc-scroll-body::-webkit-scrollbar { width: 3px; }
.ssc-scroll-body::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 4px; }

/* ═══════════════════════════════════════════ */
/* EMPTY CART                                  */
/* ═══════════════════════════════════════════ */

.ssc-empty-cart {
	display: flex; flex-direction: column;
	align-items: center; justify-content: center;
	gap: 12px; padding: 60px 24px; text-align: center;
}
.ssc-empty-cart p { font-size: 15px; color: #aaa; margin: 0; }
.ssc-shop-link { font-size: 13px; font-weight: 600; color: #111; text-decoration: underline; text-underline-offset: 3px; }

/* ═══════════════════════════════════════════ */
/* CART ITEMS                                  */
/* ═══════════════════════════════════════════ */

.ssc-items-list { padding: 0 16px; }

.ssc-item {
	display: flex; gap: 14px;
	padding: 16px 0; border-bottom: 1px solid #f2f2f2;
}
.ssc-item:last-child { border-bottom: none; }

.ssc-item-thumb {
	position: relative; flex-shrink: 0;
	width: 80px; height: 90px;
	border-radius: 8px; overflow: hidden; background: #f8f8f8;
}
.ssc-item-thumb img { width: 100%; height: 100%; object-fit: cover; }

.ssc-free-badge {
	position: absolute; top: 4px; left: 4px;
	background: #111; color: #fff;
	font-size: 9px; font-weight: 800;
	padding: 2px 5px; border-radius: 3px; letter-spacing: 0.5px;
}

.ssc-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ssc-item-name { font-size: 13.5px; font-weight: 600; color: #111; line-height: 1.35; }
.ssc-item-meta { font-size: 11.5px; color: #888; }
.ssc-freebie-tag { color: #2a7a2a; }

.ssc-item-row { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 6px; }
.ssc-item-price { font-size: 14px; font-weight: 700; color: #111; }
.ssc-old-price { font-size: 11.5px; color: #bbb; text-decoration: line-through; font-weight: 400; margin-left: 4px; }
.ssc-free-price { font-size: 13px; font-weight: 800; color: #2a7a2a; letter-spacing: 0.5px; }

.ssc-qty-wrap {
	display: flex; align-items: center;
	border: 1.5px solid #e0e0e0; border-radius: 6px; overflow: hidden;
	margin-left: auto;
}
.ssc-qty-btn {
	background: none; border: none; cursor: pointer;
	width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
	font-size: 16px; color: #111; transition: background 0.15s; line-height: 1;
}
.ssc-qty-btn:hover { background: #f5f5f5; }
.ssc-qty-num {
	min-width: 28px; text-align: center; font-size: 13px; font-weight: 600;
	border-left: 1px solid #e0e0e0; border-right: 1px solid #e0e0e0;
	height: 28px; line-height: 28px;
}
.ssc-del-btn {
	background: none; border: none; cursor: pointer;
	color: #ccc; padding: 4px; display: flex; align-items: center;
	border-radius: 4px; transition: color 0.2s; flex-shrink: 0;
}
.ssc-del-btn:hover { color: #e44; }

/* ═══════════════════════════════════════════ */
/* SECTIONS (chips / CYL / addons)             */
/* ═══════════════════════════════════════════ */

.ssc-section { padding: 16px; border-top: 8px solid #f5f5f5; }
.ssc-section-heading {
	font-size: 12px; font-weight: 700; color: #111;
	text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px;
}

/* ═══════════════════════════════════════════ */
/* COUPON CHIPS                                */
/* ═══════════════════════════════════════════ */

.ssc-chips-wrap { display: flex; flex-direction: column; gap: 8px; }
.ssc-chip {
	display: flex; align-items: center; justify-content: space-between;
	border: 1.5px dashed #d0d0d0; border-radius: 8px; padding: 10px 12px;
	background: #fafafa; transition: border-color 0.2s, background 0.2s;
}
.ssc-chip.ssc-chip-applied { border-color: #111; border-style: solid; background: #f0f0f0; }
.ssc-chip-left { flex: 1; }
.ssc-chip-code { font-size: 13px; font-weight: 700; color: #111; letter-spacing: 0.04em; }
.ssc-chip-desc { font-size: 11px; color: #777; margin-top: 1px; }
.ssc-chip-btn {
	background: #111; color: #fff; border: none; border-radius: 5px;
	padding: 5px 12px; font-size: 11.5px; font-weight: 600;
	cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.ssc-chip-btn:hover { background: #333; }
.ssc-chip.ssc-chip-applied .ssc-chip-btn { background: #fff; color: #111; border: 1.5px solid #111; }
.ssc-applied-wrap { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ssc-applied-tag {
	display: flex; align-items: center; justify-content: space-between;
	background: #f0f0f0; border-radius: 6px; padding: 6px 10px; font-size: 12px; color: #333;
}
.ssc-chip-remove { background: none; border: none; cursor: pointer; color: #999; font-size: 12px; padding: 0 4px; line-height: 1; }
.ssc-chip-remove:hover { color: #e44; }

/* ═══════════════════════════════════════════ */
/* HORIZONTAL SCROLL                           */
/* ═══════════════════════════════════════════ */

.ssc-hscroll {
	display: flex; gap: 10px;
	overflow-x: auto; padding-bottom: 6px;
	scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.ssc-hscroll::-webkit-scrollbar { height: 3px; }
.ssc-hscroll::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 4px; }

/* ═══════════════════════════════════════════ */
/* COMPLETE YOUR LOOK CARDS                    */
/* ═══════════════════════════════════════════ */

.ssc-cyl-card {
	flex-shrink: 0; width: 120px;
	scroll-snap-align: start;
	display: flex; flex-direction: column; gap: 5px;
}
.ssc-cyl-img { width: 120px; height: 130px; border-radius: 8px; overflow: hidden; background: #f5f5f5; }
.ssc-cyl-img img { width: 100%; height: 100%; object-fit: cover; }
.ssc-cyl-name { font-size: 11.5px; color: #333; line-height: 1.3; font-weight: 500; }
.ssc-cyl-price { font-size: 12px; font-weight: 700; color: #111; }
.ssc-cyl-add-btn {
	background: #fff; color: #111;
	border: 1.5px solid #d0d0d0; border-radius: 5px;
	padding: 5px 0; font-size: 11.5px; font-weight: 600;
	cursor: pointer; width: 100%; transition: all 0.2s;
}
.ssc-cyl-add-btn:hover, .ssc-cyl-add-btn.added { background: #111; color: #fff; border-color: #111; }

/* ═══════════════════════════════════════════ */
/* ADD-ON CARDS                                */
/* ═══════════════════════════════════════════ */

.ssc-addon-card {
	flex-shrink: 0; width: 130px; scroll-snap-align: start;
	display: flex; flex-direction: column; align-items: center; gap: 5px;
	border: 1.5px solid #ebebeb; border-radius: 10px;
	padding: 10px 8px; text-align: center;
}
.ssc-addon-img { width: 70px; height: 70px; border-radius: 6px; overflow: hidden; }
.ssc-addon-img img { width: 100%; height: 100%; object-fit: cover; }
.ssc-addon-img-placeholder { display: flex; align-items: center; justify-content: center; font-size: 30px; background: #f5f5f5; }
.ssc-addon-name { font-size: 12px; font-weight: 600; color: #111; }
.ssc-addon-price { font-size: 12px; color: #666; }
.ssc-addon-btn {
	background: #fff; color: #111; border: 1.5px solid #111;
	border-radius: 5px; padding: 5px 8px; font-size: 11px; font-weight: 600;
	cursor: pointer; width: 100%;
	display: flex; align-items: center; justify-content: center; gap: 4px;
	transition: all 0.2s;
}
.ssc-addon-btn:hover, .ssc-addon-btn.active { background: #111; color: #fff; }

/* ═══════════════════════════════════════════ */
/* STICKY FOOTER                               */
/* ═══════════════════════════════════════════ */

.ssc-footer {
	padding: 12px 16px 14px;
	border-top: 1.5px solid #f0f0f0;
	background: #fff;
	flex-shrink: 0;
}
.ssc-footer-row {
	display: flex; justify-content: space-between; align-items: center;
	font-size: 13px; color: #888; padding: 3px 0;
}
/* MRP — pre-discount price */
.ssc-mrp-row { color: #bbb; }
.ssc-mrp-row span:last-child { text-decoration: line-through; color: #bbb; font-weight: 500; }

/* Discount row — green */
.ssc-saving-row { color: #1a7a3c; font-weight: 600; }
.ssc-saving-amount { font-weight: 700; color: #1a7a3c; }

/* Add-on fees */
.ssc-fee-row { color: #888; font-size: 12.5px; }

/* Subtotal — bold final number */
.ssc-subtotal-row {
	display: flex; justify-content: space-between; align-items: center;
	font-size: 16px; font-weight: 800; color: #111;
	padding: 8px 0 4px; border-top: 1.5px solid #ebebeb; margin-top: 4px;
}
.ssc-subtotal-amount { font-size: 18px; letter-spacing: -0.02em; color: #111; }

/* "Taxes calculated at checkout" note */
.ssc-footer-note {
	font-size: 11px; color: #bbb; text-align: center;
	margin: 2px 0 6px; letter-spacing: 0.01em;
}

/* Keep legacy .ssc-grand-row working for AJAX-refreshed HTML */
.ssc-grand-row {
	display: flex; justify-content: space-between; align-items: center;
	font-size: 16px; font-weight: 800; color: #111;
	padding: 8px 0 4px; border-top: 1.5px solid #ebebeb; margin-top: 4px;
}
.ssc-grand-amount { font-size: 18px; letter-spacing: -0.02em; }

.ssc-checkout-btn {
	display: flex; align-items: center; justify-content: center; gap: 10px;
	width: 100%; background: #111; color: #fff; border: none;
	border-radius: 10px; padding: 15px 20px;
	font-size: 15px; font-weight: 700; letter-spacing: 0.06em;
	cursor: pointer; text-decoration: none; margin-top: 10px;
	transition: background 0.2s, transform 0.15s; text-transform: uppercase;
}
.ssc-checkout-btn:hover { background: #222; color: #fff; transform: translateY(-1px); }
.ssc-checkout-btn:active { transform: translateY(0); }
.ssc-checkout-btn svg { flex-shrink: 0; transition: transform 0.2s; }
.ssc-checkout-btn:hover svg { transform: translateX(3px); }

.ssc-returns-text {
	text-align: center; font-size: 11px; color: #2a7a2a;
	font-weight: 500; margin-top: 10px; letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════ */
/* VARIATION POPUP MODAL                       */
/* ═══════════════════════════════════════════ */

/* ══ VARIATION POPUP ══ */
.ssc-popup-overlay {
	position: fixed; inset: 0;
	background: rgba(0,0,0,0.55);
	z-index: 999999;
	display: flex; align-items: flex-end; justify-content: center;
	opacity: 0; visibility: hidden;
	transition: opacity 0.25s, visibility 0.25s;
}
.ssc-popup-overlay.open { opacity: 1; visibility: visible; }

.ssc-popup {
	background: #fff;
	border-radius: 20px 20px 0 0;
	padding: 0;
	width: min(440px, 100vw);
	max-height: 90vh; max-height: 90dvh;
	display: flex; flex-direction: column;
	transform: translateY(100%);
	transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
	overflow: hidden;
}
.ssc-popup-overlay.open .ssc-popup { transform: translateY(0); }

.ssc-popup-handle {
	width: 36px; height: 4px; background: #e0e0e0;
	border-radius: 999px; margin: 14px auto 0; flex-shrink: 0;
}

.ssc-popup-scroll {
	flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
	padding: 16px 20px 4px;
}
.ssc-popup-scroll::-webkit-scrollbar { width: 3px; }
.ssc-popup-scroll::-webkit-scrollbar-thumb { background: #e0e0e0; }

.ssc-popup-header {
	display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.ssc-popup-img {
	width: 68px; height: 78px; border-radius: 10px;
	overflow: hidden; background: #f5f5f5; flex-shrink: 0;
}
.ssc-popup-img img { width: 100%; height: 100%; object-fit: cover; }
.ssc-popup-info { flex: 1; min-width: 0; }
.ssc-popup-name {
	font-size: 13.5px; font-weight: 700; color: #111;
	line-height: 1.3; margin-bottom: 5px;
	display: -webkit-box; -webkit-line-clamp: 2;
	-webkit-box-orient: vertical; overflow: hidden;
}
.ssc-popup-price { font-size: 14px; font-weight: 700; color: #111; }

.ssc-popup-close {
	display: flex; align-items: center; justify-content: center;
	background: #f5f5f5; border: none; cursor: pointer; color: #555;
	width: 30px; height: 30px; border-radius: 50%; font-size: 14px;
	flex-shrink: 0; transition: background 0.15s;
}
.ssc-popup-close:hover { background: #eee; color: #111; }

.ssc-attr-group { margin-bottom: 18px; }
.ssc-attr-label {
	font-size: 11px; font-weight: 700; text-transform: uppercase;
	letter-spacing: 0.07em; color: #777; margin-bottom: 9px;
	display: flex; align-items: center; gap: 6px;
}
.ssc-attr-selected-val { font-weight: 600; color: #111; font-size: 11px; text-transform: none; letter-spacing: 0; }
.ssc-attr-options { display: flex; flex-wrap: wrap; gap: 7px; }
.ssc-attr-option {
	min-width: 42px; padding: 7px 14px;
	border: 1.5px solid #e0e0e0; border-radius: 7px;
	font-size: 13px; font-weight: 500;
	cursor: pointer; background: #fff; color: #111;
	transition: all 0.15s; text-align: center; line-height: 1;
}
.ssc-attr-option:hover:not(.ssc-oos) { border-color: #111; }
.ssc-attr-option.selected { background: #111; color: #fff; border-color: #111; }
.ssc-attr-option.ssc-oos { opacity: 0.3; cursor: not-allowed; text-decoration: line-through; pointer-events: none; }

/* Popup footer */
.ssc-popup-footer {
	padding: 12px 20px 20px; border-top: 1px solid #f0f0f0; flex-shrink: 0;
}

/* Cart summary inside popup */
.ssc-popup-cart-summary {
	background: #f8f8f8; border-radius: 10px;
	padding: 10px 14px; margin-bottom: 12px;
	display: flex; flex-direction: column; gap: 5px;
}
.ssc-popup-summary-row {
	display: flex; justify-content: space-between; align-items: center;
	font-size: 12.5px; color: #777;
}
.ssc-popup-summary-row span:last-child { font-weight: 600; color: #111; }
.ssc-popup-summary-row.ssc-discount,
.ssc-popup-summary-row.ssc-discount span:last-child { color: #1a7a3c; }
.ssc-popup-summary-row.ssc-subtotal span { font-size: 13.5px; font-weight: 700 !important; color: #111 !important; }
.ssc-popup-summary-note {
	font-size: 11px; color: #aaa; text-align: center;
	margin-top: 3px; padding-top: 7px; border-top: 1px dashed #e8e8e8;
}

.ssc-popup-add-btn {
	width: 100%; background: #111; color: #fff; border: none;
	border-radius: 10px; padding: 15px; font-size: 14px; font-weight: 700;
	letter-spacing: 0.04em; cursor: pointer;
	transition: background 0.2s; text-transform: uppercase;
	display: flex; align-items: center; justify-content: center; gap: 8px;
}
.ssc-popup-add-btn:hover:not(:disabled) { background: #222; }
.ssc-popup-add-btn:disabled { background: #e8e8e8; color: #999; cursor: not-allowed; }

/* ═══════════════════════════════════════════ */
/* LOADING                                     */
/* ═══════════════════════════════════════════ */

.ssc-inner.ssc-refreshing::after {
	content: '';
	position: absolute; top: 0; left: 0; right: 0; height: 3px;
	background: linear-gradient(90deg, #111 0%, transparent 100%);
	animation: ssc-loading-bar 0.8s ease-in-out infinite; z-index: 10;
}
@keyframes ssc-loading-bar {
	0%   { transform: scaleX(0); transform-origin: left; }
	50%  { transform: scaleX(1); transform-origin: left; }
	51%  { transform: scaleX(1); transform-origin: right; }
	100% { transform: scaleX(0); transform-origin: right; }
}

/* ═══════════════════════════════════════════ */
/* TOAST                                       */
/* ═══════════════════════════════════════════ */

.ssc-toast {
	position: fixed; bottom: 24px; left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: #111; color: #fff;
	padding: 10px 20px; border-radius: 8px;
	font-size: 13px; font-weight: 500;
	z-index: 1000000; opacity: 0;
	transition: opacity 0.3s, transform 0.3s;
	pointer-events: none; white-space: nowrap;
}
.ssc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ssc-toast.error { background: #c0392b; }

/* ═══════════════════════════════════════════ */
/* MOBILE                                      */
/* ═══════════════════════════════════════════ */

@media (max-width: 480px) {
	.ssc-drawer { width: 100vw; height: 100vh; height: 100dvh; }
	.ssc-item-thumb { width: 70px; height: 80px; }
	.ssc-cyl-card { width: 110px; }
	.ssc-cyl-img  { width: 110px; height: 115px; }
	.ssc-checkout-btn { font-size: 14px; padding: 14px 16px; }
	.ssc-popup { width: 100vw; }
}
