:root {
    --primary-black: #000000;
    --primary-white: #ffffff;
    --samsung-blue: #0070c1;
    --samsung-gray-bg: #f7f7f7;
    --samsung-green: #008a00;
    --border-gray: #e5e5e5;
    --text-muted: #707070;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.05);
    --radius-card: 20px;
    --radius-sm: 12px;
    /* Liquid Glass tokens */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-bg-strong: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(255, 255, 255, 0.45);
    --glass-blur: saturate(180%) blur(20px);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --radius-pill: 999px;
    --radius-panel: 24px;
    --header-height: 56px;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--primary-white);
    color: var(--primary-black);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ─── Layout ─── */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ─── Navigation ─── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-gray);
    height: 64px;
    display: flex;
    align-items: center;
    transition: var(--transition-smooth);
}

.nav-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 900;
    font-size: 1.3rem;
    letter-spacing: -1px;
    text-decoration: none;
    color: var(--primary-black);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-black);
    font-weight: 600;
    font-size: 0.85rem;
    position: relative;
    white-space: nowrap;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-black);
    transition: var(--transition-smooth);
}

.nav-links a:hover::after { width: 100%; }

.nav-icons {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.nav-icons i { font-size: 1.2rem; cursor: pointer; }

/* ─── Mobile Menu ─── */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--primary-black);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border-gray);
    padding: 1rem 1.5rem;
    z-index: 999;
    flex-direction: column;
    gap: 0;
}

.mobile-nav.open { display: flex; }
.mobile-nav a {
    display: block;
    padding: 0.9rem 0;
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary-black);
    text-decoration: none;
    border-bottom: 1px solid var(--border-gray);
}
.mobile-nav a:last-child { border-bottom: none; }

/* ─── Hero ─── */
.hero {
    padding: 3rem 0 1.5rem;
    text-align: left;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

/* ─── Category Slider ─── */
.category-slider {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-bottom: 1px solid var(--border-gray);
    margin-bottom: 2.5rem;
}

.category-slider::-webkit-scrollbar { display: none; }

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    min-width: 70px;
    text-align: center;
    transition: var(--transition-smooth);
    opacity: 0.5;
    border-bottom: 3px solid transparent;
    padding-bottom: 1rem;
}

.category-item.active { opacity: 1; border-bottom-color: var(--primary-black); }
.category-item i { font-size: 1.3rem; }
.category-item span { font-weight: 600; font-size: 0.8rem; }

/* ─── Products Grid ─── */
.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 4rem;
}

