@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;500;600;700;800&family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #DC2626;
    --primary-dark: #B91C1C;
    --primary-light: #FEE2E2;
    --accent: #F97316;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.06), 0 1px 2px -1px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --transition: 200ms ease;
    --hero-bg: url('https://images.unsplash.com/photo-1486262715619-67b85e0b08d3?w=1920&q=80') center/cover no-repeat;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--gray-50);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(220, 38, 38, 0.06), transparent),
        linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body[dir="rtl"] {
    font-family: 'Cairo', 'Inter', sans-serif;
}

.container {
    width: 100%;
    max-width: min(1280px, 100%);
    margin: 0 auto;
    padding: 0 1rem;
    min-width: 0;
}

@media (min-width: 640px) {
    .container { padding: 0 1.5rem; }
}
@media (min-width: 1024px) {
    .container { padding: 0 2rem; }
}

/* ===== LOADING ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition);
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== HEADER (fixed so it stays visible when scrolling) ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
    z-index: 100;
    isolation: isolate;
}
header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    min-width: 0;
    gap: 0.5rem;
}
.logo { height: 96px; width: auto; display: block; max-height: 56px; }
@media (min-width: 640px) {
    .logo { max-height: 72px; }
}
.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    overflow: hidden;
}
.logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
@media (max-width: 380px) {
    .logo-text { max-width: 90px; font-size: 1rem; }
}
.main-nav { display: none; }
.header-left { min-width: 0; flex: 1 1 0; }
.header-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

/* Language switcher */
.language-dropdown {
    position: relative;
}
.language-trigger {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
}
.language-trigger:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}
.language-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 10;
}
[dir="rtl"] .language-menu { right: auto; left: 0; }
.language-dropdown.active .language-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.language-option {
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: right;
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: background var(--transition);
}
.language-option:hover { background: var(--gray-50); }
.language-option.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Cart icon */
.cart-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 9999px;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
}
.cart-icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: var(--white);
    border-radius: 9999px;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--white);
}

[dir="rtl"] .cart-badge { right: auto; left: -4px; }

/* Content below fixed header (all store pages) */
header + * {
    margin-top: 72px;
}
@media (max-width: 640px) {
    header + * {
        margin-top: 56px;
    }
}

/* ===== HERO ===== */
.hero {
    position: relative;
    background: var(--hero-bg);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.92) 0%, rgba(127, 29, 29, 0.88) 50%, rgba(0, 0, 0, 0.75) 100%);
    z-index: 0;
}
.hero .container {
    position: relative;
    z-index: 1;
}
.hero-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.hero-subtitle {
    font-size: 1rem;
    opacity: 0.95;
    max-width: 28rem;
    margin: 0 auto;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.hero-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem 2rem;
    margin-top: 1.75rem;
}
.hero-feature {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.hero-feature svg {
    flex-shrink: 0;
    opacity: 0.9;
}
@media (min-width: 640px) {
    .hero { padding: 5rem 0; }
    .hero-title { font-size: 2.75rem; }
    .hero-subtitle { font-size: 1.25rem; }
}
@media (min-width: 1024px) {
    .hero { padding: 6rem 0; }
    .hero-title { font-size: 3.25rem; }
}

/* ===== BRANDS + SEARCH (compact toolbar) ===== */
.brands-section {
    padding: 0.75rem 0;
    margin: 0;
    margin-top: -0.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    position: relative;
    z-index: 2;
    max-width: 100%;
}
.brands-section .container {
    padding: 0 1rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .brands-section .container {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
}
.brands-section-header {
    margin: 0;
    flex-shrink: 0;
}
.brands-section-header .section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
}
/* Section titles (e.g. Products) */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}
@media (min-width: 640px) {
    .section-title { font-size: 1.375rem; }
}
.brands-list-label {
    display: none;
}
.search-block {
    flex: 1 1 auto;
    min-width: 0;
    order: -1; /* search first on mobile */
}
@media (min-width: 640px) {
    .search-block {
        order: 0;
        max-width: 260px;
        margin-inline-start: auto;
    }
}
.search-block-label {
    display: none;
}
.search-bar-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-bar-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 0.6rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: text;
    pointer-events: none;
}
.search-bar-label svg {
    width: 16px;
    height: 16px;
}
[dir="rtl"] .search-bar-label { left: auto; right: 0; }
[dir="ltr"] .search-bar-label { left: 0; right: auto; }
.search-bar-input {
    width: 100%;
    padding: 0.45rem 0.85rem 0.45rem 2.25rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--white);
    color: var(--gray-900);
    transition: border-color var(--transition), box-shadow var(--transition);
}
[dir="rtl"] .search-bar-input { padding: 0.45rem 2.25rem 0.45rem 0.85rem; }
.search-bar-input::placeholder {
    color: var(--gray-400);
}
.search-bar-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}
/* Brands list: horizontal scroll strip */
.brands-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    padding: 0.15rem 0;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    min-height: 36px;
}
.brands-list::-webkit-scrollbar {
    height: 4px;
}
.brands-list::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}
.brand-item {
    flex: 0 0 auto;
    padding: 0.35rem 0.85rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.brand-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.brand-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.25);
}

