/* =============================================
   Essalmy E-Commerce - Minimal Professional UI
   Clean • Modern • Elegant
   ============================================= */

/* -------------------------------------------
   CSS Variables
   ------------------------------------------- */
:root {
    --primary: #111827;
    --primary-hover: #374151;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #2563eb;

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;

    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-dark: #111827;

    --border-color: #e5e7eb;
    --border-light: #f3f4f6;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    --font-sans: 'Almarai', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --header-height: 72px;
    --nav-height: 48px;
}

/* -------------------------------------------
   Reset & Base
   ------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
}

::selection {
    background: var(--accent);
    color: white;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* -------------------------------------------
   Typography
   ------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; letter-spacing: -0.025em; }
h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; letter-spacing: -0.015em; }
h4 { font-size: 1.125rem; }

/* -------------------------------------------
   Buttons
   ------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 1;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-inverse);
}

.btn-accent:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    border-radius: var(--radius-lg);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* -------------------------------------------
   Top Bar
   ------------------------------------------- */
.top-bar {
    background: var(--bg-dark);
    color: var(--text-inverse);
    padding: 0;
    font-size: 13px;
    height: 40px;
    display: flex;
    align-items: center;
}

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

.top-bar a {
    color: rgba(255,255,255,0.7);
    transition: color var(--transition-fast);
}

.top-bar a:hover {
    color: white;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.store-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.6);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.separator {
    color: rgba(255,255,255,0.2);
}

/* -------------------------------------------
   Header
   ------------------------------------------- */
.main-header {
    background: var(--bg-primary);
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.95);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 32px;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo h2 {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.logo-accent {
    color: var(--accent);
}

/* -------------------------------------------
   Search Bar
   ------------------------------------------- */
.search-bar {
    flex: 1;
    max-width: 560px;
}

.search-bar form {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1.5px solid transparent;
    border-radius: var(--radius-full);
    overflow: hidden;
    transition: all var(--transition-base);
}

.search-bar form:focus-within {
    background: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-bar input {
    flex: 1;
    padding: 10px 18px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar button {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    margin: 3px;
    transition: all var(--transition-base);
}

.search-bar button:hover {
    background: var(--primary-hover);
}

/* -------------------------------------------
   Header Actions
   ------------------------------------------- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    color: var(--text-secondary);
}

.action-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.action-link .icon {
    font-size: 20px;
    line-height: 1;
}

.action-link .label {
    font-size: 11px;
    font-weight: 500;
}

.badge {
    position: absolute;
    top: 2px;
    right: 4px;
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
}

/* -------------------------------------------
   Navigation
   ------------------------------------------- */
.main-nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    height: var(--nav-height);
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: center;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--text-primary);
    transition: width var(--transition-base);
}

.nav-menu > li > a:hover,
.nav-menu > li:hover > a {
    color: var(--text-primary);
}

.nav-menu > li > a:hover::after,
.nav-menu > li:hover > a::after {
    width: 24px;
}

.nav-menu .dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    min-width: 220px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    z-index: 1000;
    list-style: none;
    padding: 8px;
    margin-top: 8px;
}

.nav-menu .dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeInDown 0.15s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu li a {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.dropdown-menu li a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* -------------------------------------------
   Section Headers
   ------------------------------------------- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 1.375rem;
    font-weight: 700;
}