.offer-card {
    background: var(--samsung-gray-bg);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.offer-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.offer-card .badge {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    background: var(--primary-black);
    color: var(--primary-white);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.offer-image {
    width: 100%;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.offer-image img {
    max-width: 85%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.offer-info { flex-grow: 1; }

.offer-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.offer-variants {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.variant-btn {
    border: 1px solid var(--border-gray);
    background: var(--primary-white);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.variant-btn.active {
    border-color: var(--primary-black);
    background: var(--primary-black);
    color: var(--primary-white);
}

.price-container { margin-top: auto; }

.offer-price {
    font-size: 1.4rem;
    font-weight: 700;
}

.offer-save {
    color: var(--samsung-green);
    font-weight: 700;
    font-size: 0.85rem;
}

.offer-cta { margin-top: 1.2rem; }

.btn-buy {
    background: var(--primary-black);
    color: var(--primary-white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.btn-buy:hover { background: #333; }

/* ─── Skeleton Loading ─── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 12px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: var(--samsung-gray-bg);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    height: 380px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skeleton-image { height: 200px; border-radius: 12px; }
.skeleton-text-lg { height: 20px; width: 80%; border-radius: 6px; }
.skeleton-text-sm { height: 16px; width: 50%; border-radius: 6px; }
.skeleton-btn { height: 42px; border-radius: 30px; margin-top: auto; }

/* ─── Footer ─── */
.footer {
    background: var(--primary-white);
    border-top: 1px solid var(--border-gray);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    margin-bottom: 1.2rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.7rem; }

.footer-col a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.footer-col a:hover {
    color: var(--primary-black);
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid var(--border-gray);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ─── Animations ─── */
[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.7s ease-out;
}

[data-reveal].active {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Cart ─── */
.cart-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--primary-black);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary-black);
    color: var(--primary-white);
    font-size: 0.65rem;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
}

/* ─── User Dropdown ─── */
.user-menu-container {
    position: relative;
    display: inline-block;
}

.nav-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 0;
    display: flex;
    align-items: center;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: -10px;
    width: 250px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    padding: 1.5rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
}

.user-menu-container:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-container::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    height: 20px;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-avatar-small {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-gray);
}

#dropdownUserName { font-weight: 700; font-size: 0.95rem; }

.dropdown-divider {
    height: 1px;
    background: var(--border-gray);
    margin: 1rem 0;
}

.dropdown-links { list-style: none; padding: 0; }
.dropdown-links li { margin-bottom: 0.4rem; }

.dropdown-links a {
    text-decoration: none;
    color: var(--primary-black);
    font-weight: 500;
    font-size: 0.9rem;
    display: block;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.dropdown-links a:hover { color: var(--text-muted); }

/* ─── Admin Sidebar shared ─── */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--primary-white);
    border-right: 1px solid var(--border-gray);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo { font-weight: 900; font-size: 1.1rem; margin-bottom: 2.5rem; }

.nav-menu { list-style: none; flex-grow: 1; }
.nav-item { margin-bottom: 0.3rem; }

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.9rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.nav-item a:hover, .nav-item a.active {
    background: var(--samsung-gray-bg);
    color: var(--primary-black);
}

.admin-main {
    background: var(--samsung-gray-bg);
    padding: 2.5rem;
    min-height: 100vh;
}

/* ─── Stat Cards ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--primary-white);
    padding: 1.4rem;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-subtle);
}

.stat-card h4 {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.stat-card .value {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.stat-alert { color: #ff4d4d !important; }
.stat-ok { color: var(--samsung-green) !important; }

/* ─── Table ─── */
.table { width: 100%; border-collapse: collapse; }

.table th {
    text-align: left;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-gray);
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-gray);
    font-size: 0.88rem;
    vertical-align: middle;
}

.table tbody tr:hover { background: #fafafa; }
.table tbody tr:last-child td { border-bottom: none; }

/* Stock pills */
.stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.stock-ok { background: #e6f4ea; color: #1e8e3e; }
.stock-low { background: #fff3e0; color: #e65100; }
.stock-out { background: #fde8e8; color: #c62828; }

/* Profit badge */
.profit-badge {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--samsung-green);
}

.profit-pct {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Status badges */
.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-paid { background: #e6f4ea; color: #1e7e34; }
.status-pending { background: #fff4e5; color: #b7791f; }
.status-shipped { background: #e3f2fd; color: #1565c0; }

/* Filter pills */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 0.45rem 1rem;
    border: 1px solid var(--border-gray);
    border-radius: 20px;
    background: white;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.filter-pill:hover { border-color: #aaa; }

.filter-pill.active {
    background: var(--primary-black);
    color: white;
    border-color: var(--primary-black);
}

/* Toast */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #1d1d1f;
    padding: 11px 22px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 10000;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ─── RESPONSIVE ─── */

/* Tablet landscape */
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet portrait */
@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }

    .sidebar {
        position: relative;
        height: auto;
        flex-direction: row;
        align-items: center;
        padding: 0.8rem 1.5rem;
        overflow-x: auto;
        gap: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-gray);
    }

    .sidebar-logo { margin-bottom: 0; margin-right: 1.5rem; white-space: nowrap; font-size: 0.95rem; }
    .nav-menu { display: flex; gap: 0.3rem; flex-grow: 0; }
    .nav-item { margin-bottom: 0; }
    .nav-item a { padding: 0.5rem 0.75rem; font-size: 0.8rem; gap: 0.4rem; }
    .nav-item a i { width: 16px !important; }
    .admin-main { padding: 1.5rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    /* Hide table columns on tablet */
    .hide-tablet { display: none !important; }
}

/* Mobile */
@media (max-width: 768px) {
    .container { padding: 0 1rem; }

    /* Navbar */
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }

    .hero h1 { font-size: 1.9rem; }
    .hero { padding: 2rem 0 1rem; }

    /* Products: 2 columns on mobile */
    .offers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .offer-card { padding: 1rem; border-radius: 16px; }
    .offer-image { height: 150px; margin-bottom: 1rem; }
    .offer-title { font-size: 0.9rem; }
    .offer-price { font-size: 1.1rem; }
    .btn-buy { padding: 0.65rem 1rem; font-size: 0.8rem; }

    /* Stats: 2 cols */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .stat-card .value { font-size: 1.5rem; }

    /* Footer */
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    .footer { padding: 2.5rem 0 1.5rem; }

    /* Admin */
    .admin-main { padding: 1rem; }

    /* Table scroll */
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Hide extra cols */
    .hide-mobile { display: none !important; }

    /* Category slider */
    .category-slider { gap: 1.2rem; }
    .category-item { min-width: 55px; }
    .category-item span { font-size: 0.72rem; }
}

/* Small mobile */
@media (max-width: 480px) {
    .offers-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .logo { font-size: 1.1rem; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* ─── Flying Image to Cart Animation ─── */
.flying-image {
    position: fixed;
    z-index: 10000;
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(54,101,243,0.5);
    pointer-events: none;
    /* Adding a bezier curve that makes it go up slightly before going to the cart */
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.3, 1), opacity 0.8s ease-in, top 0.8s cubic-bezier(0.5, -0.5, 1, 1), left 0.8s linear;
}

@keyframes cart-bounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.3) rotate(-10deg); }
    60% { transform: scale(1.3) rotate(10deg); }
    80% { transform: scale(1.1) rotate(-5deg); }
    100% { transform: scale(1); }
}

.cart-icon-container.bump {
    animation: cart-bounce 0.4s ease-out;
}

/* ─── Cart Toast Notification (Samsung Style) ─── */
.cart-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--primary-black);
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.92rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    z-index: 10000;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    pointer-events: none;
    white-space: nowrap;
}

.cart-toast::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #e6f4ea;
    color: #1e7e34;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 900;
    flex-shrink: 0;
}

.cart-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ─── Add to Cart Button Animation ─── */
.btn-add-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.35s ease, transform 0.2s ease;
}

.btn-add-cart:active {
    transform: scale(0.95);
}

.btn-label, .btn-added {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.storefront-v2 .btn-add-cart-glass .btn-added {
    display: none;
}

.storefront-v2 .btn-add-cart-glass .btn-label {
    display: inline;
}

/* ═══════════════════════════════════════════════════
   LIQUID GLASS — Index Redesign
   ═══════════════════════════════════════════════════ */

body.panel-open {
    overflow: hidden;
}

/* Index page background — gradient + subtle grain */
body.index-page {
    background: linear-gradient(165deg, #f5f5f7 0%, #ebebef 40%, #f7f7f9 100%);
}

body.index-page::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.index-main,
.index-footer-minimal {
    position: relative;
    z-index: 1;
}

/* Custom scrollbar */
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

/* Fixed glass header */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: var(--transition-smooth);
    padding-top: env(safe-area-inset-top, 0);
}

.glass-header.scrolled {
    background: var(--glass-bg-strong);
    box-shadow: var(--glass-shadow);
}

.glass-header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.glass-header-left {
    display: flex;
    align-items: center;
    justify-self: start;
}

.glass-header-center {
    justify-self: center;
}

.glass-header-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    justify-self: end;
}

.glass-wordmark {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    color: var(--primary-black);
    text-decoration: none;
    white-space: nowrap;
}

.glass-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--primary-black);
    transition: background 0.2s ease, transform 0.15s ease;
    position: relative;
}

.glass-icon-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.glass-icon-btn:active {
    transform: scale(0.94);
}

.glass-icon-btn svg {
    width: 20px;
    height: 20px;
}

.profile-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 0;
    background: var(--samsung-gray-bg);
}

