:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e1b4b;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --surface: #ffffff;
    --soft-bg: #f8fafc;
    --accent-soft: #eef2ff;
    --toast-bg: #111827;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --transition: all .2s ease;
    --header-height: 60px;
    --bottom-nav-height: 64px;
    --font: 'Noto Sans Arabic', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.app-wrapper { display: flex; flex-direction: column; min-height: 100vh; padding-bottom: var(--bottom-nav-height); }

/* Header */
.top-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--gray-200);
    height: var(--header-height);
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.15rem; font-weight: 700; color: var(--primary);
}

.logo i { font-size: 1.4rem; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.header-icon {
    position: relative; color: var(--gray-700);
    font-size: 1.2rem; padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.header-icon:hover { background: var(--gray-100); color: var(--primary); }

.badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--danger); color: var(--white);
    font-size: .65rem; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    padding: 0 4px;
}

.menu-toggle { display: none; font-size: 1.3rem; color: var(--gray-700); padding: 8px; }

/* Flash messages */
.flash-message {
    padding: 12px 0; font-size: .9rem; font-weight: 500;
}

.flash-message .container { display: flex; align-items: center; gap: 8px; }
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1e40af; }

/* Main content */
.main-content { flex: 1; padding: 16px 0 24px; }

/* Section titles */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.25rem; font-weight: 700; color: var(--gray-900);
}

.section-link {
    font-size: .85rem; color: var(--primary); font-weight: 500;
    display: flex; align-items: center; gap: 4px;
}

/* Hero Slider */
.hero-slider {
    position: relative; border-radius: var(--radius-lg);
    overflow: hidden; margin-bottom: 24px;
    aspect-ratio: 16/7; background: var(--gray-200);
}

.hero-slider .slide {
    position: absolute; inset: 0; opacity: 0;
    transition: opacity .6s ease;
}

.hero-slider .slide.active { opacity: 1; }

.hero-slider .slide img { width: 100%; height: 100%; object-fit: cover; }

.hero-slider .slide-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 24px; background: linear-gradient(transparent, rgba(0,0,0,.7));
    color: var(--white);
}

.hero-slider .slide-content h2 { font-size: 1.5rem; margin-bottom: 4px; }
.hero-slider .slide-content p { font-size: .9rem; opacity: .9; }

.slider-dots {
    position: absolute; bottom: 12px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 2;
}

.slider-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,.5);
    transition: var(--transition); cursor: pointer;
}

.slider-dot.active { background: var(--white); width: 24px; border-radius: 4px; }

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--surface); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex; flex-direction: column;
}

.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.product-image {
    position: relative; aspect-ratio: 1;
    background: var(--gray-100); overflow: hidden;
}

.product-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .3s ease;
}

.product-card:hover .product-image img { transform: scale(1.05); }

.sale-badge {
    position: absolute; top: 8px; right: 8px;
    background: var(--danger); color: var(--white);
    font-size: .7rem; font-weight: 600;
    padding: 3px 8px; border-radius: 20px;
}

.product-info { padding: 12px; flex: 1; display: flex; flex-direction: column; }

.product-name {
    font-size: .9rem; font-weight: 600; color: var(--gray-800);
    margin-bottom: 6px; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.4;
}

.product-name:hover { color: var(--primary); }

.product-price { margin-bottom: 10px; }

.price-current { font-size: 1rem; font-weight: 700; color: var(--primary); }
.price-old { font-size: .8rem; color: var(--gray-400); text-decoration: line-through; margin-right: 6px; }

.price-hidden {
    font-size: .8rem; color: var(--gray-500);
    display: flex; align-items: center; gap: 4px;
}

.price-wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.price-unit-label {
    display: block; width: 100%;
    font-size: .75rem; color: var(--gray-500); font-weight: 500;
}

.product-actions {
    display: flex; gap: 8px; margin-top: auto;
}

.btn-wishlist, .btn-add-cart {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem; transition: var(--transition);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    background: var(--surface); cursor: pointer;
}