.view-all {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-all:hover {
    color: var(--accent-hover);
}

.view-all::after {
    content: '←';
}

.products-section {
    margin-bottom: 64px;
}

/* -------------------------------------------
   Categories Grid
   ------------------------------------------- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.category-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.category-card:hover {
    border-color: var(--text-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all var(--transition-base);
}

.category-card:hover .category-icon {
    background: var(--bg-dark);
}

.category-card:hover .category-icon img {
    filter: brightness(0) invert(1);
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-icon {
    font-size: 24px;
}

.category-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.product-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* -------------------------------------------
   Products Grid
   ------------------------------------------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    position: relative;
}

.product-card:hover {
    border-color: var(--text-muted);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.product-image {
    position: relative;
    height: 220px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.placeholder-image {
    font-size: 48px;
    color: var(--text-muted);
}

.placeholder-image.large {
    font-size: 80px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.placeholder-image.small {
    font-size: 20px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--danger);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.wishlist-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-full);
    font-size: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.wishlist-btn:hover {
    background: white;
    color: var(--danger);
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.wishlist-btn.active {
    color: var(--danger);
    background: white;
}

.product-info {
    padding: 16px;
}

.product-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    margin: 6px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a:hover {
    color: var(--accent);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 8px;
}

.star {
    color: var(--border-color);
    font-size: 12px;
    transition: color var(--transition-fast);
}

.star.filled {
    color: #f59e0b;
}

.rating-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: 6px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.current-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.old-price {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* -------------------------------------------
   Product Detail
   ------------------------------------------- */
.breadcrumb {
    padding: 20px 0;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb a:hover {
    color: var(--text-primary);
}

.breadcrumb span {
    color: var(--border-color);
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 64px;
}

.main-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.main-image img {
    width: 100%;
    height: 480px;
    object-fit: cover;
}

.product-details .product-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.product-details .product-rating {
    font-size: 15px;
    margin-bottom: 20px;
}

.product-price-block {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.product-price-block .current-price {
    font-size: 2rem;
    font-weight: 800;
}

.discount-tag {
    background: #fef2f2;
    color: var(--danger);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
}

.product-meta {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.product-meta p {
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.product-meta strong {
    color: var(--text-primary);
}

.in-stock { color: var(--success); font-weight: 600; }
.out-of-stock { color: var(--danger); font-weight: 600; }

.product-short-desc {
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

.add-to-cart-form {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-primary);
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.qty-input {
    width: 48px;
    height: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    background: transparent;
}

.qty-input:focus {
    outline: none;
}

.product-actions {
    display: flex;
    gap: 12px;
}

.product-actions .wishlist-toggle {
    padding: 12px 20px;
}

.product-actions .wishlist-toggle.active {
    color: var(--danger);
    border-color: var(--danger);
}

/* -------------------------------------------
   Tabs
   ------------------------------------------- */
.product-tabs {
    margin-bottom: 64px;
}

.tab-buttons {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-btn {
    padding: 14px 24px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-primary);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.tab-btn.active {
    color: var(--text-primary);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.product-description {
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 15px;
}

/* -------------------------------------------
   Reviews
   ------------------------------------------- */
.review-form {
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.review-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.reviewer-name {
    font-weight: 600;
    font-size: 14px;
}

.review-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: auto;
}

.review-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.review-comment {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.review-note {
    color: var(--text-muted);
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    text-align: center;
    font-size: 14px;
}

.no-reviews {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-size: 14px;
}

/* -------------------------------------------
   Forms
   ------------------------------------------- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* -------------------------------------------
   Auth Pages
   ------------------------------------------- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 0;
}

.auth-card {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-color);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.auth-card > p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 14px;
}

.auth-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-link a {
    color: var(--accent);
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* -------------------------------------------
   Cart Page
   ------------------------------------------- */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.cart-table th {
    background: var(--bg-tertiary);
    padding: 14px 16px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.cart-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.cart-table tr:last-child td {
    border-bottom: none;
}

.cart-product-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-product-info img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.cart-product-info a {
    font-weight: 600;
    font-size: 14px;
}

.cart-product-info a:hover {
    color: var(--accent);
}

.sale-indicator {
    display: inline-block;
    background: #fef2f2;
    color: var(--danger);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-remove:hover {
    background: #fef2f2;
    color: var(--danger);
}

.cart-actions {
    padding: 16px 0;
}

.cart-summary {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: sticky;
    top: calc(var(--header-height) + var(--nav-height) + 24px);
}

.cart-summary h3 {
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.summary-row.total {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
    margin-bottom: 0;
}

.free-shipping-note {
    font-size: 12px;
    color: var(--success);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: var(--radius-sm);
}

.coupon-form {
    margin: 16px 0;
}

.coupon-form form {
    display: flex;
    gap: 8px;
}

.coupon-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
}

.coupon-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.discount-applied {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 10px 14px;
    background: #f0fdf4;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--success);
    font-weight: 600;
}

.discount-applied a {
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
}

/* -------------------------------------------
   Checkout
   ------------------------------------------- */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    align-items: start;
}

.checkout-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.checkout-section h2 {
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.checkout-summary {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: sticky;
    top: calc(var(--header-height) + var(--nav-height) + 24px);
}

.checkout-items {
    margin-bottom: 16px;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
}

.checkout-item:last-child {
    border-bottom: none;
}

.summary-divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.payment-option:hover {
    border-color: var(--text-muted);
}

.payment-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-light);
}

.payment-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.payment-label {
    font-weight: 600;
    font-size: 14px;
}

/* -------------------------------------------
   Confirmation
   ------------------------------------------- */
.confirmation-container {
    text-align: center;
    padding: 60px 20px;
    max-width: 700px;
    margin: 0 auto;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 24px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.confirmation-container h1 {
    margin-bottom: 12px;
    color: var(--success);
    font-size: 1.75rem;
}

.order-number {
    font-size: 16px;
    margin-bottom: 40px;
    color: var(--text-muted);
}

.confirmation-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    text-align: right;
    margin-bottom: 40px;
}

.detail-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.detail-section h3 {
    font-size: 14px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-section p {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.detail-section strong {
    color: var(--text-primary);
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
}

.order-item-row:last-child {
    border-bottom: none;
}

.order-totals {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.total-row.grand-total {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.confirmation-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* -------------------------------------------
   Orders
   ------------------------------------------- */
.orders-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-primary);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.filter-btn.active,
.filter-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.order-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all var(--transition-base);
}

.order-card:hover {
    box-shadow: var(--shadow-sm);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-tertiary);
}

.order-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.order-number {
    font-weight: 700;
    font-size: 14px;
}

.order-date {
    font-size: 13px;
    color: var(--text-muted);
}

.order-status {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-shipped { background: #e0e7ff; color: #3730a3; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.order-summary {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-total {
    font-weight: 700;
    font-size: 15px;
}

.order-items-count {
    font-size: 13px;
    color: var(--text-muted);
}

.order-actions {
    padding: 12px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--border-color);
}

/* -------------------------------------------
   Order Detail & Tracking
   ------------------------------------------- */
.order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.detail-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.detail-card h3 {
    font-size: 14px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.order-items-table {
    width: 100%;
    border-collapse: collapse;
}

.order-items-table th {
    text-align: right;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.order-items-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.order-items-table tr:last-child td {
    border-bottom: none;
}

.item-with-image {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-with-image img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.order-totals-detail {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.tracking-progress {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    position: relative;
}

.tracking-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 2px solid var(--border-color);
    transition: all var(--transition-base);
}

.progress-step.completed .step-icon {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.progress-step.current .step-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 0 4px var(--accent-light);
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-step.completed .step-label,
.progress-step.current .step-label {
    color: var(--text-primary);
}

.tracking-cancelled {
    text-align: center;
    padding: 60px 20px;
}

.cancel-icon {
    font-size: 48px;
    color: var(--danger);
    margin-bottom: 16px;
}

.tracking-history {
    margin-top: 40px;
}

.tracking-history h2 {
    margin-bottom: 24px;
    font-size: 1.125rem;
}

.history-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.history-item:last-child {
    border-bottom: none;
}

.history-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}

.history-status {
    font-weight: 600;
    font-size: 14px;
}

.history-note {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.history-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* -------------------------------------------
   Account
   ------------------------------------------- */
.account-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
}

.account-sidebar {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + var(--nav-height) + 24px);
}

.account-user-info {
    background: var(--bg-dark);
    color: white;
    padding: 32px 24px;
    text-align: center;
}

.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 12px;
    border: 2px solid rgba(255,255,255,0.2);
}

.account-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.account-nav .nav-item:last-child {
    border-bottom: none;
}

.account-nav .nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.account-nav .nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    border-right: 3px solid var(--accent);
}

.account-section {
    display: none;
}

.account-section.active {
    display: block;
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.account-section h2 {
    font-size: 1.25rem;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.wallet-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: var(--bg-dark);
    color: white;
    border-radius: var(--radius-xl);
}

.wallet-icon {
    font-size: 48px;
}

.wallet-label {
    font-size: 14px;
    opacity: 0.7;
}

.wallet-total {
    font-size: 2rem;
    font-weight: 800;
    margin: 4px 0;
}

.wallet-note {
    font-size: 12px;
    opacity: 0.5;
}

/* -------------------------------------------
   Empty State
   ------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h2 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

/* -------------------------------------------
   Alerts
   ------------------------------------------- */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-icon {
    font-size: 16px;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* -------------------------------------------
   Pagination
   ------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    background: var(--bg-primary);
}

.page-link:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* -------------------------------------------
   Footer
   ------------------------------------------- */
.site-footer {
    background: var(--bg-dark);
    color: white;
    margin-top: 80px;
}

.footer-main {
    padding: 64px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
}

.footer-col h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 700;
}

.footer-col p {
    font-size: 14px;
    opacity: 0.6;
    line-height: 1.8;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    font-size: 14px;
    opacity: 0.6;
    transition: all var(--transition-fast);
}

.footer-col ul li a:hover {
    opacity: 1;
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    font-size: 13px;
    opacity: 0.5;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom-content p {
    margin: 0;
}

.footer-dev-link {
    color: inherit;
    text-decoration: none;
    font-family: monospace;
    font-size: 12px;
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.footer-dev-link:hover {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
}

@media (max-width: 768px) {
    .footer-bottom-content {
        flex-direction: column;
        gap: 8px;
    }
}

/* -------------------------------------------
   Page Header
   ------------------------------------------- */
.page-header {
    padding: 32px 0 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 4px;
}

.results-count {
    color: var(--text-muted);
    font-size: 14px;
}

/* -------------------------------------------
   Products Layout (with sidebar)
   ------------------------------------------- */
.products-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
}

.sidebar {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + var(--nav-height) + 24px);
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.filter-list {
    list-style: none;
}

.filter-list li {
    margin-bottom: 6px;
}

.filter-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 0;
    transition: color var(--transition-fast);
}

.filter-list label:hover {
    color: var(--text-primary);
}

.filter-list input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.price-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-filter input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.price-filter input:focus {
    outline: none;
    border-color: var(--accent);
}

/* -------------------------------------------
   Related Products
   ------------------------------------------- */
.related-products {
    margin-top: 64px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.related-products h2 {
    margin-bottom: 24px;
}

/* -------------------------------------------
   Static Pages (Customer Service, FAQ, etc.)
   ------------------------------------------- */
.static-page {
    max-width: 900px;
    margin: 0 auto;
}

.static-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.static-section {
    margin-bottom: 40px;
}

.static-section:last-child {
    margin-bottom: 0;
}

.static-section h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.static-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

/* --- Policy Intro --- */
.policy-intro {
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: var(--radius-lg);
    border-right: 4px solid var(--accent);
}

.policy-intro p {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

/* --- Policy Grid --- */
.policy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.policy-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.policy-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.policy-card h3 {
    font-size: 14px;
    margin-bottom: 8px;
}

.policy-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* --- Steps List --- */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* --- Styled List --- */
.styled-list {
    list-style: none;
    padding: 0;
}

.styled-list li {
    position: relative;
    padding: 8px 20px 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.styled-list li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--success);
    font-weight: 700;
}

.styled-list.warning-list li::before {
    content: '✕';
    color: var(--danger);
}

/* --- Contact Box --- */
.contact-box {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-lg);
}

.contact-box p {
    margin-bottom: 8px;
    font-size: 14px;
}

.contact-box p:last-child {
    margin-bottom: 0;
}

/* --- Help Grid --- */
.help-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.help-card {
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-base);
    border: 1px solid transparent;
}

.help-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.help-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.help-card h3 {
    font-size: 15px;
    margin-bottom: 8px;
}

.help-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.help-details p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* --- Quick Links --- */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.quick-link:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.ql-icon {
    font-size: 20px;
}

.ql-text {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.ql-arrow {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.quick-link:hover .ql-arrow {
    transform: translateX(-4px);
    color: var(--accent);
}

/* --- Shipping Options --- */
.shipping-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.shipping-card {
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    position: relative;
    border: 2px solid transparent;
    transition: all var(--transition-base);
}

.shipping-card:hover {
    border-color: var(--accent);
}

.shipping-card.featured {
    border-color: var(--accent);
    background: var(--accent-light);
}

.shipping-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 4px 16px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.shipping-header {
    margin-bottom: 16px;
}

.shipping-header h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.shipping-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}

.shipping-price.free {
    color: var(--success);
}

.shipping-features {
    list-style: none;
    text-align: right;
}

.shipping-features li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.shipping-features li:last-child {
    border-bottom: none;
}

/* --- Delivery Areas --- */
.delivery-areas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.area-card {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.area-card h4 {
    font-size: 14px;
    margin-bottom: 8px;
}

.area-card p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    min-height: 36px;
}

.delivery-time {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

/* --- FAQ --- */
.faq-intro {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 0 20px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-primary);
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-align: right;
    transition: background var(--transition-fast);
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-toggle {
    font-size: 20px;
    color: var(--text-muted);
    transition: transform var(--transition-base);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-item.open .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    display: none;
    padding: 0 20px 16px;
    background: var(--bg-primary);
}

.faq-item.open .faq-answer {
    display: block;
}

.faq-answer p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* --- Contact CTA --- */
.contact-cta {
    text-align: center;
    background: var(--bg-tertiary);
    padding: 40px;
    border-radius: var(--radius-lg);
}

.contact-cta h2 {
    margin-bottom: 8px;
    border: none;
    padding: 0;
}

.contact-cta p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* --- Footer Legal --- */
.footer-legal {
    background: rgba(255,255,255,0.03);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 16px 0;
}

.legal-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
}

.legal-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.footer-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
}

.badge-icon {
    font-size: 14px;
}

/* -------------------------------------------
   Responsive Design - Mobile First
   ------------------------------------------- */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .order-detail-grid {
        grid-template-columns: 1fr;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-summary {
        position: static;
    }
}

/* Mobile: up to 768px - LEGACY (overridden by new mobile CSS at end of file) */
@media (max-width: 768px) {

    /* --- Top Bar - hidden by new mobile CSS --- */
    .top-bar-right {
        display: none;
    }

    .top-bar-left {
        gap: 8px;
        font-size: 11px;
    }

    .top-bar-left span {
        display: none;
    }

    .top-bar-left a {
        padding: 4px 0;
    }

    /* --- Header --- */
    .main-header {
        height: 60px;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .header-content {
        gap: 12px;
    }

    .logo h2 {
        font-size: 1.125rem;
        font-weight: 800;
    }

    .search-bar {
        order: 3;
        max-width: 100%;
        width: 100%;
        flex: 1;
    }

    .search-bar form {
        border-radius: var(--radius-md);
    }

    .search-bar input {
        padding: 8px 14px;
        font-size: 13px;
    }

    .search-bar button {
        padding: 8px 16px;
        font-size: 12px;
    }

    .header-actions {
        gap: 4px;
    }

    .action-link {
        padding: 6px 8px;
    }

    .action-link .label {
        display: none;
    }

    .action-link .icon {
        font-size: 18px;
    }

    /* --- Navigation --- */
    .main-nav {
        height: 42px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-menu > li > a {
        padding: 10px 14px;
        font-size: 13px;
        font-weight: 500;
    }

    .nav-menu > li > a::after {
        display: none;
    }

    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        padding: 8px;
        margin: 0;
        overflow-y: auto;
    }

    /* --- Hero --- */
    .hero-section {
        margin-bottom: 32px;
    }

    .hero-slide {
        padding: 48px 20px;
        margin: 12px 0;
        border-radius: var(--radius-lg);
    }

    .hero-content h1 {
        font-size: 1.5rem;
        margin-bottom: 12px;
        line-height: 1.4;
    }

    .hero-content p {
        font-size: 0.875rem;
        margin-bottom: 24px;
    }

    .hero-content .btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    /* --- Categories --- */
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .category-card {
        padding: 14px 8px;
        border-radius: var(--radius-md);
    }

    .category-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
    }

    .placeholder-icon {
        font-size: 18px;
    }

    .category-card h3 {
        font-size: 11px;
        line-height: 1.3;
    }

    .product-count {
        font-size: 10px;
        display: none;
    }

    /* --- Products Grid --- */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card {
        border-radius: var(--radius-md);
    }

    .product-image {
        height: 150px;
    }

    .product-info {
        padding: 10px;
    }

    .product-category {
        font-size: 10px;
    }

    .product-title {
        font-size: 12px;
        margin: 4px 0;
        -webkit-line-clamp: 2;
        line-height: 1.4;
    }

    .product-rating {
        margin-bottom: 6px;
    }

    .star {
        font-size: 10px;
    }

    .rating-count {
        font-size: 10px;
    }

    .product-price {
        margin-bottom: 10px;
    }

    .current-price {
        font-size: 14px;
    }

    .old-price {
        font-size: 11px;
    }

    .discount-badge {
        padding: 2px 8px;
        font-size: 10px;
        top: 8px;
        right: 8px;
    }

    .wishlist-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
        top: 8px;
        left: 8px;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 11px;
        width: 100%;
    }

    /* --- Section Headers --- */
    .section-header {
        margin-bottom: 20px;
    }

    .section-header h2 {
        font-size: 1.125rem;
    }

    .view-all {
        font-size: 12px;
    }

    .products-section {
        margin-bottom: 40px;
    }

    /* --- Product Detail --- */
    .breadcrumb {
        padding: 12px 0;
        font-size: 11px;
    }

    .product-detail {
        gap: 20px;
        margin-bottom: 40px;
    }

    .main-image {
        border-radius: var(--radius-lg);
    }

    .main-image img {
        height: 280px;
    }

    .product-details .product-title {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }

    .product-details .product-rating {
        margin-bottom: 12px;
    }

    .product-price-block {
        margin-bottom: 16px;
    }

    .product-price-block .current-price {
        font-size: 1.5rem;
    }

    .discount-tag {
        padding: 4px 10px;
        font-size: 12px;
    }

    .product-meta {
        padding: 12px;
    }

    .product-meta p {
        font-size: 13px;
    }

    .product-short-desc {
        font-size: 13px;
    }

    .add-to-cart-form {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .quantity-selector {
        justify-content: center;
    }

    .add-to-cart-form .btn {
        width: 100%;
    }

    .product-actions {
        flex-direction: column;
    }

    .product-actions .btn {
        width: 100%;
    }

    /* --- Tabs --- */
    .tab-buttons {
        overflow-x: auto;
        white-space: nowrap;
    }

    .tab-btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    .review-form {
        padding: 16px;
    }

    /* --- Cart Page --- */
    .cart-layout {
        gap: 20px;
    }

    .cart-table {
        font-size: 13px;
        border-radius: var(--radius-md);
    }

    .cart-table th {
        padding: 10px 12px;
        font-size: 10px;
    }

    .cart-table td {
        padding: 12px;
    }

    .cart-product-info {
        gap: 10px;
    }

    .cart-product-info img {
        width: 48px;
        height: 48px;
    }

    .cart-product-info a {
        font-size: 12px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .sale-indicator {
        font-size: 9px;
        padding: 1px 6px;
    }

    .quantity-selector {
        border-radius: var(--radius-sm);
    }

    .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .qty-input {
        width: 40px;
        height: 32px;
        font-size: 13px;
    }

    .cart-summary {
        padding: 20px;
        position: static;
        border-radius: var(--radius-md);
    }

    .coupon-form form {
        flex-direction: column;
    }

    .coupon-form input {
        width: 100%;
    }

    .coupon-form .btn {
        width: 100%;
    }

    /* --- Checkout --- */
    .checkout-layout {
        gap: 20px;
    }

    .checkout-section {
        padding: 20px;
        border-radius: var(--radius-md);
    }

    .checkout-summary {
        padding: 20px;
        position: static;
        border-radius: var(--radius-md);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* --- Confirmation --- */
    .confirmation-container {
        padding: 40px 16px;
    }

    .confirmation-icon {
        width: 64px;
        height: 64px;
        font-size: 28px;
    }

    .confirmation-container h1 {
        font-size: 1.25rem;
    }

    .order-number {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .confirmation-details {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .detail-section {
        padding: 20px;
        border-radius: var(--radius-md);
    }

    .confirmation-actions {
        flex-direction: column;
    }

    .confirmation-actions .btn {
        width: 100%;
    }

    /* --- Orders --- */
    .orders-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    .filter-btn {
        padding: 6px 14px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .order-card {
        border-radius: var(--radius-md);
    }

    .order-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .order-info {
        gap: 10px;
    }

    .order-number {
        font-size: 13px;
    }

    .order-date {
        font-size: 11px;
    }

    .order-status {
        font-size: 11px;
        padding: 3px 10px;
    }

    .order-summary {
        padding: 12px 16px;
    }

    .order-total {
        font-size: 14px;
    }

    .order-actions {
        padding: 12px 16px;
        flex-direction: column;
    }

    .order-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* --- Order Detail --- */
    .order-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
    }

    .detail-card {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .order-items-table th {
        padding: 8px;
        font-size: 10px;
    }

    .order-items-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .item-with-image {
        gap: 8px;
    }

    .item-with-image img {
        width: 36px;
        height: 36px;
    }

    /* --- Tracking --- */
    .tracking-progress {
        margin: 24px 0;
        padding-right: 24px;
    }

    .progress-step {
        gap: 12px;
    }

    .step-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .step-label {
        font-size: 11px;
    }

    .tracking-history {
        margin-top: 24px;
    }

    .tracking-history h2 {
        font-size: 1rem;
    }

    .history-item {
        padding: 12px 0;
        gap: 12px;
    }

    /* --- Account --- */
    .account-layout {
        gap: 16px;
    }

    .account-sidebar {
        position: static;
        border-radius: var(--radius-md);
    }

    .account-user-info {
        padding: 24px 16px;
    }

    .user-avatar {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .account-nav .nav-item {
        padding: 12px 16px;
        font-size: 13px;
    }

    .account-section {
        padding: 20px;
        border-radius: var(--radius-md);
    }

    .account-section h2 {
        font-size: 1.125rem;
    }

    .wallet-card {
        padding: 24px 16px;
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .wallet-icon {
        font-size: 36px;
    }

    .wallet-total {
        font-size: 1.5rem;
    }

    /* --- Wishlist --- */
    .wishlist-page .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* --- Search --- */
    .page-header h1 {
        font-size: 1.25rem;
    }

    /* --- Products Sidebar (Filters) --- */
    .products-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .filter-group {
        margin-bottom: 16px;
    }

    /* --- Alerts --- */
    .alert {
        padding: 12px 16px;
        font-size: 13px;
        border-radius: var(--radius-sm);
    }

    /* --- Pagination --- */
    .pagination {
        margin-top: 24px;
    }

    .page-link {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }

    /* --- Footer --- */
    .site-footer {
        margin-top: 40px;
    }

    .footer-main {
        padding: 40px 0 24px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .footer-col {
        margin-bottom: 8px;
    }

    .footer-col h3 {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .footer-col p {
        font-size: 12px;
    }

    .footer-col ul li {
        margin-bottom: 6px;
    }

    .footer-col ul li a {
        font-size: 12px;
    }

    .footer-bottom {
        padding: 16px 0;
        font-size: 11px;
    }
}

/* Small Mobile: up to 480px */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    /* --- Header --- */
    .main-header {
        height: 56px;
    }

    .logo h2 {
        font-size: 1rem;
    }

    .search-bar input {
        padding: 7px 12px;
        font-size: 12px;
    }

    .search-bar button {
        padding: 7px 12px;
        font-size: 11px;
    }

    .action-link {
        padding: 4px 6px;
    }

    .action-link .icon {
        font-size: 16px;
    }

    /* --- Navigation --- */
    .main-nav {
        height: 38px;
    }

    .nav-menu > li > a {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* --- Hero --- */
    .hero-slide {
        padding: 32px 16px;
    }

    .hero-content h1 {
        font-size: 1.25rem;
    }

    .hero-content p {
        font-size: 0.8rem;
    }

    /* --- Categories --- */
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .category-card {
        padding: 10px 4px;
        border-radius: var(--radius-sm);
    }

    .category-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 6px;
    }

    .placeholder-icon {
        font-size: 14px;
    }

    .category-card h3 {
        font-size: 9px;
    }

    /* --- Products --- */
    .products-grid {
        gap: 8px;
    }

    .product-image {
        height: 130px;
    }

    .product-info {
        padding: 8px;
    }

    .product-category {
        font-size: 9px;
    }

    .product-title {
        font-size: 11px;
        margin: 2px 0;
    }

    .product-rating {
        margin-bottom: 4px;
    }

    .star {
        font-size: 9px;
    }

    .current-price {
        font-size: 13px;
    }

    .old-price {
        font-size: 10px;
    }

    /* --- Product Detail --- */
    .main-image img {
        height: 240px;
    }

    .product-details .product-title {
        font-size: 1.125rem;
    }

    .product-price-block .current-price {
        font-size: 1.25rem;
    }

    /* --- Cart --- */
    .cart-product-info a {
        font-size: 11px;
    }

    /* --- Auth --- */
    .auth-container {
        padding: 20px 0;
    }

    .auth-card {
        padding: 24px;
        border-radius: var(--radius-lg);
    }

    .auth-card h2 {
        font-size: 1.25rem;
    }

    /* --- Empty State --- */
    .empty-state {
        padding: 40px 16px;
    }

    .empty-icon {
        font-size: 40px;
    }

    .empty-state h2 {
        font-size: 1rem;
    }

    /* --- Footer --- */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-col h3 {
        font-size: 12px;
    }

    /* --- Static Pages --- */
    .static-content {
        padding: 24px 16px;
    }

    .policy-grid {
        grid-template-columns: 1fr;
    }

    .help-grid {
        grid-template-columns: 1fr;
    }

    .shipping-options {
        grid-template-columns: 1fr;
    }

    .delivery-areas {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-buttons .btn {
        width: 100%;
    }
}

/* Extra Small: up to 360px */
@media (max-width: 360px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .product-image {
        height: 110px;
    }

    .hero-content h1 {
        font-size: 1.1rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: scale(0.97);
    }

    .product-card:active {
        transform: scale(0.98);
    }

    .category-card:active {
        transform: scale(0.97);
    }

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

    .page-link:active {
        transform: scale(0.95);
    }
}

/* Safe Area (Notch phones) */
@supports (padding: env(safe-area-inset-bottom)) {
    .site-footer {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .main-header {
        padding-top: env(safe-area-inset-top);
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Can be enabled later */
}

/* === CAPTCHA === */
.captcha-group {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--bg-secondary);
}

.captcha-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-img {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    height: 56px;
    flex-shrink: 0;
    transition: border-color var(--transition-fast);
}

.captcha-img:hover {
    border-color: var(--accent);
}

.captcha-row input[type="number"] {
    flex: 1;
    max-width: 120px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    direction: ltr;
    -moz-appearance: textfield;
}

.captcha-row input[type="number"]::-webkit-outer-spin-button,
.captcha-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.captcha-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* === Product Gallery Thumbnails === */
.gallery-thumbnails {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.thumbnail {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.thumbnail:hover {
    border-color: var(--accent);
}

.thumbnail.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* === Category Icon in Frontend === */
.category-card .category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    min-height: 60px;
}

.category-card .category-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.category-card .placeholder-icon {
    font-size: 40px;
    opacity: 0.4;
}

.nav-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-left: 6px;
    vertical-align: middle;
    border-radius: 4px;
}

.filter-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-left: 4px;
    vertical-align: middle;
    border-radius: 3px;
}

/* =============================================
   Hero Slider
   ============================================= */
.hero-section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.hero-slider {
    position: relative;
    width: 100%;
    min-height: 400px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin: 12px 0;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide.active {
    opacity: 1;
    position: relative;
}

.hero-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(17,24,39,0.7) 0%, rgba(37,99,235,0.5) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 40px 20px;
    max-width: 700px;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    color: var(--primary);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.slider-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.slider-prev { left: 20px; }
.slider-next { right: 20px; }

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: var(--transition-fast);
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

/* =============================================
   Features Bar
   ============================================= */
.features-bar {
    background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 28px 0;
    margin-top: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    border-left: 1px solid rgba(255,255,255,0.08);
    transition: background var(--transition-fast);
}
.feature-item:last-child { border-left: none; }
.feature-item:hover { background: rgba(255,255,255,0.04); }

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.07);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}
.feature-item:hover .feature-icon {
    background: rgba(37,99,235,0.25);
}

.feature-item strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.feature-item span {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
}

/* Mobile hero overrides */
@media (max-width: 768px) {
    .hero-section { margin-bottom: 8px; }
    .hero-slider {
        min-height: 220px;
        margin: 6px;
        border-radius: var(--radius-lg);
    }
    .hero-content { padding: 24px 16px; }
    .hero-content h1 { font-size: 1.2rem; margin-bottom: 8px; }
    .hero-content p  { font-size: 0.85rem; margin-bottom: 14px; }
    .hero-content .btn { padding: 10px 18px; font-size: 13px; }
    .slider-dots { bottom: 8px; }
}
@media (max-width: 480px) {
    .hero-slider { min-height: 180px; }
    .hero-content h1 { font-size: 1.05rem; }
    .hero-content p  { display: none; }
}


.banners-section {
    padding: 30px 0;
}

.banners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.banner-card {
    position: relative;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    aspect-ratio: 16/7;
}

.banner-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.banner-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
}

.banner-overlay span {
    font-weight: 600;
    font-size: 1rem;
}

/* =============================================
   Responsive - Slider & Features
   ============================================= */
@media (max-width: 768px) {
    /* Hero - تقليل المساحات الكبيرة */
    .hero-section { margin-bottom: 16px; }
    .hero-slide {
        padding: 32px 20px;
        margin: 8px;
        border-radius: var(--radius-lg);
    }
    .hero-slider { min-height: 160px; }
    .hero-content h1 { font-size: 1.25rem; }
    .hero-content p { font-size: 0.85rem; margin-bottom: 16px; }
    .hero-content .btn { padding: 10px 20px; font-size: 13px; }
    .slider-btn { width: 32px; height: 32px; font-size: 1rem; }
    .slider-prev { left: 6px; }
    .slider-next { right: 6px; }

    /* Features Bar - تمرير أفقي على الهاتف */
    .features-bar { padding: 16px 0; margin-top: 24px; }
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
    }
    .feature-item {
        padding: 12px 14px;
        border-left: 1px solid rgba(255,255,255,0.08);
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .feature-item:nth-child(odd) { border-left: none; }
    .feature-item:nth-last-child(-n+2) { border-bottom: none; }
    .feature-icon { width: 38px; height: 38px; font-size: 1.3rem; }
    .feature-item strong { font-size: 0.82rem; }
    .feature-item span { font-size: 0.72rem; }

    .banners-grid {
        grid-template-columns: 1fr;
    }

    /* Section spacing */
    .categories-section,
    .products-section { margin-bottom: 24px; }
    .section-header { margin-bottom: 12px; }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ================================================================
   NAVIGATION IMPROVEMENTS (Progress Bar & Smart Back)
   ================================================================ */
#page-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    z-index: 10000;
    width: 0;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 0 10px var(--accent);
}

.mobile-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 20px;
    flex-shrink: 0;
    transition: background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}
.mobile-back-btn:hover {
    background: var(--bg-tertiary);
}
@media (max-width: 768px) {
    .mobile-back-btn {
        display: flex;
    }
}

/* Spinner for buttons preventing double submit */
.btn.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}
.btn.is-loading .btn-text {
    opacity: 0;
}
.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}


/* ================================================================
   MOBILE-FIRST COMPLETE OVERHAUL
   مستوحى من: Amazon، Noon، Jumia، Shein
   ================================================================ */

/* ----------------------------------------------------------------
   1. UTILITIES - desktop-only / mobile-only
   ---------------------------------------------------------------- */
.desktop-only { display: flex !important; }
.mobile-only  { display: none  !important; }

/* ----------------------------------------------------------------
   2. HAMBURGER BUTTON
   ---------------------------------------------------------------- */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    padding: 4px;
    transition: background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}
.hamburger-btn:hover { background: var(--bg-tertiary); }

.ham-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}
.hamburger-btn.open .ham-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.open .ham-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-btn.open .ham-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile search trigger */
.mobile-search-trigger {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition-fast);
}
.mobile-search-trigger:hover { background: var(--border-color); }

/* Desktop search default state */
.desktop-search { display: flex; }

/* ----------------------------------------------------------------
   2.5 TYPOGRAPHY (MOBILE SCALING)
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    h2 {
        font-size: 1.25rem;
        line-height: 1.3;
    }
    h3 {
        font-size: 1.125rem;
    }
    p, .product-short-desc, .review-comment {
        font-size: 14px;
        line-height: 1.6;
    }
    .product-title {
        font-size: 1.125rem;
        line-height: 1.4;
    }
    .product-price-block .current-price {
        font-size: 1.25rem;
    }
    .price {
        font-size: 1.1rem !important;
    }
    .btn {
        font-size: 14px;
    }
}

/* ----------------------------------------------------------------
   3. DRAWER OVERLAY
   ---------------------------------------------------------------- */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9000;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.drawer-overlay.active {
    display: block;
    opacity: 1;
}

/* ----------------------------------------------------------------
   4. MOBILE SIDE DRAWER
   ---------------------------------------------------------------- */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    height: 100dvh;
    background: var(--bg-primary);
    z-index: 9100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.mobile-drawer.open {
    right: 0;
}

/* Drawer Header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
    flex-shrink: 0;
}
.drawer-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.03em;
}
.drawer-logo .logo-accent { color: #60a5fa; }

.drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: var(--radius-full);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}
.drawer-close:hover { background: rgba(255,255,255,0.2); }

/* Drawer User Info */
.drawer-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1e3a5f, #1e40af);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.drawer-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.25);
}
.drawer-user-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
}
.drawer-user-sub {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    margin-top: 2px;
}

/* Drawer Nav Links */
.drawer-nav {
    flex: 1;
    padding: 8px 0 24px;
    display: flex;
    flex-direction: column;
}
.drawer-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 16px 20px 6px;
}
.drawer-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 16px;
}
.drawer-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    transition: background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    min-height: 48px;
}
.drawer-link:hover,
.drawer-link:active { background: var(--bg-tertiary); }
.drawer-link-icon {
    font-size: 18px;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}
.drawer-cat-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}
.drawer-badge {
    margin-right: auto;
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}
.drawer-logout { color: var(--danger); }

.drawer-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px 16px;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    min-height: 48px;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}
.drawer-link-primary {
    background: var(--accent);
    color: white;
}
.drawer-link-primary:hover { background: var(--accent-hover); }
.drawer-link-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.drawer-link-secondary:hover { background: var(--border-color); }

/* ----------------------------------------------------------------
   5. MOBILE SEARCH MODAL
   ---------------------------------------------------------------- */
.mobile-search-modal {
    position: fixed;
    top: -100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    z-index: 9200;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: top 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--border-color);
}
.mobile-search-modal.open {
    top: 0;
}
.mobile-search-inner {
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
}
.mobile-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0 8px 0 0;
    transition: border-color var(--transition-base);
}
.mobile-search-form:focus-within {
    border-color: var(--accent);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.mobile-search-back {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    -webkit-tap-highlight-color: transparent;
}
.mobile-search-modal input[type="text"],
.mobile-search-modal input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px; /* 16px prevents iOS zoom */
    color: var(--text-primary);
    outline: none;
    padding: 12px 4px;
    font-family: var(--font-sans);
    min-width: 0;
}
.mobile-search-modal input::placeholder { color: var(--text-muted); }
.mobile-search-go {
    padding: 8px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast);
    font-family: var(--font-sans);
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.mobile-search-go:hover { background: var(--primary-hover); }

/* ----------------------------------------------------------------
   6. MOBILE BOTTOM NAVIGATION BAR
   ---------------------------------------------------------------- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    z-index: 8000;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    flex-direction: row;
    align-items: stretch;
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font-sans);
    position: relative;
    min-width: 0;
}
.bottom-nav-item:active { opacity: 0.7; }
.bottom-nav-item.active {
    color: var(--accent);
}
.bottom-nav-item.active .bn-icon {
    transform: translateY(-1px);
}
.bottom-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 2px 2px;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}
.bottom-nav-item.active::before {
    transform: scaleX(1);
}
.bn-icon {
    font-size: 20px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s ease;
    position: relative;
}
.bn-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.bn-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: var(--radius-full);
    min-width: 15px;
    text-align: center;
    line-height: 1.4;
    border: 1.5px solid var(--bg-primary);
}

/* Space at bottom for bottom nav on mobile */
body.has-bottom-nav .site-footer {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
}

/* ----------------------------------------------------------------
   7. MOBILE RESPONSIVE BREAKPOINT (<= 768px)
   ---------------------------------------------------------------- */
@media (max-width: 768px) {

    /* Show/hide elements */
    .desktop-only { display: none !important; }
    .mobile-only  { display: flex  !important; }
    .hamburger-btn { display: flex; }
    .mobile-search-trigger { display: flex; }
    .desktop-search { display: none; }
    .mobile-bottom-nav { display: flex; }
    .desktop-nav { display: none !important; }

    /* Lock scroll when drawer/modal open */
    body.drawer-open,
    body.search-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    /* --- Site main padding for bottom nav --- */
    .site-main {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
    .site-footer {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }

    /* --- Top Bar: hide completely on mobile --- */
    .top-bar { display: none; }

    /* --- Main Header --- */
    .main-header {
        height: 56px;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .header-content {
        gap: 8px;
        align-items: center;
    }

    .logo h2 {
        font-size: 1.2rem;
        font-weight: 800;
    }

    /* Header Actions compact */
    .header-actions { gap: 2px; }

    .action-link {
        padding: 6px 8px;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }
    .action-link .label { display: none; }
    .action-link .icon { font-size: 20px; }

    /* --- Products Grid: 2 columns --- */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .product-image { height: 160px; }
    .product-info { padding: 10px 8px; }
    .product-title { font-size: 13px; line-height: 1.4; }
    .current-price { font-size: 14px; font-weight: 700; }

    /* Add to cart button full width on card */
    .product-card .btn-sm {
        width: 100%;
        padding: 9px;
        font-size: 12px;
        border-radius: var(--radius-md);
    }


    /* --- Hero (managed by dedicated mobile override above) --- */

    /* --- Categories --- */
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    .category-card { padding: 12px 6px; }
    .category-card h3 { font-size: 10px; }
    .category-icon { width: 38px; height: 38px; }

    /* --- Features Bar --- */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .feature-icon { font-size: 1.5rem; }

    /* --- Section Header --- */
    .section-header { margin-bottom: 16px; }
    .section-header h2 { font-size: 1rem; }

    /* --- Product Detail --- */
    .product-detail {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .main-image img { height: 300px; }

    .gallery-thumbnails {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .gallery-thumbnails::-webkit-scrollbar { display: none; }
    .gallery-thumbnails .thumbnail {
        flex: 0 0 64px;
        height: 64px;
        border-radius: var(--radius-sm);
        overflow: hidden;
        cursor: pointer;
        border: 2px solid transparent;
        transition: border-color var(--transition-fast);
    }
    .gallery-thumbnails .thumbnail.active {
        border-color: var(--accent);
    }
    .gallery-thumbnails .thumbnail img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .add-to-cart-form {
        flex-direction: column;
        gap: 12px;
    }
    .add-to-cart-form .btn { width: 100%; }
    .product-actions { flex-direction: column; }
    .product-actions .btn { width: 100%; }

    .product-meta {
        padding: 12px;
    }
    .product-meta p {
        font-size: 13px;
    }
    .product-short-desc {
        font-size: 13px;
    }
    .product-price-block .current-price {
        font-size: 1.5rem;
    }
    .discount-tag {
        padding: 4px 10px;
        font-size: 12px;
    }

    .reviews-list .review-item {
        padding: 12px 0;
    }

    /* --- Cart --- */
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .cart-summary {
        position: static;
        padding: 16px;
        border-radius: var(--radius-md);
    }
    .cart-summary h3 {
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    .coupon-form form {
        flex-direction: column;
    }
    .coupon-form input {
        width: 100%;
    }
    .coupon-form .btn {
        width: 100%;
    }

    /* Cart table → card layout */
    .cart-table { display: block; width: 100%; }
    .cart-table thead { display: none; }
    .cart-table tbody { display: block; }
    .cart-table tr {
        display: block;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 12px;
        margin-bottom: 10px;
    }
    .cart-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid var(--border-light);
        font-size: 13px;
    }
    .cart-table td:last-child {
        border-bottom: none;
    }
    .cart-table td.cart-product {
        padding-bottom: 10px;
        margin-bottom: 4px;
        border-bottom: 1px solid var(--border-color);
    }
    .cart-table td.cart-product a {
        font-size: 13px;
    }
    .cart-table td.cart-product img {
        width: 52px;
        height: 52px;
    }
    .cart-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: var(--text-muted);
        flex: 0 0 auto;
        margin-left: 12px;
    }
    [dir="rtl"] .cart-table td::before {
        margin-left: 0;
        margin-right: 12px;
    }
    .cart-actions {
        padding: 12px 0;
    }

    /* --- Checkout --- */
    .checkout-layout { grid-template-columns: 1fr; }
    .checkout-summary { position: static; }
    .form-row { grid-template-columns: 1fr; }

    /* --- Orders --- */
    .orders-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
        white-space: nowrap;
        gap: 6px;
    }
    .orders-filters::-webkit-scrollbar { display: none; }
    .orders-filters .filter-btn {
        flex: 0 0 auto;
        padding: 6px 14px;
        font-size: 12px;
    }

    .order-card {
        border-radius: var(--radius-md);
    }
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 14px;
    }
    .order-info {
        gap: 10px;
    }
    .order-number { font-size: 13px; }
    .order-date { font-size: 11px; }
    .order-status {
        align-self: flex-start;
        padding: 3px 10px;
        font-size: 11px;
    }
    .order-summary {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 4px;
    }
    .order-total { font-size: 14px; }
    .order-items-count { font-size: 12px; }
    .order-actions {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .order-actions .btn {
        font-size: 12px;
        padding: 6px 12px;
        min-height: 36px;
    }

    /* --- Account --- */
    .account-layout { grid-template-columns: 1fr; }
    .account-sidebar { position: static; }
    .account-nav {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        scrollbar-width: none;
        border-bottom: 1px solid var(--border-color);
    }
    .account-nav::-webkit-scrollbar { display: none; }
    .account-nav .nav-item {
        flex: 0 0 auto;
        padding: 12px 16px;
        font-size: 13px;
        white-space: nowrap;
        border-bottom: 2px solid transparent;
    }
    .account-nav .nav-item.active {
        border-bottom-color: var(--accent);
    }
    .account-section {
        padding: 16px;
    }
    .account-section h2 {
        font-size: 1.125rem;
    }

    /* --- Footer --- */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }

    /* --- Tab buttons scrollable --- */
    .tab-buttons { overflow-x: auto; white-space: nowrap; }

    /* --- Breadcrumb compact --- */
    .breadcrumb { font-size: 12px; padding: 10px 0; }

    /* --- Page Header --- */
    .page-header h1 { font-size: 1.25rem; }
    .results-count { font-size: 13px; }

    /* --- Search page --- */
    .empty-state { padding: 24px 16px; }
    .empty-state h2 { font-size: 1.125rem; }
    .empty-state p { font-size: 13px; }

    /* --- Pagination --- */
    .pagination { margin-top: 20px; gap: 4px; }
    .page-link { min-width: 34px; height: 34px; font-size: 13px; }
}

/* ----------------------------------------------------------------
   8. SMALL MOBILE (<= 480px)
   ---------------------------------------------------------------- */
@media (max-width: 480px) {

    .container { padding: 0 12px; }

    .main-header { height: 52px; }
    .logo h2 { font-size: 1.1rem; }

    .action-link { padding: 4px 6px; min-width: 40px; }
    .action-link .icon { font-size: 18px; }

    .hero-slider { min-height: 180px; }
    .hero-content h1 { font-size: 1.1rem; }
    .hero-content p { font-size: 0.8rem; display: none; }

    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    .category-card { padding: 8px 4px; border-radius: var(--radius-sm); }
    .category-icon { width: 32px; height: 32px; }
    .category-card h3 { font-size: 9px; }
    .product-count { display: none; }

    .products-grid { gap: 8px; }
    .product-image { height: 140px; }
    .product-info { padding: 8px; }
    .product-title { font-size: 11px; -webkit-line-clamp: 2; }
    .current-price { font-size: 13px; }
    .old-price { font-size: 10px; }
    .discount-badge { font-size: 10px; padding: 2px 6px; }

    .section-header h2 { font-size: 0.95rem; }
    .view-all { font-size: 11px; }

    .footer-grid { grid-template-columns: 1fr; }

    /* Drawer slightly narrower */
    .mobile-drawer { width: 280px; }

    .main-image img { height: 250px; }
    .product-title { font-size: 14px; }
    .product-price-block .current-price { font-size: 1.3rem; }
}

/* ----------------------------------------------------------------
   8. SMALL MOBILE (≤ 480px)
   ---------------------------------------------------------------- */
@media (max-width: 480px) {

    .container { padding: 0 12px; }

    .main-header { height: 52px; }
    .logo h2 { font-size: 1.1rem; }

    .action-link { padding: 4px 6px; min-width: 40px; }
    .action-link .icon { font-size: 18px; }

    .hero-slider { min-height: 180px; }
    .hero-content h1 { font-size: 1.1rem; }
    .hero-content p { font-size: 0.8rem; display: none; }

    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    .category-card { padding: 8px 4px; border-radius: var(--radius-sm); }
    .category-icon { width: 32px; height: 32px; }
    .category-card h3 { font-size: 9px; }
    .product-count { display: none; }

    .products-grid { gap: 8px; }
    .product-image { height: 140px; }
    .product-info { padding: 8px; }
    .product-title { font-size: 11px; -webkit-line-clamp: 2; }
    .current-price { font-size: 13px; }
    .old-price { font-size: 10px; }
    .discount-badge { font-size: 10px; padding: 2px 6px; }

    .section-header h2 { font-size: 0.95rem; }
    .view-all { font-size: 11px; }

    .footer-grid { grid-template-columns: 1fr; }

    /* Drawer slightly narrower */
    .mobile-drawer { width: 280px; }
}

/* ----------------------------------------------------------------
   9. EXTRA SMALL (≤ 360px)
   ---------------------------------------------------------------- */
@media (max-width: 360px) {
    .categories-grid { grid-template-columns: repeat(3, 1fr); }
    .products-grid { gap: 6px; }
    .product-image { height: 120px; }
    .hero-content h1 { font-size: 1rem; }
    .bottom-nav-item { font-size: 10px; }
    .bn-icon { font-size: 18px; }
    .bn-label { font-size: 9px; }
}

/* ----------------------------------------------------------------
   10. TOUCH OPTIMIZATIONS
   ---------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
    /* Minimum touch target size: 44x44px */
    .btn, .action-link, .drawer-link,
    .bottom-nav-item, .nav-menu > li > a {
        min-height: 44px;
    }

    /* Remove hover effects that look weird on touch */
    .product-card:hover { transform: none; box-shadow: none; }
    .category-card:hover { transform: none; }

    /* Active states for touch feedback */
    .btn:active { transform: scale(0.97); }
    .product-card:active { opacity: 0.9; }
    .category-card:active { background: var(--bg-tertiary); }
    .drawer-link:active { background: var(--bg-tertiary); }
}

/* ----------------------------------------------------------------
   11. SAFE AREA (iPhone X+, Dynamic Island)
   ---------------------------------------------------------------- */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        height: calc(60px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mobile-drawer {
        height: 100%;
        height: 100dvh;
    }
    .main-header {
        padding-top: env(safe-area-inset-top, 0px);
    }
}

/* ----------------------------------------------------------------
   12. PREVENT iOS INPUT ZOOM (font-size >= 16px on inputs)
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ----------------------------------------------------------------
   13. SWIPE HINT ANIMATION on slider
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
    .hero-slider {
        cursor: grab;
        user-select: none;
        -webkit-user-select: none;
    }
    .hero-slider:active { cursor: grabbing; }

    /* Hide slider nav buttons on very small - use swipe */
    .slider-btn { display: none; }
    .slider-dots { bottom: 10px; }
    .dot { width: 8px; height: 8px; }
}