.profile-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-icon-container {
    position: relative;
    text-decoration: none;
    color: inherit;
}

.cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--primary-black);
    color: var(--primary-white);
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorites-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ff3b30;
    color: var(--primary-white);
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
    display: none;
    align-items: center;
    justify-content: center;
}

/* Glass overlay */
.glass-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.glass-overlay.search-mode {
    z-index: 998;
}

.glass-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Glass panels */
.glass-panel {
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.slide-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(420px, 92vw);
    z-index: 1200;
    transform: translateX(-105%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.slide-panel.open {
    transform: translateX(0);
}

.slide-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(440px, 92vw);
    z-index: 1200;
    transform: translateX(105%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.slide-drawer.open {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.panel-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.panel-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Search bar below header */
.glass-search-bar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.75rem 1.25rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0.35s ease;
}

.glass-search-bar.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    z-index: 1001;
}

.glass-search-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.glass-search-input {
    flex: 1;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-pill);
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: background 0.2s;
}

.glass-search-input:focus {
    background: rgba(0, 0, 0, 0.08);
}

/* Main content offset for fixed header */
.index-main {
    padding-top: calc(var(--header-height) + 1rem);
    min-height: 100vh;
    background: transparent;
}

/* Sticky category strip wrapper */
.category-strip-wrap {
    position: sticky;
    top: var(--header-height);
    z-index: 900;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    margin-bottom: 0.5rem;
}

/* Category strip */
.category-strip {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 1.5rem 1.25rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 1440px;
    margin: 0 auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.category-strip::-webkit-scrollbar {
    display: none;
}

.category-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    min-width: 64px;
    min-height: 48px;
    scroll-snap-align: center;
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.25s ease, transform 0.2s ease;
    border: none;
    background: none;
    font-family: inherit;
    color: var(--primary-black);
}

.category-chip:hover,
.category-chip.active {
    opacity: 1;
}

.category-chip:active {
    transform: scale(0.95);
}

.category-chip-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.category-chip.active .category-chip-icon {
    background: var(--primary-black);
    color: var(--primary-white);
    border-color: var(--primary-black);
}

.category-chip-all .category-chip-icon {
    background: rgba(0, 0, 0, 0.04);
}

.category-chip-all.active .category-chip-icon {
    background: var(--primary-black);
    color: var(--primary-white);
}

.category-chip span {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* Homepage sections */
.homepage-sections {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.homepage-section {
    margin-bottom: 3.5rem;
    scroll-margin-top: calc(var(--header-height) + 100px);
}

.homepage-section.hidden-by-search {
    display: none;
}

.section-title {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    text-transform: uppercase;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.75rem;
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2rem;
    }

    .product-card {
        max-width: 340px;
        justify-self: center;
        width: 100%;
    }
}

/* Product card — Apple style */
.product-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-panel);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 0;
    transform: translateY(16px);
}