.btn-wishlist:hover, .btn-wishlist.active { color: var(--danger); border-color: var(--danger); background: #fef2f2; }
.btn-add-cart:hover { color: var(--primary); border-color: var(--primary); background: #eef2ff; }

/* Featured section */
.featured-section { margin-bottom: 32px; }

.featured-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}

.featured-card {
    display: flex; flex-direction: column;
    border-radius: var(--radius-lg); overflow: hidden;
    background: var(--surface); box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}

.featured-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.featured-image {
    aspect-ratio: 4/3; overflow: hidden; background: var(--gray-100);
}

.featured-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.featured-body { padding: 14px 16px; }

.featured-card h3 {
    font-size: .95rem; margin-bottom: 8px; color: var(--gray-800);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Category row */
.category-row {
    display: flex; gap: 10px; overflow-x: auto;
    padding: 4px 0 16px; scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-row::-webkit-scrollbar { display: none; }

.category-chip {
    flex-shrink: 0; padding: 8px 18px;
    border-radius: 24px; font-size: .85rem; font-weight: 500;
    background: var(--surface); color: var(--gray-700);
    border: 1px solid var(--gray-200);
    transition: var(--transition); white-space: nowrap;
}

.category-chip:hover, .category-chip.active {
    background: var(--primary); color: var(--white); border-color: var(--primary);
}

/* Filter bar */
.filter-bar {
    display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}

.filter-bar select, .filter-bar input {
    padding: 10px 14px; border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm); font-size: .9rem;
    background: var(--surface); color: var(--gray-800);
    flex: 1; min-width: 140px;
}

.filter-bar select:focus, .filter-bar input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 12px 24px; border-radius: var(--radius-sm);
    font-size: .95rem; font-weight: 600; transition: var(--transition);
    border: none; cursor: pointer; text-align: center;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* Cart */
.cart-list { display: flex; flex-direction: column; gap: 12px; }

.cart-item {
    display: flex; gap: 14px; background: var(--surface);
    padding: 14px; border-radius: var(--radius);
    box-shadow: var(--shadow); align-items: center;
}

.cart-item-image {
    width: 80px; height: 80px; border-radius: var(--radius-sm);
    overflow: hidden; flex-shrink: 0; background: var(--gray-100);
}

.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.cart-item-price { color: var(--primary); font-weight: 600; font-size: .9rem; }

.cart-item-qty {
    display: flex; align-items: center; gap: 8px;
}

.qty-btn {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200); display: flex;
    align-items: center; justify-content: center;
    font-size: .9rem; color: var(--gray-700);
    transition: var(--transition);
}

.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.qty-value { font-weight: 600; min-width: 24px; text-align: center; }

.cart-item-remove {
    color: var(--danger); padding: 8px; font-size: 1rem;
    transition: var(--transition);
}

.cart-item-remove:hover { opacity: .7; }

.cart-summary {
    background: var(--surface); padding: 20px;
    border-radius: var(--radius); box-shadow: var(--shadow-md);
    margin-top: 20px; position: sticky; bottom: calc(var(--bottom-nav-height) + 16px);
}

.cart-total {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 1.15rem; font-weight: 700; margin-bottom: 16px;
    padding-bottom: 16px; border-bottom: 1px solid var(--gray-200);
}

.cart-total .amount { color: var(--primary); font-size: 1.3rem; }

.empty-state {
    text-align: center; padding: 48px 20px;
    color: var(--gray-500);
}

.empty-state i { font-size: 3rem; margin-bottom: 16px; color: var(--gray-300); }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--gray-700); }
.empty-state p { margin-bottom: 20px; font-size: .9rem; }

/* Forms */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block; font-size: .9rem; font-weight: 500;
    margin-bottom: 6px; color: var(--gray-700);
}

.form-control {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
    font-size: .95rem; transition: var(--transition);
    background: var(--surface);
}

.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.auth-container {
    max-width: 440px; margin: 0 auto; padding: 0 16px;
}

.auth-card {
    background: var(--surface); padding: 32px 24px;
    border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}

.auth-card h2 {
    text-align: center; font-size: 1.4rem;
    margin-bottom: 8px; color: var(--gray-900);
}

