/* ============================================================
   SoftStore — Main Stylesheet  (Redesigned: Modern · Luxury · Rounded)
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary:        #6c63ff;
    --primary-dark:   #574fd4;
    --primary-light:  #ede9ff;
    --secondary:      #ff6584;
    --accent:         #43e6a0;
    --dark:           #0f0e1a;
    --dark-2:         #1a1829;
    --dark-3:         #252340;
    --text:           #2c2b3d;
    --text-muted:     #9896b4;
    --border:         #ebe9f8;
    --bg:             #f7f6fe;
    --white:          #ffffff;
    --danger:         #ef4444;
    --warning:        #f59e0b;
    --success:        #10b981;
    --info:           #3b82f6;

    /* Shadows – multi-layer, soft & luxurious */
    --shadow-xs:  0 1px 3px rgba(108,99,255,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm:  0 2px 12px rgba(108,99,255,.08), 0 1px 4px rgba(0,0,0,.04);
    --shadow-md:  0 8px 32px rgba(108,99,255,.12), 0 2px 8px rgba(0,0,0,.06);
    --shadow-lg:  0 16px 48px rgba(108,99,255,.15), 0 4px 16px rgba(0,0,0,.08);
    --shadow-xl:  0 24px 64px rgba(108,99,255,.18), 0 8px 24px rgba(0,0,0,.10);
    --glow:       0 0 0 4px rgba(108,99,255,.15);

    /* Radius – generous, friendly */
    --radius-xs:   8px;
    --radius-sm:   12px;
    --radius-md:   18px;
    --radius-lg:   24px;
    --radius-xl:   32px;
    --radius-full: 9999px;

    --transition:  .22s cubic-bezier(.4,0,.2,1);
    --font-sans:   'Noto Sans Thai', 'Inter', sans-serif;
    --header-h:    72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: var(--font-base, 15px); }
body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ---------- Container ---------- */
.container    { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 800px;  margin: 0 auto; padding: 0 24px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--dark); }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -.01em; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }

/* ---------- Buttons ---------- */
.btn-primary, .btn-outline, .btn-ghost, .btn-danger, .btn-success {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 26px; border-radius: var(--radius-full);
    font-size: 0.933rem; font-weight: 600; letter-spacing: .01em;
    transition: all var(--transition); white-space: nowrap; border: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; box-shadow: 0 4px 16px rgba(108,99,255,.35);
}
.btn-primary:hover {
    color: #fff; transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108,99,255,.45);
    background: linear-gradient(135deg, #7b72ff 0%, var(--primary) 100%);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(108,99,255,.3); }
.btn-outline  { border: 2px solid var(--primary); color: var(--primary); background: transparent; padding: 9px 24px; }
.btn-outline:hover { background: var(--primary); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-ghost    { color: var(--text-muted); background: #fff; border: 1.5px solid var(--border); }
.btn-ghost:hover  { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.btn-danger   { background: var(--danger); color: #fff; box-shadow: 0 4px 12px rgba(239,68,68,.3); }
.btn-danger:hover { background: #dc2626; color: #fff; transform: translateY(-1px); }
.btn-success  { background: var(--success); color: #fff; box-shadow: 0 4px 12px rgba(16,185,129,.3); }
.btn-success:hover { background: #059669; color: #fff; transform: translateY(-1px); }
.btn-sm  { padding: 7px 18px; font-size: 0.867rem; }
.btn-lg  { padding: 14px 36px; font-size: 1.067rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 9px; border-radius: var(--radius-sm); }

/* ---------- Forms ---------- */
.form-group  { margin-bottom: 20px; }
.form-label  { display: block; font-size: 0.867rem; font-weight: 600; color: var(--text); margin-bottom: 7px; letter-spacing: .01em; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
    width: 100%; padding: 11px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.933rem; background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    color: var(--text);
}
.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108,99,255,.12);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239896b4' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.form-hint  { font-size: 0.8rem; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 5px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Alerts ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 18px; border-radius: var(--radius-sm);
    font-size: 0.933rem; margin-bottom: 14px;
    border: 1px solid transparent;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-close   { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 1.2rem; line-height: 1; opacity: .5; padding: 0; flex-shrink: 0; }
.alert-close:hover { opacity: 1; }
.flash-container { position: fixed; top: calc(var(--header-h) + 14px); right: 22px; z-index: 1000; width: 360px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: sticky; top: 0; z-index: 500;
    height: var(--header-h);
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(235,233,248,.8);
    box-shadow: 0 1px 0 rgba(108,99,255,.06), 0 4px 20px rgba(108,99,255,.06);
    transition: box-shadow var(--transition);
}
.site-header.scrolled {
    box-shadow: 0 1px 0 rgba(108,99,255,.08), 0 8px 32px rgba(108,99,255,.12);
}
.header-inner {
    height: var(--header-h);
    display: flex; align-items: center; gap: 20px;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 1.25rem; color: var(--dark);
    letter-spacing: -.02em; flex-shrink: 0;
}
.logo:hover { color: var(--dark); }
.logo-icon {
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(108,99,255,.35);
}
.logo-text span { color: var(--primary); }

.main-nav { display: flex; align-items: center; gap: 2px; margin-left: 12px; }
.nav-link {
    padding: 8px 14px; border-radius: var(--radius-xs);
    font-size: 0.933rem; font-weight: 500; color: var(--text);
    transition: all var(--transition); position: relative;
}
.nav-link:hover { background: var(--primary-light); color: var(--primary); }
.nav-link.active { color: var(--primary); font-weight: 600; }
.nav-sale  { color: var(--danger) !important; font-weight: 600; }
.caret     { font-size: 0.6rem; margin-left: 2px; opacity: .6; }

.nav-dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 10px); left: 0;
    min-width: 210px; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl); padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
    transition: all .18s cubic-bezier(.4,0,.2,1); z-index: 200;
}
.nav-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.dropdown-item {
    display: block; padding: 9px 14px; border-radius: var(--radius-xs);
    font-size: 0.933rem; color: var(--text); transition: all var(--transition);
}
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); padding-left: 18px; }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* Search bar */
.header-search { flex: 1; max-width: 380px; display: flex; }
.search-input {
    flex: 1; padding: 10px 18px;
    border: 1.5px solid var(--border); border-right: none;
    border-radius: var(--radius-full) 0 0 var(--radius-full);
    font-size: 0.933rem; outline: none; background: var(--bg);
    transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--primary); }
.search-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border: none;
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    font-size: 1rem; transition: all var(--transition);
}
.search-btn:hover { background: linear-gradient(135deg, #7b72ff, var(--primary)); }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
/* Cart button — uses .lang-btn base from header, just add position for badge */
.cart-btn { position: relative; text-decoration: none; }
.cart-btn:hover { text-decoration: none; }
.cart-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; padding: 0 4px;
    background: var(--danger); color: #fff; font-size: 0.667rem; font-weight: 700;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(239,68,68,.4);
    border: 2px solid var(--white);
}

/* Notification Bell */
.notif-wrap { position: relative; }
.notif-btn {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: var(--radius-xs);
    border: 1.5px solid var(--border); background: #fff; color: var(--text);
    font-size: 1.1rem; cursor: pointer; transition: all var(--transition);
}
.notif-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.notif-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 17px; height: 17px; padding: 0 4px;
    background: #ef4444; color: #fff; font-size: 0.6rem; font-weight: 700;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(239,68,68,.4);
}
.notif-dropdown {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    width: 340px; background: var(--bg-card, #fff); border-radius: var(--radius-md);
    border: 1px solid var(--border); box-shadow: 0 12px 40px rgba(0,0,0,.12);
    z-index: 1000; overflow: hidden;
}
.notif-dropdown.show { display: block; }
.notif-dd-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: .9rem;
}
.notif-dd-empty {
    padding: 30px 16px; text-align: center; font-size: .85rem; color: var(--text-muted);
}
.notif-dd-list { max-height: 320px; overflow-y: auto; }
.notif-dd-item {
    display: flex; gap: 10px; padding: 12px 16px;
    border-bottom: 1px solid var(--border); text-decoration: none;
    color: var(--text); transition: background .12s; align-items: flex-start;
}
.notif-dd-item:hover { background: var(--bg); }
.notif-dd-item.unread { background: rgba(108,99,255,.04); }
.notif-dd-icon {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.notif-dd-body { flex: 1; min-width: 0; }
.notif-dd-title { font-size: .82rem; font-weight: 600; line-height: 1.3; }
.notif-dd-desc { font-size: .73rem; color: var(--text-muted); margin-top: 2px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-dd-time { font-size: .65rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; margin-top: 2px; }
.notif-dd-footer {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 16px; font-size: .82rem; font-weight: 600;
    color: var(--primary); border-top: 1px solid var(--border);
    text-decoration: none; transition: background .12s;
}
.notif-dd-footer:hover { background: var(--primary-light); }
@media(max-width:480px) { .notif-dropdown { width: 300px; right: -40px; } }

.user-menu { position: relative; }
.btn-user {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 14px 5px 6px; border-radius: var(--radius-full);
    border: 1.5px solid var(--border); transition: all var(--transition);
    background: #fff;
}
.btn-user:hover { border-color: var(--primary); box-shadow: var(--shadow-xs); }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.867rem;
}
.user-name { font-size: 0.867rem; font-weight: 600; color: var(--text); }
.user-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0;
    min-width: 190px; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl); padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
    transition: all .18s cubic-bezier(.4,0,.2,1); z-index: 200;
}
.user-menu:hover .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.user-dropdown a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: var(--radius-xs);
    font-size: 0.933rem; color: var(--text); transition: all var(--transition);
}
.user-dropdown a:hover { background: var(--primary-light); color: var(--primary); }
.user-dropdown .text-danger:hover { background: #fef2f2; color: var(--danger); }

/* Mobile search inside nav */
.mobile-search { display: none; }

.mobile-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; border-radius: var(--radius-xs); position: relative; }
.mobile-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .3s ease; }
.mobile-toggle:hover { background: var(--primary-light); }
.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    background:
        radial-gradient(ellipse 80% 60% at 70% 40%, rgba(108,99,255,.22) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 20% 80%, rgba(67,230,160,.10) 0%, transparent 50%),
        linear-gradient(150deg, #0c0b18 0%, #1a1635 50%, #1f1260 100%);
    padding: 88px 0 110px;
    position: relative; overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute; top: -40%; right: -10%;
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(108,99,255,.15) 0%, transparent 70%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 680px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 16px;
    background: rgba(108,99,255,.18);
    border: 1px solid rgba(108,99,255,.35);
    border-radius: var(--radius-full);
    color: #b8b0ff; font-size: 0.867rem; font-weight: 600;
    margin-bottom: 22px; letter-spacing: .02em;
    backdrop-filter: blur(8px);
}
.hero h1 {
    color: #fff; margin-bottom: 18px;
    text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.hero h1 span {
    background: linear-gradient(135deg, #a89cff, #6c63ff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p  { color: rgba(255,255,255,.72); font-size: 1.1rem; margin-bottom: 34px; max-width: 540px; line-height: 1.75; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-search {
    margin-top: 44px;
    display: flex; max-width: 520px;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.hero-search input {
    flex: 1; padding: 15px 22px; background: transparent;
    color: #fff; font-size: 1rem; border: none; outline: none;
}
.hero-search input::placeholder { color: rgba(255,255,255,.45); }
.hero-search button {
    padding: 15px 26px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-size: 1.067rem; flex-shrink: 0;
    transition: all var(--transition);
}
.hero-search button:hover { background: linear-gradient(135deg, #7b72ff, var(--primary)); }

.hero-stats { display: flex; gap: 36px; margin-top: 44px; position: relative; z-index: 1; }
.hero-stat { text-align: center; }
.hero-stat-num {
    font-size: 1.9rem; font-weight: 800; color: #fff;
    text-shadow: 0 0 20px rgba(108,99,255,.5);
}
.hero-stat-label { font-size: 0.867rem; color: rgba(255,255,255,.55); margin-top: 2px; }

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-title { text-align: center; margin-bottom: 52px; }
.section-title h2 { margin-bottom: 12px; }
.section-title p  { color: var(--text-muted); font-size: 1rem; max-width: 540px; margin: 0 auto; line-height: 1.75; }
.section-label {
    display: inline-block; padding: 5px 14px;
    background: var(--primary-light); color: var(--primary);
    border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px;
}

/* ============================================================
   PRODUCT CARD
   ============================================================ */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 24px; }

.product-card {
    background: #fff; border-radius: var(--radius-lg);
    overflow: hidden; border: 1px solid var(--border);
    transition: all .3s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-xs);
}
.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
    border-color: rgba(108,99,255,.25);
}

.product-thumb {
    display: block;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--dark-2) 0%, var(--dark-3) 100%);
    overflow: hidden; position: relative;
    cursor: pointer;
}
.product-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.product-card:hover .product-thumb img { transform: scale(1.07); }
.product-thumb::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(15,14,26,.4) 0%, transparent 60%);
    opacity: 0; transition: opacity .3s ease;
}
.product-card:hover .product-thumb::after { opacity: 1; }