.product-card.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.25s ease;
}

.product-card.reveal:hover {
    transform: translateY(-2px);
    box-shadow: var(--glass-shadow);
}

@media (prefers-reduced-motion: reduce) {
    .product-card {
        opacity: 1;
        transform: none;
    }

    .product-card.reveal {
        transition: none;
    }

    .product-card.reveal:hover {
        transform: none;
    }
}

.product-card.hidden-by-search {
    display: none;
}

.product-card.search-highlight {
    box-shadow: 0 0 0 2px var(--primary-black);
}

.product-image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: var(--samsung-gray-bg);
    margin-bottom: 0.85rem;
    cursor: pointer;
}

.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image-wrap img {
    transform: scale(1.03);
}

.condition-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 2;
}

.product-name {
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 0.35rem;
    color: var(--primary-black);
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 0.85rem;
    color: var(--primary-black);
}

.product-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.btn-primary-black {
    flex: 1;
    background: var(--primary-black);
    color: var(--primary-white);
    border: none;
    border-radius: var(--radius-pill);
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-primary-black:hover {
    background: #333;
}

.btn-primary-black:active {
    transform: scale(0.97);
}

.btn-primary-black:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-favorite {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    color: var(--primary-black);
}

.btn-favorite:hover {
    background: rgba(0, 0, 0, 0.04);
}

.btn-favorite.active {
    color: #ff3b30;
    border-color: rgba(255, 59, 48, 0.3);
    background: rgba(255, 59, 48, 0.08);
}

.btn-favorite.active svg {
    fill: #ff3b30;
}

.btn-favorite svg {
    width: 18px;
    height: 18px;
}

/* Skeleton loaders */
.skeleton {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
    border-radius: 12px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: var(--glass-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-panel);
    padding: 1rem;
}

.skeleton-image {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    margin-bottom: 0.85rem;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 0.5rem;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.price {
    height: 22px;
    width: 40%;
    margin-bottom: 0.85rem;
}

.skeleton-btn {
    height: 40px;
    border-radius: var(--radius-pill);
}

/* Auth panel forms */
.auth-form-group {
    text-align: left;
    margin-bottom: 1rem;
}

.auth-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.auth-form-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-gray);
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.8);
    transition: border-color 0.2s;
}

