@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: hidden; width: 100%; }

body {
    font-family: "DM Sans", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

:root {
    --primary: #f97316;
    --primary-light: rgba(249,115,22,0.15);
    --bg: #0a0a0f;
    --card: rgba(255,255,255,0.04);
    --border: rgba(255,255,255,0.08);
    --secondary: #1a1a26;
    --text: #f5f5f7;
    --muted: #9ca3af;
    --radius: 0.75rem;
}

.font-display { font-family: "Space Grotesk", sans-serif; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────── */
.container    { max-width: 90rem; margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px)  { .container { padding: 0 2rem; } .container-sm { padding: 0 2rem; } }
@media (min-width: 1280px) { .container { padding: 0 4rem; } .container-sm { padding: 0 4rem; } }

/* ── Glass card ─────────────────────────────────────────── */
.glass-card {
    background: var(--card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(10,10,15,0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
}
.navbar-inner {
    max-width: 90rem; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; gap: 1rem;
}
@media (min-width: 1280px) { .navbar { padding: 0 4rem; } }
.navbar-brand {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.25rem; font-weight: 700;
    color: var(--text); flex-shrink: 0;
}
.navbar-brand span { color: var(--primary); }
.navbar-links { display: flex; align-items: center; gap: 0.25rem; flex: 1; }
.navbar-links a {
    padding: 0.4rem 0.85rem; border-radius: 0.5rem;
    font-size: 0.875rem; color: var(--muted);
    transition: color 0.2s, background 0.2s;
}
.navbar-links a:hover, .navbar-links a.active { color: var(--text); background: rgba(255,255,255,0.06); }
.navbar-right { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }

/* Cart button */
.cart-btn {
    background: none; border: 1px solid var(--border);
    color: var(--text); padding: 0.4rem 0.85rem; border-radius: 0.5rem;
    cursor: pointer; font-size: 0.875rem; transition: border-color 0.2s;
    display: flex; align-items: center; gap: 0.4rem;
}
.cart-btn:hover { border-color: var(--primary); }
.cart-count {
    background: var(--primary); color: #fff;
    font-size: 0.65rem; font-weight: 700;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* ── User dropdown ──────────────────────────────────────── */
.user-menu { position: relative; }
.user-btn {
    background: none; border: 1px solid var(--border);
    color: var(--text); width: 36px; height: 36px;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.2s; padding: 0;
}
.user-btn:hover { border-color: var(--primary); }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: 0.8rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.user-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0;
    background: #13131a; border: 1px solid var(--border);
    border-radius: 0.75rem; min-width: 210px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    z-index: 200; display: none; overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown-header { padding: 14px 16px; }
.user-dropdown-name  { font-weight: 600; font-size: 0.875rem; color: var(--text); margin-bottom: 2px; }
.user-dropdown-email { font-size: 0.75rem; color: var(--muted); }
.user-dropdown-divider { border: none; border-top: 1px solid var(--border); }
.user-dropdown-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 10px 16px; font-size: 0.875rem; color: var(--muted);
    text-decoration: none; transition: background 0.15s, color 0.15s;
    cursor: pointer;
}
.user-dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.user-dropdown-logout { color: #f87171; }
.user-dropdown-logout:hover { background: rgba(239,68,68,0.1); color: #f87171; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 1.25rem; border-radius: 0.6rem;
    font-size: 0.875rem; font-weight: 600; cursor: pointer;
    border: none; transition: all 0.2s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #ea6c0a; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: rgba(255,255,255,0.3); }
.btn-ghost { background: transparent; color: var(--muted); border: none; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm  { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.form-input, .form-select, .form-textarea {
    background: var(--secondary); border: 1px solid var(--border);
    color: var(--text); padding: 0.55rem 0.85rem;
    border-radius: 0.5rem; font-size: 0.875rem; width: 100%;
    transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--primary);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select option { background: var(--secondary); }

/* ── Hero slider ────────────────────────────────────────── */
.hero-section {
    position: relative;
    width: 100%;
    height: calc(100vh - 64px);
    overflow: hidden;
    background: #111;
}
.hero-slide {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    transition: opacity 0.7s ease;
    will-change: opacity;
}
.hero-slide.active { opacity: 1; }
.hero-slide img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.hero-badges-bar {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 5;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    gap: 2.5rem; padding: 0.85rem 1rem; flex-wrap: wrap;
}
.hero-badge-item {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.875rem; color: #d1d5db;
}
.hero-badge-item svg { color: var(--primary); flex-shrink: 0; }

/* ── Product card ───────────────────────────────────────── */
.product-card {
    border-radius: 1rem; overflow: hidden;
    background: #1a1a26; border: 1px solid var(--border);
    transition: border-color 0.3s, transform 0.2s;
    display: flex; flex-direction: column;
}
.product-card:hover { border-color: rgba(249,115,22,0.4); transform: translateY(-3px); }
.product-card-img {
    aspect-ratio: 1; overflow: hidden;
    background: #2a2a3a; position: relative;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.product-card:hover .product-card-img img { transform: scale(1.06); }
.product-card-img .no-img {
    width: 100%; height: 100%; display: flex;
    align-items: center; justify-content: center;
    color: var(--muted); font-size: 0.875rem;
}
.product-price-badge {
    position: absolute; top: 0.65rem; right: 0.65rem;
    background: #7c3aed; color: #fff;
    font-size: 0.78rem; font-weight: 700;
    padding: 0.25rem 0.6rem; border-radius: 0.4rem;
    letter-spacing: 0.01em;
}
.product-price-badge.is-original { text-decoration: line-through; opacity: 0.85; }
.product-sale-badge {
    position: absolute; top: 0.65rem; left: 0.65rem;
    background: #e11d48; color: #fff;
    font-size: 0.78rem; font-weight: 700;
    padding: 0.25rem 0.6rem; border-radius: 0.4rem;
}
/* When both badges present, stack them on mobile */
@media (max-width: 480px) {
    .product-price-badge { font-size: 0.68rem; padding: 0.2rem 0.4rem; top: 0.4rem; right: 0.4rem; }
    .product-sale-badge  { font-size: 0.68rem; padding: 0.2rem 0.4rem; top: 0.4rem; left: 0.4rem; }
    .product-price-badge.is-original { top: 2rem; right: 0.4rem; }
}
.product-card-body { padding: 0.9rem 1rem 1rem; flex: 1; display: flex; flex-direction: column; }
@media (max-width: 480px) { .product-card-body { padding: 0.6rem 0.65rem 0.75rem; } .product-card-name { font-size: 0.875rem; } }
.product-card-meta { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.65rem; }
.product-meta-row { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.product-meta-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0; }
.size-chip {
    font-size: 0.78rem; font-weight: 600; color: var(--text);
    border: 1px solid var(--border); border-radius: 0.3rem;
    padding: 0.15rem 0.5rem; background: rgba(255,255,255,0.05);
}
.color-dot {
    width: 14px; height: 14px; border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.25); flex-shrink: 0;
    display: inline-block;
}
.meta-more { font-size: 0.72rem; color: var(--muted); }
.product-card-name { font-weight: 700; font-size: 1rem; margin-bottom: 0.2rem; }
.product-card-desc { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.75rem; flex: 1; }
.product-card-price { display: flex; align-items: baseline; gap: 0.35rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.price-main { color: var(--primary); font-weight: 700; }
.price-old  { color: var(--muted); text-decoration: line-through; font-size: 0.875rem; }
@media (max-width: 480px) { .price-main { font-size: 0.875rem; } .price-old { font-size: 0.75rem; } }
.product-card-atc {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: linear-gradient(90deg,#2563eb,#7c3aed);
    color: #fff; font-weight: 600; font-size: 0.875rem;
    padding: 0.6rem 1rem; border-radius: 0.5rem;
    border: none; cursor: pointer; text-decoration: none;
    transition: opacity 0.2s;
}
.product-card-atc:hover { opacity: 0.88; }

/* ── Products grid ──────────────────────────────────────── */
.products-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 0.75rem; }
@media (min-width: 768px)  { .products-grid { grid-template-columns: repeat(3,1fr); gap: 1.25rem; } }
@media (min-width: 1024px) { .products-grid { grid-template-columns: repeat(4,1fr); gap: 1.25rem; } }

/* ── Pills ──────────────────────────────────────────────── */
.pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pill {
    padding: 0.35rem 1rem; border-radius: 9999px;
    font-size: 0.875rem; border: 1px solid var(--border);
    cursor: pointer; transition: all 0.2s; background: none; color: var(--text);
    text-decoration: none; display: inline-block;
}
.pill:hover  { border-color: rgba(255,255,255,0.4); }
.pill.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ── Status badges ──────────────────────────────────────── */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; text-transform: capitalize; }
.badge-pending    { background: rgba(234,179,8,0.2);  color: #fde047; }
.badge-processing { background: rgba(59,130,246,0.2); color: #93c5fd; }
.badge-shipped    { background: rgba(168,85,247,0.2); color: #d8b4fe; }
.badge-delivered  { background: rgba(34,197,94,0.2);  color: #86efac; }
.badge-cancelled  { background: rgba(239,68,68,0.2);  color: #fca5a5; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; margin-bottom: 1rem; }
.alert-error   { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3);  color: #86efac; }

/* ── Sections ───────────────────────────────────────────── */
.section { padding: 4rem 0; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 2rem; }
.section-title  { font-family: "Space Grotesk", sans-serif; font-size: clamp(1.5rem,3vw,2.25rem); font-weight: 700; }

/* ── Tabs ───────────────────────────────────────────────── */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.tab-btn {
    padding: 0.75rem 1.25rem; font-size: 0.875rem; font-weight: 500;
    border: none; background: none; color: var(--muted); cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.2s;
    text-decoration: none; display: inline-block;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Cart drawer ────────────────────────────────────────── */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; display: none; }
.cart-overlay.open { display: block; }
.cart-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 420px;
    background: #111118; border-left: 1px solid var(--border);
    z-index: 101; transform: translateX(100%); transition: transform 0.3s ease;
    display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.cart-drawer-body   { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.cart-drawer-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); }
.cart-item       { display: flex; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.cart-item-img   { width: 64px; height: 64px; border-radius: 0.5rem; object-fit: cover; background: var(--secondary); flex-shrink: 0; }
.cart-item-info  { flex: 1; min-width: 0; }
.cart-item-name  { font-weight: 600; font-size: 0.875rem; }
.cart-item-meta  { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
.cart-item-price { font-weight: 700; color: var(--primary); font-size: 0.875rem; margin-top: 0.25rem; }
.cart-item-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0.25rem; }
.cart-item-remove:hover { color: #f87171; }
.qty-control { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 0.4rem; overflow: hidden; width: fit-content; margin-top: 0.4rem; }
.qty-btn { background: none; border: none; color: var(--text); padding: 0.25rem 0.6rem; cursor: pointer; font-size: 1rem; }
.qty-btn:hover { background: rgba(255,255,255,0.08); }
.qty-val { padding: 0.25rem 0.6rem; font-size: 0.875rem; font-weight: 600; min-width: 2rem; text-align: center; }

/* ── Admin ──────────────────────────────────────────────── */
.admin-row { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 0.75rem; background: var(--card); border: 1px solid var(--border); margin-bottom: 0.75rem; }
.admin-row-img     { width: 56px; height: 56px; border-radius: 0.5rem; object-fit: cover; background: var(--secondary); flex-shrink: 0; }
.admin-row-info    { flex: 1; min-width: 0; }
.admin-row-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.stat-card  { padding: 1.25rem; }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.35rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; }
.filter-panel { background: var(--card); border: 1px solid var(--border); border-radius: 1rem; padding: 1.25rem; margin-bottom: 2rem; display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; }
.check-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; cursor: pointer; }
.check-label input[type=checkbox] { accent-color: var(--primary); width: 15px; height: 15px; }

/* ── Pagination ─────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 3rem; flex-wrap: wrap; }
.page-btn {
    width: 2.25rem; height: 2.25rem; border-radius: 0.5rem;
    border: 1px solid var(--border); background: none; color: var(--text);
    font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.page-btn:hover  { border-color: rgba(255,255,255,0.4); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Utilities ──────────────────────────────────────────── */
.text-primary   { color: var(--primary); }
.text-muted     { color: var(--muted); }
.text-center    { text-align: center; }
.flex           { display: flex; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-4 { margin-top: 1rem; } .mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.py-32 { padding: 8rem 0; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rounded-full { border-radius: 9999px; }
.line-through { text-decoration: line-through; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.empty-state { text-align: center; padding: 5rem 1rem; color: var(--muted); }
.empty-state svg { margin: 0 auto 1rem; opacity: 0.4; }
.spinner { width: 2.5rem; height: 2.5rem; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Grid helpers ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .grid-4 { grid-template-columns: 1fr 1fr; } }

/* ── Product detail page ────────────────────────────────── */
.pd-card { padding: 1rem; border-radius: 1rem; }
.pd-grid { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .pd-card { padding: 2.5rem; } .pd-grid { grid-template-columns: 1fr 1fr; gap: 3rem; } }

/* ── Mobile nav ─────────────────────────────────────────── */
.nav-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; }
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .navbar-links {
        display: none; position: absolute; top: 64px; left: 0; right: 0;
        background: #111118; border-bottom: 1px solid var(--border);
        flex-direction: column; padding: 0.75rem; gap: 0.25rem; z-index: 49;
    }
    .navbar-links.open { display: flex; }
    .user-dropdown { right: 0; min-width: 190px; }
}