/* Desktop: more breathing room for brands */
@media (min-width: 640px) {
    .brands-section { padding: 0.85rem 0; }
    .brands-list {
        flex: 1 1 auto;
        flex-wrap: wrap;
        justify-content: flex-start;
        overflow-x: visible;
        gap: 0.5rem;
        padding: 0;
    }
    .brand-item {
        padding: 0.4rem 1rem;
        font-size: 0.8125rem;
    }
}

/* ===== PRODUCTS ===== */
.products-section {
    padding: 2rem 0 5rem;
}
@media (min-width: 640px) {
    .products-section { padding: 2.5rem 0 5rem; }
}
.products-section .section-header {
    margin-bottom: 1.75rem;
}
.products-count {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    min-width: 0;
}
@media (min-width: 640px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
}
@media (min-width: 1024px) {
    .products-grid { grid-template-columns: repeat(4, 1fr); gap: 1.75rem; }
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(220, 38, 38, 0.4);
}
.product-card-image {
    aspect-ratio: 1 / 1;
    background: linear-gradient(145deg, var(--gray-100) 0%, var(--gray-200) 100%);
    overflow: hidden;
    position: relative;
}
.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .product-card-image img { transform: scale(1.08); }
.product-card-body {
    padding: 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.product-brand {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
}
.product-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-reference {
    font-size: 0.75rem;
    color: var(--gray-400);
    background: var(--gray-50);
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    display: inline-block;
    width: fit-content;
    border: 1px solid var(--gray-200);
}
.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}
.product-price .currency {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
}
.product-stock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    width: fit-content;
}
.product-stock.available {
    color: var(--success);
    background: #D1FAE5;
}
.product-stock.unavailable {
    color: var(--gray-500);
    background: var(--gray-100);
}
.stock-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.available .stock-indicator { background: var(--success); }
.unavailable .stock-indicator { background: var(--gray-400); }

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    font-size: 1.125rem;
    color: var(--gray-500);
    background: var(--white);
    border-radius: var(--radius);
    border: 1px dashed var(--gray-300);
}

.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-block { width: 100%; }
.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}
.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}
.btn-icon {
    padding: 0.5rem;
}
.btn-icon svg {
    display: block;
}

/* Search input (store products) */
.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 9999px;
    font-size: 0.875rem;
    min-width: 200px;
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ===== CART SIDEBAR ===== */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.cart-overlay.active { opacity: 1; visibility: visible; }
.cart {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    height: 100dvh;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right var(--transition);
    overflow: hidden;
}
@media (max-width: 400px) {
    .cart {
        width: 100vw;
        max-width: none;
    }
}
[dir="rtl"] .cart { right: auto; left: -100%; transition: left var(--transition); }
[dir="rtl"] .cart.open { left: 0; }
.cart.open { right: 0; }
.cart-header {
    padding: 1rem;
    padding-inline-start: 1.5rem;
    padding-inline-end: 1rem;
    background: var(--primary);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    min-height: 60px;
}
.cart-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.close-cart-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 9999px;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.close-cart-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-200);
}
.cart-item-info { flex: 1; }
.cart-item-info strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--gray-900);
}
.cart-item-info div {
    font-size: 0.875rem;
    color: var(--gray-600);
}
.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cart-item-controls button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray-700);
    transition: var(--transition);
}
.cart-item-controls button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.total-amount { color: var(--primary); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===== CHECKOUT PAGE ===== */

.container:has(.checkout-page) {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.checkout-page {
    max-width: 1000px;
    width: calc(100vw - 2rem);
    box-shadow: var(--shadow-xl);
    margin: 0 auto;
}

.checkout-summary {
    padding: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.checkout-summary h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.checkout-form {
    padding: 2rem;
}

.checkout-form h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .checkout-page {
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin: 0 auto;
    }
    .checkout-summary {
        border-bottom: none;
        border-left: 1px solid var(--gray-200);
    }
    [dir="rtl"] .checkout-summary {
        border-left: none;
        border-right: 1px solid var(--gray-200);
    }
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9375rem;
}

.checkout-item:last-of-type { border-bottom: none; }
.checkout-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.125rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--gray-200);
}