/* ----------------------------------------------------------------
   14. MOBILE FILTER SIDEBAR
   ---------------------------------------------------------------- */
.mobile-filter-toggle {
    display: none;
}

.filters-overlay {
    display: none;
}

.sidebar-header-mobile {
    display: none;
}

@media (max-width: 768px) {
    .products-layout {
        position: relative;
    }

    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 10px 16px;
        margin-bottom: 12px;
        background: var(--bg-primary);
        border: 1.5px solid var(--border-color);
        border-radius: var(--radius-md);
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
        cursor: pointer;
        width: 100%;
        justify-content: center;
    }

    .mobile-filter-toggle:active {
        background: var(--bg-tertiary);
    }

    .filter-toggle-icon {
        font-size: 16px;
    }

    .filter-active-dot {
        width: 8px;
        height: 8px;
        background: var(--accent);
        border-radius: 50%;
        margin-right: 4px;
    }

    .filters-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2000;
        width: 85%;
        max-width: 320px;
        height: 100%;
        overflow-y: auto;
        padding: 0;
        border-radius: 0;
        background: var(--bg-primary);
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
        transition: transform 0.3s ease;
    }

    [dir="rtl"] .filters-sidebar {
        left: auto;
        right: 0;
    }

    .filters-sidebar.open {
        display: block;
    }

    .sidebar-header-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        background: var(--bg-primary);
        z-index: 1;
    }

    .sidebar-header-mobile h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
    }

    .sidebar-close-btn {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        background: var(--bg-tertiary);
        border-radius: var(--radius-sm);
        font-size: 16px;
        cursor: pointer;
        color: var(--text-primary);
    }

    .filters-sidebar .filter-form {
        padding: 16px 20px 24px;
    }

    .filters-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1999;
    }

    .filters-overlay.active {
        display: block;
    }

    body.filter-open {
        overflow: hidden;
    }
}