.auth-card .subtitle {
    text-align: center; color: var(--gray-500);
    margin-bottom: 24px; font-size: .9rem;
}

.auth-tabs {
    display: flex; margin-bottom: 24px;
    border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--gray-200);
}

.auth-tab {
    flex: 1; padding: 10px; text-align: center;
    font-weight: 600; font-size: .9rem;
    color: var(--gray-600); transition: var(--transition);
}

.auth-tab.active { background: var(--primary); color: var(--white); }

.auth-footer {
    text-align: center; margin-top: 20px;
    font-size: .9rem; color: var(--gray-500);
}

/* Orders */
.order-card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}

.order-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap; gap: 8px;
}

.order-number { font-weight: 700; color: var(--gray-900); }
.order-date { font-size: .85rem; color: var(--gray-500); }

.order-status {
    padding: 4px 12px; border-radius: 20px;
    font-size: .75rem; font-weight: 600;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-processing { background: #e0e7ff; color: #3730a3; }
.status-shipped { background: #d1fae5; color: #065f46; }
.status-delivered { background: #d1fae5; color: #047857; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.order-body { padding: 16px; }
.order-items-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.order-item-row {
    display: flex; justify-content: space-between;
    font-size: .9rem; color: var(--gray-700);
}

.order-total {
    display: flex; justify-content: space-between;
    font-weight: 700; padding-top: 12px;
    border-top: 1px solid var(--gray-100);
    color: var(--primary);
}

/* Profile */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 32px 16px; color: var(--white);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin: -16px -16px 24px; text-align: center;
}

.profile-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: rgba(255,255,255,.2); margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
}

.profile-name { font-size: 1.2rem; font-weight: 700; }
.profile-email { font-size: .85rem; opacity: .85; }

.profile-tabs {
    display: flex; gap: 4px; overflow-x: auto;
    margin-bottom: 20px; padding-bottom: 4px;
    scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar { display: none; }

.profile-tab {
    flex-shrink: 0; padding: 10px 16px;
    border-radius: var(--radius-sm); font-size: .85rem;
    font-weight: 500; color: var(--gray-600);
    background: var(--surface); border: 1px solid var(--gray-200);
    transition: var(--transition); white-space: nowrap;
}

.profile-tab.active {
    background: var(--primary); color: var(--white); border-color: var(--primary);
}

.profile-section {
    background: var(--surface); padding: 20px;
    border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.profile-section h3 {
    font-size: 1rem; margin-bottom: 16px;
    color: var(--gray-900); display: flex; align-items: center; gap: 8px;
}

.info-row {
    display: flex; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid var(--gray-100);
    font-size: .9rem;
}

.info-row:last-child { border-bottom: none; }
.info-label { color: var(--gray-500); }
.info-value { font-weight: 500; color: var(--gray-800); }

/* Notifications */
.notif-item {
    display: flex; gap: 12px; padding: 14px;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}

.notif-item.unread { background: #eef2ff; }
.notif-icon {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: .9rem;
}

.notif-icon.order { background: #dbeafe; color: #1e40af; }
.notif-icon.promo { background: #fef3c7; color: #92400e; }
.notif-icon.system { background: #e0e7ff; color: #3730a3; }

.notif-content { flex: 1; }
.notif-title { font-weight: 600; font-size: .9rem; margin-bottom: 2px; }
.notif-message { font-size: .85rem; color: var(--gray-600); }
.notif-time { font-size: .75rem; color: var(--gray-400); margin-top: 4px; }

/* Product detail — Swiper gallery */
.product-main { padding-top: 0; }

.product-detail-page { width: 100%; }

.product-detail-layout {
    display: flex; flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--gray-100);
}

.product-gallery-hero {
    width: 100%; background: var(--surface);
    position: relative;
}

.product-swiper {
    width: 100%;
    height: min(72vw, 420px);
    max-height: 480px;
}

.product-swiper .swiper-slide {
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-50);
}

.product-swiper-image {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 12px;
}

.product-swiper-image img {
    width: 100%; height: 100%;
    object-fit: contain;
    max-height: 100%;
}

.product-swiper .swiper-pagination {
    bottom: 14px !important;
    line-height: 1;
}

.product-swiper .swiper-pagination-bullet {
    width: 6px; height: 6px;
    background: var(--gray-300);
    opacity: 1;
    margin: 0 4px !important;
    transition: all .3s ease;
}

.product-swiper .swiper-pagination-bullet-active {
    width: 22px;
    border-radius: 4px;
    background: var(--primary);
}

.product-detail-panel { padding: 20px 16px 8px; }

.product-detail-extra { padding-bottom: 24px; }

.variant-group { margin: 16px 0; }
.variant-group-label {
    display: block; font-size: .9rem; font-weight: 600;
    margin-bottom: 8px; color: var(--gray-800);
}

.variant-options { display: flex; flex-wrap: wrap; gap: 8px; }

.variant-option {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: var(--radius-sm);
    border: 2px solid var(--gray-200); background: var(--surface);
    cursor: pointer; font-size: .9rem; transition: var(--transition);
}

.variant-option input { position: absolute; opacity: 0; pointer-events: none; }
.variant-option small { color: var(--gray-500); font-size: .75rem; }
.variant-option.active, .variant-option:hover {
    border-color: var(--primary); background: #eef2ff; color: var(--primary);
}

.product-description-section { margin-top: 32px; }

.product-description-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.product-description-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--gray-100);
}

.product-description-icon {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: var(--primary); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}

.product-description-header h2 {
    font-size: 1.05rem; font-weight: 700;
    color: var(--gray-800); margin: 0;
}

.product-description-content {
    padding: 20px 24px;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.product-description-content p {
    margin: 0 0 14px;
    line-height: 1.9;
    color: var(--gray-700);
    font-size: .95rem;
    text-align: justify;
}

.product-description-content p:last-child { margin-bottom: 0; }

.cart-item-variant,.item-variant-line {
    font-size: .8rem; color: var(--primary); margin: 4px 0 6px;
    line-height: 1.4;
}
.cart-item-variant {
    display: flex; align-items: center; gap: 6px;
}
.checkout-item-variant,.checkout-item-info .item-variant-line {
    font-size: .78rem; color: #4338ca; font-weight: 600; margin: 2px 0 6px;
}
.admin-order-item { display: inline-block; margin: 6px 0 6px 16px; vertical-align: top; }
.admin-order-item-variant { margin-top: 2px; font-size: .78rem; color: #4338ca; font-weight: 600; }

.product-detail-info h1 { font-size: 1.5rem; margin-bottom: 12px; }
.product-detail-price { font-size: 1.5rem; margin-bottom: 16px; }

.product-detail-actions {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch;
}

.product-detail-actions .btn-add-cart {
    flex: 1 1 200px; min-height: 48px; width: auto;
    padding: 12px 20px; font-size: 1rem;
    border-radius: var(--radius-sm);
}

.product-detail-actions .btn-wishlist {
    flex: 0 0 48px; width: 48px; height: 48px;
}

.shipping-price { color: var(--success); font-weight: 700; }

.cart-item-qty {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 8px; background: var(--gray-100);
    border-radius: var(--radius-sm); padding: 4px;
}

.cart-item-qty .qty-btn {
    width: 32px; height: 32px; border: none; border-radius: 6px;
    background: var(--surface); color: var(--gray-700);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: .8rem;
}

.cart-item-qty .qty-btn:hover { background: var(--primary); color: var(--white); }

.cart-item-qty .qty-input {
    width: 48px; height: 32px; text-align: center;
    border: 1px solid var(--gray-200); border-radius: 6px;
    font-size: .9rem; font-weight: 600; background: var(--surface);
    -moz-appearance: textfield;
}

.cart-item-qty .qty-input::-webkit-outer-spin-button,
.cart-item-qty .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Contact */
.contact-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}

.contact-info-card {
    background: var(--surface); padding: 24px;
    border-radius: var(--radius); box-shadow: var(--shadow);
}

.contact-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 0; border-bottom: 1px solid var(--gray-100);
}

.contact-item:last-child { border-bottom: none; }

.contact-item-icon {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    background: #eef2ff; color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}

.contact-item-text h4 { font-size: .85rem; color: var(--gray-500); margin-bottom: 2px; }
.contact-item-text p { font-weight: 600; font-size: .95rem; }

/* Checkout */
.checkout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.checkout-section {
    background: var(--surface); padding: 24px;
    border-radius: var(--radius); box-shadow: var(--shadow);
}

.checkout-section h3 {
    font-size: 1.05rem; margin-bottom: 16px;
    padding-bottom: 12px; border-bottom: 1px solid var(--gray-100);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-height);
    background: var(--surface);
    border-top: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-around;
    z-index: 100; box-shadow: 0 -2px 10px rgba(0,0,0,.05);
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; color: var(--gray-500); font-size: .7rem;
    font-weight: 500; padding: 6px 4px;
    position: relative; transition: var(--transition);
    flex: 1 1 0; min-width: 0; text-align: center;
}

.nav-item > span:not(.nav-badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-item i { font-size: 1.2rem; }
.nav-item.active { color: var(--primary); }
.nav-item:hover { color: var(--primary); }

.nav-badge {
    position: absolute; top: 0; right: 8px;
    background: var(--danger); color: var(--white);
    font-size: .6rem; font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
}

/* Footer */
.site-footer {
    background: var(--gray-900); color: var(--gray-400);
    padding: 32px 0 16px; margin-top: auto;
    display: none;
}

.footer-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 24px; margin-bottom: 24px;
}

.footer-col h4 { color: var(--white); margin-bottom: 12px; font-size: 1rem; }
.footer-col p, .footer-col a {
    font-size: .85rem; margin-bottom: 6px;
    display: block; color: var(--gray-400);
}

.footer-col a:hover { color: var(--white); }
.footer-bottom { text-align: center; padding-top: 16px; border-top: 1px solid var(--gray-800); font-size: .8rem; }

/* Toast */
.toast {
    position: fixed; bottom: calc(var(--bottom-nav-height) + 16px);
    left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--toast-bg); color: var(--white);
    padding: 12px 24px; border-radius: var(--radius-sm);
    font-size: .9rem; z-index: 200;
    transition: transform .3s ease; white-space: nowrap;
    box-shadow: var(--shadow-lg);
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* Pagination */
.pagination {
    display: flex; justify-content: center; gap: 8px;
    margin-top: 24px;
}

.page-link {
    padding: 8px 14px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--gray-200);
    color: var(--gray-700); font-size: .9rem;
    transition: var(--transition);
}

.page-link:hover, .page-link.active {
    background: var(--primary); color: var(--white); border-color: var(--primary);
}

/* Responsive */
@media (min-width: 768px) {
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .site-footer { display: block; }
    .hero-slider { aspect-ratio: 16/5; }
    .hero-slider .slide-content h2 { font-size: 2rem; }
}

@media (min-width: 1024px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
    .app-wrapper { padding-bottom: 0; }
    .bottom-nav { display: none; }
    .site-footer { display: block; margin-bottom: 0; }
    .cart-summary { position: static; }
    .toast { bottom: 24px; }
}

@media (min-width: 992px) {
    .product-detail-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        max-width: 1200px;
        margin: 0 auto;
        gap: 40px;
        padding: 24px 16px 0;
        align-items: start;
        background: transparent;
        border-bottom: none;
    }

    .product-gallery-hero {
        position: sticky;
        top: calc(var(--header-height) + 16px);
        border-radius: var(--radius-lg);
        overflow: hidden;
        box-shadow: var(--shadow-md);
    }

    .product-swiper { height: 480px; max-height: none; }

    .product-detail-panel {
        background: var(--surface);
        border-radius: var(--radius-lg);
        padding: 24px;
        box-shadow: var(--shadow);
    }
}

@media (max-width: 767px) {
    .product-swiper { height: min(75vw, 380px); }
    .product-description-content { padding: 16px; }
    .product-description-content p { font-size: .9rem; }
    .checkout-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .featured-grid { grid-template-columns: 1fr 1fr; }
    .profile-header { margin: -16px -16px 20px; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-info { padding: 10px; }
    .product-name { font-size: .8rem; }
    .price-current { font-size: .9rem; }
    .btn-wishlist, .btn-add-cart { width: 32px; height: 32px; font-size: .85rem; }
    .featured-grid { grid-template-columns: 1fr; }
    .product-detail-actions .btn-add-cart { flex: 1 1 100%; }
}

/* Checkout v2 */
.checkout-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.checkout-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.checkout-item { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--gray-50); border-radius: var(--radius-sm); }
.checkout-item-img { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.checkout-item-img img { width: 100%; height: 100%; object-fit: cover; }
.checkout-item-info { flex: 1; }
.checkout-item-name { font-weight: 600; font-size: .9rem; }
.checkout-item-meta { font-size: .8rem; color: var(--gray-500); display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.checkout-item-total { font-weight: 700; color: var(--primary); }
.checkout-summary-box { border-top: 1px solid var(--gray-200); padding-top: 12px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .9rem; }
.summary-row.total-row { font-size: 1.15rem; font-weight: 700; color: var(--primary); border-top: 2px solid var(--primary); margin-top: 8px; padding-top: 12px; }
.discount-row { color: var(--success); }
.coupon-box { display: flex; gap: 8px; margin-top: 16px; }
.stock-badge { font-size: .7rem; padding: 2px 8px; border-radius: 12px; }
.stock-in { background: #d1fae5; color: #065f46; }
.stock-low { background: #fef3c7; color: #92400e; }
.stock-out { background: #fee2e2; color: #991b1b; }
.payment-methods { display: flex; flex-direction: column; gap: 8px; }
.payment-option input { display: none; }
.payment-card { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 2px solid var(--gray-200); border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.payment-option input:checked + .payment-card { border-color: var(--primary); background: var(--accent-soft); }

/* Brands */
.brands-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.brand-card { background: var(--surface); padding: 20px; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow); transition: var(--transition); text-decoration: none; color: inherit; border: 2px solid transparent; }
.brand-card:hover, .brand-card.active { border-color: var(--primary); transform: translateY(-2px); }
.brand-logo { width: 64px; height: 64px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--primary); }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-card h3 { font-size: .95rem; margin-bottom: 4px; }
.brand-card span { font-size: .8rem; color: var(--gray-500); }

/* Chat */
.chat-box { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; max-width: 600px; margin: 0 auto; }
.chat-messages { height: 400px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; flex-direction: column; max-width: 80%; }
.chat-msg.from-user { align-self: flex-end; align-items: flex-end; }
.chat-msg.from-admin { align-self: flex-start; }
.chat-bubble { padding: 10px 14px; border-radius: 16px; font-size: .9rem; line-height: 1.5; }
.from-user .chat-bubble { background: var(--primary); color: #fff; border-bottom-left-radius: 4px; }
.from-admin .chat-bubble { background: var(--gray-100); border-bottom-right-radius: 4px; }
.chat-time { font-size: .7rem; color: var(--gray-400); margin-top: 4px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--gray-200); }

/* Flash sale */
.flash-sale-bar { background: linear-gradient(90deg, #ef4444, #f59e0b); color: #fff; padding: 10px 16px; text-align: center; font-weight: 600; font-size: .9rem; }
.flash-countdown { display: inline-flex; gap: 8px; margin-right: 12px; }
.flash-countdown span { background: rgba(0,0,0,.2); padding: 2px 8px; border-radius: 4px; }

/* Reviews */
.review-item { padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.review-stars { color: #f59e0b; margin-bottom: 4px; }
.review-form { background: var(--gray-50); padding: 16px; border-radius: var(--radius); margin-top: 16px; }
.star-input { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.star-input input { display: none; }
.star-input label { cursor: pointer; font-size: 1.5rem; color: var(--gray-300); }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f59e0b; }

/* Header search */
.header-search { display: flex; flex: 1; max-width: 280px; margin: 0 12px; }
.header-search input { flex: 1; padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-left: none; font-size: .85rem; }
.header-search button { padding: 8px 12px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); cursor: pointer; }
@media (max-width: 768px) { .header-search { display: none; } }

/* Lang & theme */
.lang-switcher { display: flex; gap: 2px; background: var(--gray-100); border-radius: 20px; padding: 2px; }
.lang-switcher a { padding: 4px 8px; font-size: .7rem; border-radius: 18px; color: var(--gray-600); text-decoration: none; font-weight: 600; }
.lang-switcher a.active { background: var(--primary); color: #fff; }
.promo-banner { display: block; overflow: hidden; max-height: 80px; }
.promo-banner img { width: 100%; height: 80px; object-fit: cover; }

/* Dark mode */
[data-theme="dark"] {
    color-scheme: dark;
    --gray-50: #1f2937; --gray-100: #374151; --gray-200: #4b5563;
    --gray-300: #6b7280; --gray-700: #e5e7eb; --gray-800: #f3f4f6; --gray-900: #f9fafb;
    --surface: #1e293b; --soft-bg: #0f172a; --accent-soft: rgba(99,102,241,.2); --toast-bg: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,.5);
}
[data-theme="dark"] body { background: #0f172a; color: var(--gray-800); }
[data-theme="dark"] .site-footer { background: #020617; }
[data-theme="dark"] .footer-col h4, [data-theme="dark"] .footer-col a:hover { color: #f1f5f9; }
[data-theme="dark"] .footer-bottom { border-color: #1e293b; }
[data-theme="dark"] .form-control,
[data-theme="dark"] .header-search input { background: #0f172a; color: var(--gray-800); border-color: #475569; }
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .header-search input::placeholder { color: #94a3b8; }
[data-theme="dark"] .checkout-item { background: #0f172a; }
[data-theme="dark"] .payment-option input:checked + .payment-card { background: rgba(99,102,241,.2); }
[data-theme="dark"] .flash-success, [data-theme="dark"] .stock-in { background: #064e3b; color: #a7f3d0; }
[data-theme="dark"] .flash-error, [data-theme="dark"] .stock-out { background: #7f1d1d; color: #fecaca; }
[data-theme="dark"] .flash-info { background: #1e3a8a; color: #bfdbfe; }
[data-theme="dark"] .stock-low { background: #78350f; color: #fde68a; }
[data-theme="dark"] .lang-switcher a { color: var(--gray-700); }
[data-theme="dark"] .lang-switcher a.active { color: #fff; }
[data-theme="dark"] .category-chip { color: var(--gray-700); }
[data-theme="dark"] .from-admin .chat-bubble { background: #334155; }
[data-theme="dark"] .top-header, [data-theme="dark"] .product-card,
[data-theme="dark"] .checkout-section, [data-theme="dark"] .auth-card,
[data-theme="dark"] .brand-card, [data-theme="dark"] .chat-box,
[data-theme="dark"] .product-gallery-hero, [data-theme="dark"] .product-detail-panel,
[data-theme="dark"] .product-detail-layout { background: #1e293b; }
[data-theme="dark"] .product-swiper .swiper-slide { background: #0f172a; }
[data-theme="dark"] .bottom-nav { background: #1e293b; border-color: #374151; }

@media (max-width: 767px) {
    .checkout-layout { grid-template-columns: 1fr; }
    .header-inner { gap: 8px; }
    .header-actions { gap: 4px; min-width: 0; flex: 0 0 auto; }
    .lang-switcher a { padding: 4px 6px; font-size: .65rem; }
    .logo { min-width: 0; flex: 1 1 0; }
    .logo span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .header-search-link { display: inline-flex; }
    .toast { max-width: 90vw; white-space: normal; text-align: center; }
    .checkout-item { flex-wrap: wrap; }
    .coupon-box { flex-wrap: wrap; }
    .coupon-box .form-control { flex: 1 1 140px; min-width: 0; }
    .summary-row { gap: 12px; }
}
.header-search-link { display: none; }
@media (max-width: 360px) {
    .profile-header { margin-inline: -12px; }
    .logo span { display: none; }
    .container { padding: 0 12px; }
}
img, video, iframe, table { max-width: 100%; }
.table-responsive, .orders-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