.checkout-total:last-of-type {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    font-size: 1.25rem;
    color: var(--primary);
}

/* ===== ORDER RESULT ===== */
body.result-body {
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(16, 185, 129, 0.06), transparent 50%),
        linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
    padding: 2rem 1rem 4rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.result-page {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    text-align: center;
    border: 1px solid var(--gray-100);
}
.result-page h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}
.result-page p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}
.status-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}
.status-icon.success {
    color: var(--success);
    background: #D1FAE5;
}
.status-icon.error {
    color: var(--danger);
    background: #FEE2E2;
}
.order-details-card {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: right;
    border: 1px solid var(--gray-200);
}
.result-page .btn { margin-top: 0.5rem; }
.result-page .btn + .btn { margin-right: 0.75rem; }
[dir="ltr"] .result-page .btn + .btn { margin-right: 0; margin-left: 0.75rem; }

/* ===== PRODUCT DETAIL PAGE ===== */
.product-details-section {
    padding: 2rem 0 4rem;
    min-height: 60vh;
}
.product-details-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--gray-100);
}

/* ===== ADMIN ===== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: url('https://images.unsplash.com/photo-1625047509168-a7026f36de04?w=1920&q=80') center/cover no-repeat;
    position: relative;
}
.login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.9) 0%, rgba(127, 29, 29, 0.85) 100%);
    z-index: 0;
}
.login-screen .login-box {
    position: relative;
    z-index: 1;
}
.login-box {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--gray-100);
}
.login-box h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    text-align: center;
}
.admin-nav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: 9999px;
    margin: 1.5rem 0;
}
.nav-btn {
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}
.nav-btn:hover { background: var(--white); color: var(--gray-900); }
.nav-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}
.modal.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--gray-100);
}
.close-modal {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 9999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: var(--transition);
}
[dir="rtl"] .close-modal { left: auto; right: 1rem; }
.close-modal:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}
.modal-content h2 { margin-bottom: 1.5rem; font-size: 1.25rem; }
.modal-success { text-align: center; }
.modal-success .success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: #D1FAE5;
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}
.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 1rem;
    padding: 0.5rem 0;
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;            /* pill shape */
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-400);
    box-shadow: none;
    transform: none;
}

/* Special styling for first/prev/next/last buttons */
.page-btn.first,
.page-btn.prev,
.page-btn.next,
.page-btn.last {
    font-size: 1.25rem;                /* make arrows larger */
    line-height: 1;
    background: var(--gray-50);
}

/* Dots between page numbers */
.pagination .dots {
    color: var(--gray-400);
    font-size: 1rem;
    font-weight: 600;
    padding: 0 0.25rem;
}

/* Responsive: on small screens, hide some page numbers */
@media (max-width: 640px) {
    .page-btn:not(.active):not(.first):not(.prev):not(.next):not(.last) {
        display: none;
    }
    .pagination .dots {
        display: none;
    }
    /* Keep only active, arrows, and immediate neighbours? You can refine further */
    .page-btn.first,
    .page-btn.prev,
    .page-btn.next,
    .page-btn.last,
    .page-btn.active {
        display: inline-flex;
    }
}