.auth-form-group input:focus {
    outline: none;
    border-color: var(--primary-black);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-gray);
}

.auth-divider:not(:empty)::before { margin-right: 0.75rem; }
.auth-divider:not(:empty)::after { margin-left: 0.75rem; }

.btn-google {
    background: white;
    color: var(--primary-black);
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-google:hover {
    background: #f9f9f9;
}

.btn-google img {
    width: 18px;
    height: 18px;
}

.auth-toggle-link {
    color: var(--primary-black);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.signup-only {
    display: none;
}

.signup-mode .signup-only {
    display: block;
}

.auth-intro {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.auth-form-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.auth-form-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.auth-footer-text {
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.auth-submit-btn {
    width: 100%;
    margin-top: 0.5rem;
}

.profile-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.profile-user-content {
    display: none;
}

.profile-user-content.visible {
    display: block;
}

.profile-user-content[hidden] {
    display: none !important;
}

.auth-error-msg {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: #fff0f0;
    color: #c62828;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.4;
}

.auth-error-msg[hidden] {
    display: none;
}

.admin-link a {
    color: #1565c0;
    font-weight: 700;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Error state */
.home-error-card {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-panel);
    max-width: 480px;
    margin: 2rem auto;
}

.home-error-card p {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.btn-retry {
    background: var(--primary-black);
    color: var(--primary-white);
    border: none;
    border-radius: var(--radius-pill);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.profile-user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 0, 0, 0.08);
}

.profile-links {
    list-style: none;
}

.profile-links li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.profile-links a,
.profile-links button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    text-decoration: none;
    color: var(--primary-black);
    font-weight: 500;
    font-size: 0.95rem;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.profile-links a:hover,
.profile-links button:hover {
    opacity: 0.7;
}

/* Cart drawer items */
.cart-drawer-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cart-drawer-thumb {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--samsung-gray-bg);
    display: block;
}

.cart-drawer-info {
    flex: 1;
    min-width: 0;
}

.cart-drawer-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-drawer-price {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
}

.cart-qty-value {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: auto;
    text-decoration: underline;
}

.cart-drawer-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.5);
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.btn-view-cart {
    display: block;
    text-align: center;
    padding: 0.85rem;
    background: var(--primary-black);
    color: var(--primary-white);
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-view-cart:hover {
    background: #333;
}

.panel-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.panel-empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* Favorites panel item */
.fav-panel-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.fav-panel-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.fav-panel-info {
    flex: 1;
    min-width: 0;
}

.fav-panel-name {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
}

.fav-panel-price {
    font-weight: 600;
    font-size: 0.9rem;
}

.search-bar-icon {
    width: 20px;
    height: 20px;
    opacity: 0.4;
    flex-shrink: 0;
}

.fav-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
}

.fav-panel-name-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.index-footer-minimal {
    text-align: center;
    padding: 2rem 1.5rem calc(3rem + env(safe-area-inset-bottom, 0));
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.index-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1rem;
}

.index-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.2s;
}

.index-footer-links a:hover {
    color: var(--primary-black);
}

.panel-body,
.cart-drawer-footer {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
}

@media (max-width: 768px) {
    #profilePanel.slide-panel {
        left: auto;
        right: 0;
        transform: translateX(105%);
    }

    #profilePanel.slide-panel.open {
        transform: translateX(0);
    }

    .slide-panel,
    .slide-drawer {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-card {
        padding: 0.75rem;
        border-radius: 18px;
    }

    .product-price {
        font-size: 1.15rem;
    }

    .glass-wordmark {
        font-size: 0.9rem;
        letter-spacing: 0.08em;
    }

    .glass-header-inner {
        padding: 0 0.75rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