/* ----------------------------------------------------------------
   15. CHECKOUT STEPS
   ---------------------------------------------------------------- */
.checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
    padding: 20px 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity var(--transition-base);
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 0.7;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    border: 2px solid var(--border-color);
    transition: all var(--transition-base);
}

.step.active .step-number {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.step.completed .step-number {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.step-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.step.active .step-label {
    color: var(--text-primary);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    margin: 0 12px;
}

.checkout-step-content {
    display: none;
}

.checkout-step-content.active {
    display: block;
}

.checkout-step-nav {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.checkout-step-nav .btn {
    flex: 1;
}

.order-review {
    margin-bottom: 16px;
}

.review-block {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.review-block h4 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.review-block p {
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .checkout-steps {
        margin-bottom: 20px;
        padding: 12px 0;
    }

    .step-label {
        font-size: 11px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .step-line {
        width: 20px;
        margin: 0 6px;
    }
}

/* Bank Transfer Details */
.bank-details {
    margin-top: 16px;
}

.bank-info-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.bank-info-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.bank-account {
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.bank-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--accent);
    min-width: 80px;
}

.bank-number {
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    direction: ltr;
    letter-spacing: 0.05em;
}

.bank-holder {
    font-size: 12px;
    color: var(--text-muted);
}

.bank-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    font-style: italic;
}

@media (max-width: 768px) {
    .bank-account {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ----------------------------------------------------------------
   INVOICE VERIFICATION PAGE
   ---------------------------------------------------------------- */
.verify-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.verify-input-row {
    display: flex;
    gap: 10px;
}

.verify-input {
    flex: 1;
    padding: 12px 16px;
    font-family: monospace;
    font-size: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
}

.verify-input:focus {
    outline: none;
    border-color: var(--accent);
}

.verify-result {
    margin-top: 24px;
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.verify-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.verify-fail {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.verify-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.verify-result h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.verify-details {
    text-align: right;
    margin-top: 16px;
}

.verify-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.verify-label {
    font-size: 13px;
    color: var(--text-muted);
}

.verify-value {
    font-size: 14px;
    font-weight: 600;
}

.invoice-serial {
    font-family: monospace;
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .verify-card { padding: 20px 16px; }
    .verify-input-row { flex-direction: column; }
    .verify-row { flex-direction: column; gap: 2px; }
}

/* ----------------------------------------------------------------
   NOTIFICATION BELL
   ---------------------------------------------------------------- */
.notif-wrapper {
    position: relative;
}

.notif-bell {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 6px 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.notif-bell:hover {
    color: var(--text-primary);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 2000;
    overflow: hidden;
}

.notif-dropdown.open {
    display: block;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.notif-header h4 {
    font-size: 14px;
    margin: 0;
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}

.notif-list {
    max-height: 280px;
    overflow-y: auto;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.notif-item:hover {
    background: var(--bg-tertiary);
}

.notif-item.unread {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
}

.notif-item strong {
    font-size: 13px;
    display: block;
    margin-bottom: 2px;
}

.notif-item p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 4px;
}

.notif-item small {
    font-size: 11px;
    color: var(--text-muted);
}

.notif-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-footer {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    border-top: 1px solid var(--border-color);
    text-decoration: none;
}

.notif-footer:hover {
    background: var(--bg-tertiary);
}

@media (max-width: 768px) {
    .notif-dropdown {
        width: 280px;
        right: -40px;
    }
    .notif-badge {
        top: 0;
        right: 0;
    }
}

/* =============================================
   RTL/LTR Support
   ============================================= */

/* Mobile drawer direction */
[dir="ltr"] .mobile-drawer {
    left: 0;
    right: auto;
}

/* Flip arrows and icons for LTR */
[dir="ltr"] .faq-toggle {
    transform: scaleX(-1);
}

[dir="ltr"] .ql-arrow {
    transform: scaleX(-1);
}

/* Cart table for LTR */
[dir="ltr"] .cart-table th,
[dir="ltr"] .cart-table td {
    text-align: left;
}

/* Checkout steps for LTR */
[dir="ltr"] .checkout-steps {
    direction: ltr;
}