/* ===== FOOTER ===== */
.site-footer {
    position: relative;
    margin-top: 4rem;
    padding: 0;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--gray-300);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
}
.footer-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 50%, var(--primary) 100%);
    opacity: 0.95;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding: 2.25rem 0 1.5rem;
}
.footer-heading {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 1rem;
}
.footer-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 2rem;
}
.footer-link-list li {
    margin: 0;
}
.footer-link-list a {
    display: inline-block;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.25rem 0;
    transition: color var(--transition), transform var(--transition);
}
.footer-link-list a:hover {
    color: var(--white);
}
body:not([dir="rtl"]) .footer-link-list a:hover {
    transform: translateX(2px);
}
body[dir="rtl"] .footer-link-list a:hover {
    transform: translateX(-2px);
}
.footer-bottom {
    padding: 1rem 0 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer-copyright {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin: 0;
    letter-spacing: 0.02em;
}
@media (max-width: 640px) {
    .footer-inner {
        flex-direction: column;
        text-align: start;
        padding: 2rem 0 1.25rem;
    }
    .footer-link-list {
        flex-direction: column;
        gap: 0.125rem;
    }
}

/* Static pages (Shipping, FAQ, About, Contact) */
.page-content {
    padding: 2rem 0 3rem;
    max-width: 720px;
}
.page-content .page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}
.page-content .page-intro {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.content-block {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.content-block h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}
.content-block p {
    color: var(--gray-600);
    margin: 0 0 0.75rem;
    line-height: 1.6;
}
.content-block p:last-child {
    margin-bottom: 0;
}
.faq-list .faq-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-200);
}
.faq-list .faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.faq-list .faq-item:first-child {
    padding-top: 0;
}
.faq-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.35rem;
}
.faq-item p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--gray-600);
}
.contact-info .contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.contact-info .contact-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
}
.contact-info .contact-list li:last-child {
    border-bottom: none;
}
.contact-label {
    font-weight: 600;
    color: var(--gray-700);
    min-width: 8rem;
}
.contact-info .contact-list a {
    color: var(--primary);
    text-decoration: none;
}
.contact-info .contact-list a:hover {
    text-decoration: underline;
}