.product-badge {
    position: absolute; top: 12px; left: 12px; z-index: 1;
    padding: 4px 11px; border-radius: var(--radius-full);
    font-size: 0.733rem; font-weight: 700; letter-spacing: .03em;
    backdrop-filter: blur(8px);
}
.badge-sale    { background: rgba(239,68,68,.9);   color: #fff; }
.badge-new     { background: rgba(67,230,160,.9);  color: #0f0e1a; }
.badge-popular { background: rgba(245,158,11,.9);  color: #0f0e1a; }
.badge-flash   { background: linear-gradient(135deg,#f97316,#f59e0b); color: #fff; animation: flash-pulse 1.4s ease-in-out infinite; }
@keyframes flash-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(249,115,22,.5);} 50%{box-shadow:0 0 0 6px rgba(249,115,22,0);} }

/* ── Flash Sale: product card ─────────────────────────────────────── */
.flash-price { color: #f97316 !important; }
.price-save-pct {
    display: inline-block; font-size: 0.733rem; font-weight: 700;
    background: rgba(249,115,22,.12); color: #f97316;
    border: 1px solid rgba(249,115,22,.25); border-radius: 20px;
    padding: 1px 7px; margin-left: 4px; vertical-align: middle;
}
.flash-cd-mini {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.8rem; font-weight: 700; color: #f97316;
    margin-bottom: 8px;
    padding: 5px 10px; border-radius: 6px;
    background: rgba(249,115,22,.08); border: 1px solid rgba(249,115,22,.2);
}
.has-flash { outline: 1.5px solid rgba(249,115,22,.3); }

/* ── Flash Sale: product detail ────────────────────────────────────── */
.flash-sale-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 12px; padding: 14px 18px; border-radius: 12px; margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(249,115,22,.12) 0%, rgba(245,158,11,.08) 100%);
    border: 1px solid rgba(249,115,22,.3);
}
.flash-sale-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 1rem; font-weight: 800; color: #f97316; letter-spacing: .04em;
}
.flash-save-tag {
    font-size: 0.8rem; font-weight: 700; padding: 2px 10px;
    background: #f97316; color: #fff; border-radius: 20px;
}
.flash-countdown-full {
    display: flex; align-items: center; gap: 6px;
}
.cd-unit { display: flex; flex-direction: column; align-items: center; }
.cd-num {
    font-size: 1.4rem; font-weight: 800; line-height: 1; color: #f97316;
    background: rgba(249,115,22,.1); border: 1px solid rgba(249,115,22,.25);
    border-radius: 8px; padding: 6px 10px; min-width: 44px; text-align: center;
}
.cd-lbl { font-size: 0.67rem; color: var(--text-muted); margin-top: 4px; font-weight: 600; }
.cd-sep { font-size: 1.3rem; font-weight: 800; color: #f97316; align-self: flex-start; margin-top: 6px; }

@media (max-width: 480px) {
    .flash-sale-banner { flex-direction: column; align-items: flex-start; padding: 12px 14px; }
    .flash-countdown-full { width: 100%; justify-content: center; }
    .cd-num { font-size: 1.1rem; min-width: 38px; padding: 5px 8px; }
    .cd-sep { font-size: 1rem; margin-top: 4px; }
    .product-info-title { font-size: 1.3rem; }
    .price-main { font-size: 1.6rem; }
}

/* ── License Options ────────────────────────────────────────────────── */
.license-opts-wrap { margin: 16px 0; }
.license-opts-label { font-size: 0.867rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }
.license-opts-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.license-opt { cursor: pointer; }
.license-opt input[type=radio] { display: none; }
.license-opt-inner {
    padding: 10px 16px; border-radius: 10px;
    border: 2px solid var(--border); background: var(--bg-2);
    transition: all .2s; text-align: center;
}
.license-opt.selected .license-opt-inner,
.license-opt:has(input:checked) .license-opt-inner {
    border-color: var(--primary); background: var(--primary-light);
}
.license-opt-name { font-size: 0.867rem; font-weight: 600; color: var(--text); }
.license-opt-price { font-size: 1rem; font-weight: 800; color: var(--primary); margin-top: 4px; }

.product-body {
    padding: 20px 20px 16px; flex: 1; display: flex; flex-direction: column;
}
.product-cat  {
    font-size: 0.733rem; font-weight: 700; color: var(--primary);
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: 7px;
}
.product-name {
    font-size: .98rem; font-weight: 700; color: var(--dark);
    margin-bottom: 7px; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-name:hover { color: var(--primary); }
.product-desc { font-size: 0.867rem; color: var(--text-muted); flex: 1; margin-bottom: 16px; line-height: 1.65; }
.product-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 0.8rem; color: var(--text-muted); }
.product-price-row { display: flex; align-items: center; justify-content: space-between; }
.product-price     { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.product-old-price { font-size: .85rem; text-decoration: line-through; color: var(--text-muted); margin-left: 6px; }
.product-coming-soon-label { font-size: 0.9rem; font-weight: 600; color: #1e40af; background: #eff6ff; padding: 4px 12px; border-radius: 6px; display: inline-block; }
.coming-soon-badge { font-size: 1.1rem; font-weight: 700; color: #1e40af; background: #eff6ff; padding: 8px 18px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px; }

/* Add to cart button on card */
.btn-add-cart {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 8px 16px; border-radius: var(--radius-full);
    font-size: 0.867rem; font-weight: 600;
    background: var(--primary-light); color: var(--primary);
    border: none; cursor: pointer; transition: all var(--transition);
}
.btn-add-cart:hover {
    background: var(--primary); color: #fff;
    box-shadow: 0 4px 14px rgba(108,99,255,.35);
}

/* ============================================================
   CATEGORIES SECTION
   ============================================================ */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }

.category-card {
    background: #fff; border-radius: var(--radius-md);
    padding: 28px 16px 22px; text-align: center;
    border: 1.5px solid var(--border);
    transition: all var(--transition); cursor: pointer;
    box-shadow: var(--shadow-xs);
}
.category-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.category-icon {
    font-size: 2.2rem; margin-bottom: 12px;
    display: flex; align-items: center; justify-content: center;
    width: 60px; height: 60px; margin-left: auto; margin-right: auto;
    transition: transform var(--transition);
}
.category-icon img {
    width: 52px; height: 52px;
    object-fit: contain; border-radius: 8px; display: block;
}
.category-card:hover .category-icon { transform: scale(1.12); }
.category-name  { font-size: 0.933rem; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.category-count { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================================
   FEATURES / HOW IT WORKS
   ============================================================ */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }

.feature-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 32px 26px; border: 1px solid var(--border);
    transition: all var(--transition); box-shadow: var(--shadow-xs);
    position: relative; overflow: hidden;
}
.feature-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transform: scaleX(0); transform-origin: left;
    transition: transform .3s ease;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.feature-card:hover::before { transform: scaleX(1); }

.feature-head {
    display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}
.feature-icon {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    background: var(--primary-light); display: flex; align-items: center;
    justify-content: center; font-size: 1.4rem; flex-shrink: 0;
    transition: all var(--transition);
}
.feature-card:hover .feature-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; box-shadow: 0 8px 20px rgba(108,99,255,.3);
}
.feature-title { font-size: 1rem; font-weight: 700; }
.feature-desc  { font-size: 0.933rem; color: var(--text-muted); line-height: 1.7; }

/* ============================================================
   PAGE HERO (inner pages)
   ============================================================ */
.page-hero {
    background: linear-gradient(150deg, #0c0b18 0%, #1a1635 60%, #1f1260 100%);
    padding: 60px 0 104px; position: relative; overflow: hidden;
}
.page-hero::before {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 76px;
    background: var(--bg);
    clip-path: ellipse(55% 100% at 50% 100%);
}
.page-hero h1 { color: #fff; font-size: 1.9rem; }
.page-hero p  { color: rgba(255,255,255,.65); font-size: .95rem; margin-top: 6px; }
.breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.867rem; color: rgba(255,255,255,.45); margin-bottom: 12px;
}
.breadcrumb a { color: rgba(255,255,255,.65); transition: color var(--transition); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb-sep { opacity: .4; }

/* ============================================================
   PRODUCT LIST PAGE
   ============================================================ */
.products-page   { padding: 52px 0; }
.products-layout { display: grid; grid-template-columns: 268px 1fr; gap: 32px; }
@media (max-width: 900px) { .products-layout { grid-template-columns: 1fr; } }

.filter-sidebar {
    background: #fff; border-radius: var(--radius-lg);
    padding: 26px; border: 1px solid var(--border);
    height: fit-content; box-shadow: var(--shadow-xs);
    position: sticky; top: calc(var(--header-h) + 16px);
}
.filter-title {
    font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .06em;
    margin-bottom: 14px; margin-top: 22px;
}
.filter-title:first-child { margin-top: 0; }
.filter-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-xs);
    cursor: pointer; transition: background var(--transition);
}
.filter-item:hover { background: var(--primary-light); }
.filter-item input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.filter-item label { font-size: 0.933rem; cursor: pointer; flex: 1; }
.filter-count { font-size: 0.8rem; color: var(--text-muted); }

.products-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
    padding: 14px 18px; background: #fff;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}
.toolbar-count   { font-size: 0.933rem; color: var(--text-muted); }
.toolbar-sort    { display: flex; align-items: center; gap: 8px; font-size: 0.933rem; }
.toolbar-sort select {
    padding: 7px 36px 7px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-xs); font-size: 0.933rem; background: #fff;
    cursor: pointer; transition: border-color var(--transition);
}
.toolbar-sort select:focus { outline: none; border-color: var(--primary); }

/* ============================================================
   PRODUCT DETAIL PAGE
   ============================================================ */
.product-detail-page { padding: 52px 0; overflow-x: hidden; }

/* Cover / Banner image */
.product-cover-banner {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
.product-cover-banner img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    display: block;
}

.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: start; }

.product-gallery { position: sticky; top: calc(var(--header-h) + 20px); min-width: 0; }
.product-gallery-main {
    aspect-ratio: 4/3; border-radius: var(--radius-lg);
    overflow: hidden; border: 1px solid var(--border);
    background: var(--dark-2); box-shadow: var(--shadow-md);
    position: relative; width: 100%;
}
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-gallery-thumbs { display: flex; gap: 10px; margin-top: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gallery-thumb {
    width: 74px; height: 58px; border-radius: var(--radius-xs);
    border: 2px solid var(--border); overflow: hidden; cursor: pointer;
    transition: all var(--transition); flex-shrink: 0;
}
.gallery-thumb:hover { border-color: var(--primary); transform: scale(1.04); }
.gallery-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,99,255,.2); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-info { min-width: 0; }

@media (max-width: 768px) {
    .product-detail-grid { grid-template-columns: 1fr; gap: 24px; }
    .product-gallery { position: static !important; }
    .product-detail-page { padding: 28px 0; }
    .product-cover-banner { margin-bottom: 20px; border-radius: var(--radius-md); }
    .product-gallery-main { aspect-ratio: 16/10; }
    .gallery-thumb { width: 60px; height: 46px; }
}
@media (max-width: 480px) {
    .product-detail-page .container { padding: 0 16px; }
    .product-gallery-main { border-radius: var(--radius-md); }
    .gallery-thumb { width: 52px; height: 40px; }
}

.product-info-cat   { font-size: 0.8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.product-info-title { font-size: 1.85rem; font-weight: 800; line-height: 1.2; margin-bottom: 14px; letter-spacing: -.02em; }
.product-info-rating { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 0.933rem; }
.stars { color: var(--warning); letter-spacing: 2px; }
.product-info-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.price-main { font-size: 2.1rem; font-weight: 800; color: var(--primary); }
.price-old  { font-size: 1.1rem; text-decoration: line-through; color: var(--text-muted); }
.price-save {
    font-size: 0.8rem; background: #fef3c7; color: #92400e;
    padding: 4px 12px; border-radius: var(--radius-full); font-weight: 700;
}

.product-info-desc  { color: var(--text-muted); font-size: .95rem; margin-bottom: 26px; line-height: 1.8; }
.product-info-meta  {
    background: var(--bg); border-radius: var(--radius-md);
    padding: 18px 20px; margin-top: 16px; margin-bottom: 26px;
    border: 1px solid var(--border);
}
.meta-row { display: flex; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.933rem; }
.meta-row:last-child { border-bottom: none; }
.meta-label { font-weight: 600; color: var(--text-muted); min-width: 120px; }
.meta-value { color: var(--text); }
.product-info-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.product-tabs { margin-top: 56px; }
.tabs-nav { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 28px; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs-nav::-webkit-scrollbar { display: none; }
.tab-btn {
    padding: 12px 22px; font-size: 0.933rem; font-weight: 600;
    color: var(--text-muted); border-bottom: 2px solid transparent;
    white-space: nowrap; flex-shrink: 0;
    margin-bottom: -2px; transition: all var(--transition);
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}
.tab-btn:hover { color: var(--primary); background: var(--primary-light); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ============================================================
   CART PAGE
   ============================================================ */
.cart-page   { padding: 52px 0; }
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th {
    padding: 12px 18px; text-align: left; font-size: 0.8rem; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 2px solid var(--border); background: var(--bg);
}
.cart-table td { padding: 18px; vertical-align: middle; border-bottom: 1px solid var(--border); }
.cart-product { display: flex; align-items: center; gap: 16px; }
.cart-product-img {
    width: 68px; height: 52px; border-radius: var(--radius-xs);
    overflow: hidden; flex-shrink: 0; background: var(--dark-2);
    box-shadow: var(--shadow-xs);
}
.cart-product-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-product-name { font-weight: 600; font-size: 0.933rem; }
.cart-qty { display: flex; align-items: center; gap: 8px; }
.qty-btn {
    width: 30px; height: 30px; border-radius: var(--radius-xs);
    border: 1.5px solid var(--border); background: #fff; font-size: 1.067rem;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); line-height: 1;
}
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.qty-input {
    width: 46px; text-align: center; border: 1.5px solid var(--border);
    border-radius: var(--radius-xs); padding: 4px; font-size: 0.933rem;
}
.remove-btn { color: var(--text-muted); font-size: 1.2rem; transition: color var(--transition); padding: 4px; border-radius: 50%; }
.remove-btn:hover { color: var(--danger); background: #fef2f2; }

.cart-summary-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 26px; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky; top: calc(var(--header-h) + 20px);
}
.summary-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 22px; }
.summary-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 0.933rem; border-bottom: 1px solid var(--border); }
.summary-row:last-of-type { border-bottom: none; }
.summary-total { display: flex; justify-content: space-between; padding: 18px 0 0; font-size: 1.1rem; font-weight: 800; }
.coupon-form { display: flex; gap: 8px; margin: 16px 0; }
.coupon-input { flex: 1; }
.coupon-applied {
    display: flex; align-items: center; gap: 8px; margin: 16px 0;
    padding: 10px 14px; border-radius: var(--radius-md);
    background: #ecfdf5; border: 1.5px solid #10b981;
}

/* ============================================================
   CHECKOUT
   ============================================================ */
.checkout-page   { padding: 52px 0; }
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-section {
    background: #fff; border-radius: var(--radius-lg);
    padding: 30px; border: 1px solid var(--border);
    margin-bottom: 20px; box-shadow: var(--shadow-xs);
}
.checkout-section-title {
    font-size: 1rem; font-weight: 700; margin-bottom: 22px;
    display: flex; align-items: center; gap: 10px; color: var(--dark);
}
.payment-options { display: grid; gap: 12px; }
.payment-option {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px; border: 1.5px solid var(--border);
    border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition);
}
.payment-option:has(input:checked) { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(108,99,255,.1); }
.payment-option input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; flex-shrink: 0; }
.payment-option-name { font-weight: 600; font-size: 0.933rem; }
.payment-option-desc { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(ellipse 70% 60% at 30% 40%, rgba(108,99,255,.2) 0%, transparent 60%),
        linear-gradient(150deg, #0c0b18 0%, #1a1635 50%, #1f1260 100%);
}
.auth-card {
    background: #fff; border-radius: var(--radius-xl);
    padding: 44px; width: 100%; max-width: 440px;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,.05);
}
.auth-logo  { text-align: center; margin-bottom: 30px; }
.auth-title { font-size: 1.55rem; font-weight: 800; text-align: center; margin-bottom: 6px; letter-spacing: -.02em; }
.auth-sub   { text-align: center; color: var(--text-muted); font-size: 0.933rem; margin-bottom: 30px; }
.auth-footer{ text-align: center; font-size: 0.933rem; margin-top: 22px; color: var(--text-muted); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: linear-gradient(160deg, #0c0b18 0%, #0f0e1a 60%, #110e2a 100%);
    color: rgba(255,255,255,.65);
    padding: 72px 0 0; margin-top: 88px;
    position: relative;
}
.site-footer::before {
    content: ''; position: absolute; top: -1px; left: 0; right: 0;
    height: 1px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 44px; margin-bottom: 52px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand .logo-light { color: #fff; }
.footer-brand .logo-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 16px rgba(108,99,255,.4);
}
.footer-tagline { color: rgba(255,255,255,.4); font-size: 0.8rem; margin: 10px 0 6px; }
.footer-desc    { font-size: 0.933rem; line-height: 1.8; margin-bottom: 22px; color: rgba(255,255,255,.55); }
.footer-social  { display: flex; gap: 10px; }
.social-link {
    width: 38px; height: 38px; border-radius: var(--radius-xs);
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); color: rgba(255,255,255,.7);
    font-size: 1rem;
}
.social-link:hover {
    background: var(--primary); border-color: var(--primary);
    color: #fff; transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108,99,255,.4);
}

.footer-heading {
    color: #fff; font-size: 0.867rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: 18px;
}
.footer-links li { margin-bottom: 10px; }
.footer-links a  { font-size: 0.933rem; color: rgba(255,255,255,.55); transition: color var(--transition); }
.footer-links a:hover { color: #fff; }
.footer-contact li  { display: flex; gap: 10px; font-size: 0.933rem; margin-bottom: 12px; align-items: flex-start; color: rgba(255,255,255,.55); }
.footer-contact span{ flex-shrink: 0; color: var(--primary); margin-top: 2px; }
.footer-contact a   { color: rgba(255,255,255,.55); }
.footer-contact a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 26px 0;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 14px; font-size: 0.867rem; color: rgba(255,255,255,.35);
}
.footer-bottom-links { display: flex; gap: 22px; }
.footer-bottom-links a { color: rgba(255,255,255,.4); transition: color var(--transition); }
.footer-bottom-links a:hover { color: rgba(255,255,255,.8); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 44px; flex-wrap: wrap; }
.page-btn {
    min-width: 40px; height: 40px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-xs); border: 1.5px solid var(--border);
    font-size: 0.933rem; font-weight: 500; color: var(--text);
    transition: all var(--transition); background: #fff;
    box-shadow: var(--shadow-xs);
}
.page-btn:hover, .page-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent; color: #fff;
    box-shadow: 0 4px 14px rgba(108,99,255,.35);
}