/* ===== MOBILE OPTIMIZATIONS (Store) ===== */
@media (max-width: 640px) {
    /* Header: compact + keep fixed (spacing via header + * above) */
    header .container { height: 56px; }
    .logo { max-height: 44px !important; }
    .logo-text { font-size: 0.875rem; max-width: 120px; }
    .cart-icon-btn { width: 36px; height: 36px; }
    .cart-badge { width: 18px; height: 18px; font-size: 0.65rem; top: -2px; right: -2px; }
    [dir="rtl"] .cart-badge { right: auto; left: -2px; }
    .language-trigger { padding: 0.4rem 0.6rem; font-size: 0.75rem; }

    /* Hero: smaller */
    .hero { padding: 2rem 0 2.5rem; }
    .hero-title { font-size: 1.35rem; margin-bottom: 0.35rem; }
    .hero-subtitle { font-size: 0.8125rem; }
    .hero-features { gap: 0.5rem 1rem; margin-top: 1rem; }
    .hero-feature { font-size: 0.75rem; gap: 0.35rem; }
    .hero-feature svg { width: 14px; height: 14px; }

    /* Brands: compact (toolbar already compact) */
    .brands-section { padding: 0.6rem 0; }
    .brands-section .container { padding: 0 0.75rem; gap: 0.5rem; }
    .brands-section-header .section-title { font-size: 0.9375rem; }
    .brands-list { min-height: 32px; }
    .brand-item { padding: 0.3rem 0.65rem; font-size: 0.75rem; }
    .search-bar-input { padding: 0.4rem 0.75rem 0.4rem 2.25rem; font-size: 0.8125rem; }
    [dir="rtl"] .search-bar-input { padding: 0.4rem 2.25rem 0.4rem 0.75rem; }

    /* Products section: compact */
    .products-section { padding: 1.25rem 0 2.5rem; }
    .products-section .section-header { margin-bottom: 0.75rem; }
    .products-count { font-size: 0.75rem; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-top: 0.75rem; }

    /* Product card: compact */
    .product-card { border-radius: var(--radius-sm); }
    .product-card-image { aspect-ratio: 1 / 1; min-height: 0; }
    .product-card-body { padding: 0.5rem 0.6rem; gap: 0.25rem; }
    .product-brand { font-size: 0.625rem; }
    .product-name { font-size: 0.75rem; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.2; }
    .product-reference { font-size: 0.625rem; padding: 0.15rem 0.35rem; }
    .product-price { font-size: 0.9375rem; }
    .product-price .currency { font-size: 0.7rem; }
    .product-stock { font-size: 0.625rem; padding: 0.15rem 0.5rem; gap: 0.25rem; }
    .stock-indicator { width: 6px; height: 6px; }
    /* Add to cart: smaller icon-only button on mobile */
    .product-card .btn-add-to-cart {
        padding: 0.25rem 0.35rem;
        min-width: 28px;
        min-height: 28px;
        height: 28px;
        width: 100%;
    }
    .product-card .btn-add-to-cart .btn-text { display: none; }
    .product-card .btn-add-to-cart .btn-icon {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    .product-card .btn-add-to-cart .btn-icon svg {
        width: 14px;
        height: 14px;
    }

    .no-products { padding: 1.5rem 1rem; font-size: 0.875rem; }

    /* Pagination: compact */
    .pagination { margin-top: 1rem; gap: 0.2rem; }
    .page-btn { min-width: 32px; height: 32px; font-size: 0.75rem; }

    /* Cart sidebar: compact */
    .cart-header { padding: 0.75rem 1rem; min-height: 52px; }
    .cart-header h2 { font-size: 1rem; }
    .close-cart-btn { width: 36px; height: 36px; }
    .cart-items { padding: 0.75rem; }
    .cart-item { padding: 0.5rem 0; gap: 0.5rem; }
    .cart-item-info strong { font-size: 0.8125rem; }
    .cart-item-info div { font-size: 0.75rem; }
    .cart-item-controls { gap: 0.25rem; }
    .cart-item-controls .quantity-btn { width: 28px; height: 28px; font-size: 0.875rem; }
    .cart-item-controls .remove-btn { width: 28px; height: 28px; padding: 0; min-width: 28px; }
    .cart-item-controls .remove-btn img { width: 14px; height: 14px; }
    .cart-footer { padding: 0.75rem 1rem; }
    .cart-total { font-size: 0.9375rem; margin-bottom: 0.5rem; }
    .cart .btn-block { padding: 0.5rem 1rem; font-size: 0.8125rem; }

    /* Footer: compact */
    .site-footer { margin-top: 2rem; }
    .footer-inner { padding: 1.25rem 0 1rem; }
    .footer-heading { font-size: 0.7rem; margin-bottom: 0.5rem; }
    .footer-link-list a { font-size: 0.8125rem; }
    .footer-bottom { padding: 0.75rem 0; }
    .footer-copyright { font-size: 0.75rem; }

    /* Checkout: compact */
    .checkout-page { padding: 1rem; }
    .checkout-summary { padding: 1rem; }
    .checkout-summary h2 { font-size: 1rem; margin-bottom: 0.75rem; }
    .checkout-form { padding: 1rem; }
    .checkout-form h2 { font-size: 1rem; margin-bottom: 0.75rem; }
    .form-group { margin-bottom: 0.75rem; }
    .form-group label { font-size: 0.8125rem; }
    .form-group input,
    .form-group select,
    .form-group textarea { padding: 0.5rem 0.75rem; font-size: 0.9375rem; }
    .checkout-total { font-size: 0.9375rem; margin-bottom: 0.5rem; }

    /* Static pages (about, faq, contact, shipping): compact */
    .page-content { padding: 1.25rem 0 2rem; }
    .page-content .page-title { font-size: 1.25rem; }
    .page-content .page-intro { font-size: 0.875rem; margin-bottom: 1rem; }
    .content-block { padding: 0.75rem 1rem; margin-bottom: 0.75rem; }
    .content-block h2 { font-size: 1rem; }
    .content-block p { font-size: 0.875rem; }
    .faq-item { padding: 0.65rem 0; }
    .faq-item h3 { font-size: 0.9375rem; }
    .faq-item p { font-size: 0.8125rem; }
    .contact-info .contact-list li { padding: 0.5rem 0; font-size: 0.875rem; }
    .contact-label { min-width: 6rem; font-size: 0.8125rem; }
}

@media (max-width: 380px) {
    .products-grid { gap: 0.4rem; }
    .product-card-body { padding: 0.4rem 0.5rem; }
    .product-name { font-size: 0.7rem; }
    .product-price { font-size: 0.875rem; }
}