/* ============================================================
   MISC UI
   ============================================================ */
.badge { display: inline-block; padding: 3px 11px; border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 600; }
.badge-success  { background: #ecfdf5; color: #065f46; }
.badge-warning  { background: #fffbeb; color: #92400e; }
.badge-danger   { background: #fef2f2; color: #991b1b; }
.badge-info     { background: #eff6ff; color: #1e40af; }
.badge-primary  { background: var(--primary-light); color: var(--primary); }
.badge-muted    { background: var(--bg); color: var(--text-muted); }

.card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-xs); }
.card-body { padding: 26px; }
.card-header {
    padding: 18px 26px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 1rem; }

.section    { padding: 72px 0; }
.section-sm { padding: 44px 0; }
.section-dark { background: var(--dark); }
.section-alt  { background: linear-gradient(135deg, #f0eeff 0%, #f7f6fe 100%); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: var(--shadow-xs); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    background: var(--bg); padding: 13px 18px; text-align: left;
    font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 2px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 15px 18px; border-bottom: 1px solid var(--border); font-size: 0.933rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }

.empty-state { text-align: center; padding: 72px 20px; }
.empty-icon  { font-size: 3.5rem; margin-bottom: 18px; opacity: .35; display: block; }
.empty-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.empty-desc  { font-size: 0.933rem; color: var(--text-muted); margin-bottom: 26px; }

.tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; background: var(--primary-light); color: var(--primary);
    border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 600;
}

/* Loading spinner */
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(108,99,255,.2);
    border-top-color: var(--primary);
    border-radius: 50%; animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
.hidden-sm { display: none; }
@media (min-width: 641px) { .hidden-sm { display: inline; } }

@media (max-width: 768px) {
    .main-nav {
        display: none; position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(255,255,255,.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        padding: 0; flex-direction: column; z-index: 900;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    .main-nav.open { display: flex; }
    .main-nav::before {
        content: ''; display: flex; align-items: center;
        justify-content: space-between; flex-shrink: 0;
        height: var(--header-h); padding: 0 20px;
        border-bottom: 1px solid var(--border);
    }
    .main-nav > .nav-link,
    .main-nav > .nav-dropdown > .nav-link {
        display: flex; align-items: center; justify-content: space-between;
        padding: 16px 20px; margin: 0;
        font-size: 1rem; font-weight: 600; color: var(--text);
        border-bottom: 1px solid var(--border); border-radius: 0;
    }
    .main-nav > .nav-link:hover,
    .main-nav > .nav-dropdown > .nav-link:hover {
        background: var(--primary-light); color: var(--primary);
    }
    .main-nav > .mobile-search + .nav-link { margin-top: 0; }
    .nav-dropdown .dropdown-menu {
        position: static; opacity: 1; visibility: visible;
        transform: none; box-shadow: none;
        border: none; border-bottom: 1px solid var(--border);
        background: var(--bg); margin: 0;
        padding: 6px 0; border-radius: 0;
        display: none;
    }
    .nav-dropdown.open .dropdown-menu { display: block; }
    .nav-dropdown .dropdown-menu .dropdown-item {
        padding: 12px 20px 12px 44px;
        font-size: .93rem; color: var(--text-muted);
        border-radius: 0;
    }
    .nav-dropdown .dropdown-menu .dropdown-item:hover {
        background: var(--primary-light); color: var(--primary);
    }
    .nav-dropdown .dropdown-menu .dropdown-divider { margin: 0; }
    .nav-link.nav-sale {
        margin-top: auto; border-top: 1px solid var(--border);
        border-bottom: none;
        background: linear-gradient(135deg, #fff5f5, #fef2f2);
    }
    .header-search { display: none; }
    .mobile-search {
        display: flex; align-items: center; gap: 10px;
        margin: var(--header-h) 16px 0; padding: 12px 16px;
        background: var(--bg); border-radius: var(--radius-md);
        border: 1px solid var(--border);
    }
    .mobile-search i { color: var(--text-muted); font-size: .9rem; flex-shrink: 0; }
    .mobile-search input {
        flex: 1; border: none; background: transparent; outline: none;
        font-size: .93rem; color: var(--text);
    }
    .main-nav > .nav-link:first-of-type { margin-top: 0; }
    .mobile-toggle { display: flex; z-index: 950; }
    .hero { padding: 52px 0 72px; }
    .hero-stats { gap: 24px; }
    .flash-container { width: calc(100% - 32px); right: 16px; }
    .page-hero::before { display: none; }
}

/* ============================================================
   MOBILE RESPONSIVE — CART / CHECKOUT / PAYMENT / ORDERS
   ============================================================ */

/* ── Cart table → card layout on mobile ── */
@media (max-width: 640px) {
    .cart-page { padding: 28px 0; }
    .cart-layout { gap: 20px; }
    .cart-table thead { display: none; }
    .cart-table,
    .cart-table tbody,
    .cart-table tr,
    .cart-table td { display: block; width: 100%; }
    .cart-table tr {
        padding: 16px;
        border-bottom: 1px solid var(--border);
        position: relative;
    }
    .cart-table td { padding: 4px 0; border: none; }
    .cart-table td:first-child { padding-bottom: 10px; }
    .cart-product { gap: 12px; }
    .cart-product-img { width: 56px; height: 44px; }
    .cart-product-name { font-size: 0.875rem; }
    /* Price + qty + total in a row */
    .cart-table td:nth-child(2),
    .cart-table td:nth-child(3),
    .cart-table td:nth-child(4) {
        display: inline-block;
        width: auto;
        vertical-align: middle;
    }
    .cart-table td:nth-child(2) { min-width: 90px; }
    .cart-table td:nth-child(2)::before { content: ''; }
    .cart-table td:nth-child(4) {
        font-weight: 700;
        float: right;
    }
    /* Delete button */
    .cart-table td:last-child {
        position: absolute;
        top: 16px;
        right: 8px;
        width: auto;
    }
    .cart-qty { gap: 4px; }
    .qty-btn { width: 28px; height: 28px; font-size: 0.9rem; }
    .qty-input { width: 38px; font-size: 0.85rem; }
    .cart-summary-card { padding: 20px; position: static; }
    .summary-title { margin-bottom: 16px; }
    .coupon-form { flex-direction: column; }
}

/* ── Checkout ── */
@media (max-width: 640px) {
    .checkout-page { padding: 28px 0; }
    .checkout-layout { gap: 20px; }
    .checkout-section { padding: 20px 16px; }
    .checkout-section-title { font-size: 0.95rem; margin-bottom: 16px; }
    .payment-option { padding: 12px 14px; gap: 10px; }
    .payment-option-name { font-size: 0.875rem; }
}

/* ── Payment page inline grid ── */
@media (max-width: 900px) {
    .pay-grid { grid-template-columns: 1fr !important; }
    .pay-grid > div:last-child { order: -1; }
}
@media (max-width: 640px) {
    .pay-grid { gap: 16px !important; }
}

/* ── My-Orders table → card layout on mobile ── */
@media (max-width: 640px) {
    .orders-table thead { display: none; }
    .orders-table,
    .orders-table tbody,
    .orders-table tr,
    .orders-table td { display: block; width: 100%; }
    .orders-table tr {
        padding: 16px;
        margin-bottom: 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: #fff;
    }
    .orders-table td {
        padding: 4px 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .orders-table td::before {
        font-weight: 600;
        font-size: 0.8rem;
        color: var(--text-muted);
        flex-shrink: 0;
        margin-right: 12px;
    }
    .orders-table td:nth-child(1)::before { content: 'เลขที่'; }
    .orders-table td:nth-child(2)::before { content: 'วันที่'; }
    .orders-table td:nth-child(3)::before { content: 'รายการ'; }
    .orders-table td:nth-child(4)::before { content: 'ยอดรวม'; }
    .orders-table td:nth-child(5)::before { content: 'ชำระ'; }
    .orders-table td:nth-child(6)::before { content: 'สถานะ'; }
    .orders-table td:last-child {
        justify-content: flex-end;
        padding-top: 8px;
    }
}
