@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400&family=Tajawal:wght@300;400;500;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --brand-green: #1B3022;
    --brand-gold: #C5A021;
    --brand-cream: #F5F1E6;
    --brand-dark: #121417;
    --walnut: var(--brand-green);
    --walnut-light: #2a4a35;
    --walnut-dark: #0f1a14;
    --mahogany: #243d2e;
    --parchment: var(--brand-cream);
    --parchment-dark: #ebe5d6;
    --cream: #faf8f2;
    --linen: #f0ebe0;
    --gold: var(--brand-gold);
    --gold-hover: #a8881a;
    --gold-pale: rgba(197, 160, 33, 0.12);
    --gold-deep: #8a7018;
    --forest: var(--brand-green);
    --forest-light: #2d503c;
    --sage: #6b8f7a;
    --ink: var(--brand-dark);
    --ink-soft: #2a2e32;
    --ink-muted: #5c6369;
    --ink-light: #8a9299;
    --ink-faint: #b8c0c8;
    --glass-bg: rgba(245, 241, 230, 0.14);
    --glass-bg-strong: rgba(245, 241, 230, 0.22);
    --glass-border: rgba(197, 160, 33, 0.28);
    --glass-blur: 18px;
    --danger: #9B3B3B;
    --danger-bg: #FDF0EF;
    --success: #3B7A45;
    --success-bg: #EEF7F0;
    --info-bg: #EEF4FA;
    --font-display-ar: 'Amiri', serif;
    --font-body-ar: 'Tajawal', sans-serif;
    --font-display-en: 'Playfair Display', serif;
    --font-body-en: 'Inter', sans-serif;
    --shadow-sm: 0 1px 3px rgba(62, 39, 35, 0.08), 0 1px 2px rgba(62, 39, 35, 0.06);
    --shadow-md: 0 4px 12px rgba(62, 39, 35, 0.10), 0 2px 4px rgba(62, 39, 35, 0.06);
    --shadow-lg: 0 12px 40px rgba(62, 39, 35, 0.12), 0 4px 12px rgba(62, 39, 35, 0.08);
    --shadow-xl: 0 24px 60px rgba(62, 39, 35, 0.16), 0 8px 20px rgba(62, 39, 35, 0.10);
    --shadow-book: 4px 8px 24px rgba(26, 18, 16, 0.25), 1px 2px 8px rgba(26, 18, 16, 0.15);
    --shadow-gold: 0 4px 20px rgba(197, 150, 58, 0.3);
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;
    --r-xl: 32px;
    --r-full: 9999px;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 0.2s var(--ease);
    --t-normal: 0.35s var(--ease);
    --t-slow: 0.5s var(--ease);
}

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

html {
    scroll-behavior: smooth;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--parchment);
    color: var(--ink);
    font-family: var(--font-body-ar);
    line-height: 1.7;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

body.en-mode {
    font-family: var(--font-body-en);
    direction: ltr;
    text-align: left;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C5963A' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

body > * { position: relative; z-index: 1; }

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

button, input, select, textarea { font-family: inherit; border: none; outline: none; }

button { cursor: pointer; background: none; }

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

input, select, textarea, button {
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display-ar);
    font-weight: 700;
    line-height: 1.3;
    color: var(--walnut);
}

body.en-mode h1, body.en-mode h2, body.en-mode h3,
body.en-mode h4, body.en-mode h5, body.en-mode h6 {
    font-family: var(--font-display-en);
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, rgba(245, 241, 230, 0.88) 0%, rgba(245, 241, 230, 0.75) 100%);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--t-normal);
}

header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px clamp(12px, 3vw, 32px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 12px);
    flex-shrink: 0;
}

.logo-icon {
    width: clamp(36px, 4.5vw, 48px);
    height: clamp(36px, 4.5vw, 48px);
    background: linear-gradient(135deg, var(--walnut) 0%, var(--walnut-light) 100%);
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: clamp(16px, 2vw, 20px);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(197, 160, 33, 0.25);
}

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

.logo-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(197, 150, 58, 0.2) 100%);
}

.logo-text {
    font-family: var(--font-display-en);
    font-size: clamp(18px, 2.8vw, 26px);
    font-weight: 800;
    color: var(--walnut);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.logo-text span {
    color: var(--gold);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-links a {
    font-weight: 500;
    color: var(--ink-muted);
    font-size: clamp(13px, 1.2vw, 15px);
    padding: 8px clamp(10px, 1.2vw, 18px);
    border-radius: var(--r-full);
    position: relative;
    transition: var(--t-normal);
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--walnut);
    background: rgba(197, 150, 58, 0.08);
}

.nav-links a.active {
    color: var(--walnut);
    background: rgba(197, 150, 58, 0.12);
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1vw, 12px);
    flex-shrink: 0;
}

.action-btn {
    position: relative;
    width: clamp(38px, 4vw, 46px);
    height: clamp(38px, 4vw, 46px);
    border-radius: var(--r-full);
    background: var(--cream);
    color: var(--walnut-light);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    font-size: clamp(15px, 1.5vw, 18px);
    border: 1px solid rgba(197, 150, 58, 0.1);
    transition: var(--t-normal);
}

.action-btn:hover {
    background: var(--walnut);
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.action-btn .badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--gold);
    color: var(--walnut-dark);
    font-weight: 800;
    font-size: 10px;
    width: clamp(16px, 2vw, 20px);
    height: clamp(16px, 2vw, 20px);
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--parchment);
    font-family: var(--font-body-en);
}

.lang-switch-btn {
    padding: 6px clamp(10px, 1.5vw, 18px);
    border-radius: var(--r-full);
    background: var(--walnut);
    color: var(--gold);
    font-weight: 700;
    font-size: clamp(11px, 1.1vw, 13px);
    letter-spacing: 1px;
    border: 1px solid rgba(197, 150, 58, 0.3);
    transition: var(--t-normal);
    white-space: nowrap;
}

.lang-switch-btn:hover {
    background: var(--gold);
    color: var(--walnut);
    box-shadow: var(--shadow-gold);
}

.hero {
    background: linear-gradient(140deg, rgba(35, 52, 47, 0.96) 0%, rgba(58, 45, 38, 0.96) 38%, rgba(70, 54, 41, 0.98) 100%);
    color: var(--cream);
    padding: 0;
    position: relative;
    overflow: hidden;
    min-height: clamp(280px, 40vh, 380px);
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    width: min(900px, 100vw);
    height: min(900px, 100vw);
    background: radial-gradient(circle, rgba(197, 150, 58, 0.16) 0%, transparent 58%);
    top: -260px;
    right: -140px;
    animation: gentleGlow 8s ease-in-out infinite alternate;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    width: min(620px, 80vw);
    height: min(620px, 80vw);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 58%);
    bottom: -220px;
    left: -80px;
    animation: gentleGlow 11s ease-in-out 1.8s infinite alternate;
    pointer-events: none;
}

@keyframes gentleGlow {
    0% { opacity: 0.45; transform: scale(1); }
    100% { opacity: 0.95; transform: scale(1.12); }
}

.hero .hero-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.58' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 48px) clamp(16px, 3vw, 32px);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(20px, 3vw, 40px);
    align-items: center;
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-content {
    animation: fadeInUp 0.8s var(--ease) both;
    min-width: 0;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: clamp(6px, 1vw, 8px) clamp(12px, 1.5vw, 18px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--r-full);
    color: var(--gold);
    font-size: clamp(11px, 1.1vw, 13px);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: clamp(16px, 2vw, 24px);
    backdrop-filter: blur(14px);
}

.hero-content h1 {
    font-size: clamp(22px, 4.5vw, 38px);
    font-weight: 900;
    margin-bottom: clamp(10px, 1.5vw, 16px);
    color: var(--cream);
    line-height: 1.12;
    font-family: var(--font-display-ar);
    word-break: break-word;
}

body.en-mode .hero-content h1 {
    font-family: var(--font-display-en);
}

.hero-content h1 span {
    color: var(--gold);
    position: relative;
}

.hero-content h1 span::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(197,150,58,0.45), rgba(197,150,58,0.95));
    opacity: 0.45;
    border-radius: var(--r-full);
}

.hero-content p {
    font-size: clamp(13px, 1.2vw, 15px);
    color: rgba(255, 253, 247, 0.78);
    margin-bottom: clamp(14px, 2vw, 24px);
    max-width: min(480px, 100%);
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: clamp(8px, 1.2vw, 14px);
    flex-wrap: wrap;
}

.hero-buttons .btn {
    font-size: clamp(12px, 1vw, 13px);
    padding: clamp(8px, 1vw, 10px) clamp(14px, 2vw, 22px);
    white-space: nowrap;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    animation: fadeInUp 0.8s var(--ease) 0.2s both;
}

.hero-logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(220px, 50vw);
    height: min(220px, 50vw);
    aspect-ratio: 1;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.hero-logo-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197, 150, 58, 0.35) 0%, rgba(197, 150, 58, 0.08) 40%, transparent 70%);
    animation: logoGlow 4s ease-in-out infinite alternate;
    pointer-events: none;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.hero-logo img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 32px rgba(197, 150, 58, 0.25)) drop-shadow(0 4px 12px rgba(18, 20, 23, 0.15));
    animation: logoFloat 6s ease-in-out infinite;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    image-rendering: auto;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes logoGlow {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.12); }
}

#catalogStatusBanner {
    margin: 0 auto 1.25rem;
    max-width: 720px;
    text-align: center;
}

.book-card-img--no-photo {
    background: linear-gradient(160deg, var(--parchment-dark), var(--linen));
    min-height: 280px;
}

.book-img-broken {
    visibility: hidden;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 0.6vw, 8px);
    padding: clamp(8px, 1vw, 12px) clamp(12px, 2vw, 22px);
    font-weight: 700;
    font-size: clamp(12px, 1vw, 14px);
    border-radius: var(--r-full);
    transition: var(--t-normal);
    position: relative;
    overflow: hidden;
    min-height: clamp(34px, 3.5vw, 42px);
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hover) 100%);
    color: var(--walnut-dark);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold), var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--cream);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--walnut);
    border: 2px solid var(--walnut);
}

.btn-outline:hover {
    background: var(--walnut);
    color: var(--cream);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #fff;
}

.btn-whatsapp:hover { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.35); transform: translateY(-3px); }

.btn-instagram {
    background: linear-gradient(135deg, #E1306C 0%, #C13584 50%, #833AB4 100%);
    color: #fff;
}

.btn-instagram:hover { box-shadow: 0 4px 20px rgba(225, 48, 108, 0.35); transform: translateY(-3px); }

.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 50px) clamp(12px, 3vw, 32px);
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: clamp(16px, 3vw, 32px);
}

.section-header h2 {
    font-size: clamp(20px, 2.8vw, 30px);
    color: var(--walnut);
    margin-bottom: 8px;
}

.section-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.section-ornament::before,
.section-ornament::after {
    content: '';
    width: clamp(24px, 4vw, 40px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.section-ornament i {
    color: var(--gold);
    font-size: 11px;
}

.controls-bar {
    background: var(--cream);
    padding: clamp(10px, 1.5vw, 14px) clamp(12px, 2vw, 20px);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: clamp(16px, 3vw, 32px);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: clamp(6px, 1vw, 12px);
    align-items: center;
    border: 1px solid rgba(197, 150, 58, 0.08);
}

@media (max-width: 600px) {
    .controls-bar {
        grid-template-columns: 1fr 1fr;
    }
    .controls-bar .search-box {
        grid-column: 1 / -1;
    }
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: clamp(10px, 1.2vw, 13px) clamp(36px, 4vw, 48px) clamp(10px, 1.2vw, 13px) clamp(12px, 1.5vw, 18px);
    background: var(--parchment);
    border: 1px solid rgba(197, 150, 58, 0.12);
    border-radius: var(--r-md);
    font-size: clamp(13px, 1.1vw, 15px);
    color: var(--ink);
    transition: var(--t-fast);
}

body.en-mode .search-box input { padding: clamp(10px, 1.2vw, 13px) clamp(12px, 1.5vw, 18px) clamp(10px, 1.2vw, 13px) clamp(36px, 4vw, 48px); }

.search-box input:focus {
    border-color: var(--gold);
    background: var(--cream);
    box-shadow: 0 0 0 3px rgba(197, 150, 58, 0.1);
}

.search-box i {
    position: absolute;
    right: clamp(12px, 1.5vw, 18px);
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-light);
    font-size: clamp(14px, 1.2vw, 16px);
}

body.en-mode .search-box i { right: auto; left: clamp(12px, 1.5vw, 18px); }

.filter-select {
    padding: clamp(10px, 1.2vw, 13px) clamp(12px, 1.2vw, 16px);
    background: var(--parchment);
    border: 1px solid rgba(197, 150, 58, 0.12);
    border-radius: var(--r-md);
    font-size: clamp(13px, 1.1vw, 15px);
    color: var(--ink);
    cursor: pointer;
    width: 100%;
    transition: var(--t-fast);
}

.filter-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(197, 150, 58, 0.1);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
    gap: clamp(14px, 2.5vw, 32px);
    min-height: 200px;
}

.books-grid.is-loading {
    pointer-events: none;
}

.book-card-skeleton {
    background: linear-gradient(180deg, var(--cream) 0%, #f0ebe0 100%);
    border-radius: var(--r-xl);
    overflow: hidden;
    border: 1px solid rgba(197, 150, 58, 0.08);
    animation: book-skeleton-pulse 1.2s ease-in-out infinite;
}

.book-card-skeleton-cover {
    height: clamp(180px, 28vw, 310px);
    background: linear-gradient(110deg, #e8e0d4 25%, #f5f0e6 50%, #e8e0d4 75%);
    background-size: 200% 100%;
    animation: book-skeleton-shimmer 1.4s linear infinite;
}

.book-card-skeleton-body {
    padding: clamp(14px, 1.5vw, 18px) clamp(16px, 1.8vw, 20px) clamp(18px, 2vw, 22px);
    display: grid;
    gap: 10px;
}

.book-card-skeleton-line {
    height: 12px;
    border-radius: var(--r-full);
    background: linear-gradient(110deg, #e0d8cc 25%, #f0ebe0 50%, #e0d8cc 75%);
    background-size: 200% 100%;
    animation: book-skeleton-shimmer 1.4s linear infinite;
}

.book-card-skeleton-line.short { width: 45%; }
.book-card-skeleton-line.medium { width: 70%; }

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

@keyframes book-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.92; }
}

.books-grid-fade-in {
    animation: books-grid-in 0.35s ease-out;
}

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

.book-card {
    background: linear-gradient(180deg, var(--cream) 0%, #f8f0e4 100%);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(197, 150, 58, 0.10);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--t-normal);
    transform-style: preserve-3d;
    height: 100%;
}

.book-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top right, rgba(197, 150, 58, 0.14), transparent 35%);
    opacity: 0.8;
}

.book-card:hover {
    transform: translateY(-14px) rotateX(0.75deg) rotateY(0.75deg);
    box-shadow: 0 28px 70px rgba(62, 39, 35, 0.16);
}

.book-card-img {
    height: clamp(140px, 22vw, 230px);
    background: linear-gradient(145deg, #E8DFD0 0%, #D9CDB9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 -6px 16px rgba(62, 39, 35, 0.08);
}

.book-card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(62, 39, 35, 0.12), transparent);
    border-radius: var(--r-full);
}

.book-card-img img {
    height: 82%;
    width: auto;
    max-width: 65%;
    object-fit: contain;
    filter: drop-shadow(4px 8px 16px rgba(26, 18, 16, 0.3));
    transition: var(--t-slow);
}

.book-card:hover .book-card-img img {
    transform: scale(1.06) translateY(-4px);
    filter: drop-shadow(6px 12px 24px rgba(26, 18, 16, 0.35));
}

.wishlist-btn {
    position: absolute;
    top: clamp(10px, 1.2vw, 14px);
    right: clamp(10px, 1.2vw, 14px);
    width: clamp(32px, 3.5vw, 38px);
    height: clamp(32px, 3.5vw, 38px);
    border-radius: var(--r-full);
    background: rgba(255, 253, 247, 0.92);
    backdrop-filter: blur(8px);
    color: var(--ink-light);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    z-index: 5;
    transition: var(--t-normal);
    font-size: clamp(13px, 1.2vw, 15px);
}

body.en-mode .wishlist-btn { right: auto; left: clamp(10px, 1.2vw, 14px); }

.wishlist-btn:hover {
    background: var(--cream);
    color: var(--danger);
    transform: scale(1.15);
}

.wishlist-btn.active { color: var(--danger); }
.wishlist-btn.active i { animation: heartBeat 0.4s var(--ease-bounce); }

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.book-badge {
    position: absolute;
    top: clamp(180px, 18vw, 200px);
    left: clamp(8px, 1vw, 12px);
    padding: 3px clamp(6px, 0.8vw, 10px);
    font-size: clamp(9px, 0.8vw, 10px);
    font-weight: 800;
    border-radius: var(--r-full);
    z-index: 5;
    letter-spacing: 0.3px;
    backdrop-filter: blur(8px);
}

body.en-mode .book-badge { left: auto; right: clamp(10px, 1.2vw, 14px); }

.book-badge.badge-ar {
    background: rgba(44, 74, 62, 0.9);
    color: var(--cream);
}

.book-badge.badge-en {
    background: rgba(197, 150, 58, 0.9);
    color: var(--walnut-dark);
}

.book-badge.badge-out-of-stock {
    background: rgba(155, 59, 59, 0.85);
    color: #fff;
}

.book-card-info {
    padding: clamp(10px, 1.2vw, 16px) clamp(10px, 1.2vw, 16px) clamp(12px, 1.5vw, 18px);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-card-category {
    font-size: clamp(10px, 0.9vw, 11px);
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 800;
    margin-bottom: clamp(4px, 0.6vw, 8px);
    letter-spacing: 1.5px;
}

.book-card-title {
    font-size: clamp(12px, 1.2vw, 15px);
    font-weight: 700;
    color: var(--walnut);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: clamp(30px, 3.5vw, 40px);
    font-family: var(--font-display-ar);
}

body.en-mode .book-card-title { font-family: var(--font-display-en); }

.book-card-author {
    font-size: clamp(11px, 0.9vw, 12px);
    color: var(--ink-muted);
    margin-bottom: clamp(6px, 0.8vw, 10px);
}

.book-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: clamp(6px, 0.8vw, 10px);
    border-top: 1px solid rgba(197, 150, 58, 0.1);
}

.book-card-price {
    font-size: clamp(14px, 1.3vw, 17px);
    font-weight: 800;
    color: var(--walnut);
    font-family: var(--font-display-en);
}

.book-card-price span {
    font-size: clamp(9px, 0.8vw, 11px);
    font-weight: 600;
    color: var(--ink-muted);
    margin-right: 3px;
    font-family: var(--font-body-ar);
}

.discount-badge {
    position: absolute;
    top: 14px;
    left: -30px;
    z-index: 10;
    width: 130px;
    padding: 4px 0;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--danger), #c0392b);
    text-align: center;
    transform: rotate(-45deg);
    letter-spacing: 0.5px;
    box-shadow: 0 3px 12px rgba(155,59,59,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
}

body.en-mode .discount-badge {
    left: auto;
    right: -30px;
    transform: rotate(45deg);
}

.add-cart-btn {
    width: clamp(32px, 3vw, 38px);
    height: clamp(32px, 3vw, 38px);
    border-radius: var(--r-md);
    background: var(--walnut);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(12px, 1.1vw, 14px);
    transition: var(--t-normal);
    box-shadow: var(--shadow-sm);
}

.add-cart-btn:hover {
    background: var(--gold);
    color: var(--walnut-dark);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-gold);
}

.details-discount-tag {
    display: inline-block; padding: 3px 12px;
    background: var(--danger); color: #fff;
    font-size: 13px; font-weight: 800;
    border-radius: var(--r-full); margin-right: 8px; vertical-align: middle;
}

.details-container {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: clamp(20px, 3vw, 36px);
    background: var(--cream);
    padding: clamp(14px, 3vw, 32px);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(197, 150, 58, 0.08);
    margin-bottom: 40px;
}

.details-gallery {
    background: linear-gradient(145deg, #E8DFD0 0%, #D9CDB9 100%);
    border-radius: var(--r-lg);
    padding: clamp(20px, 3vw, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: clamp(280px, 40vw, 450px);
}

.details-gallery::after {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 20%;
    right: 20%;
    height: 6px;
    background: linear-gradient(90deg, transparent, rgba(62, 39, 35, 0.1), transparent);
    border-radius: var(--r-full);
}

.details-gallery img {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    filter: drop-shadow(6px 12px 30px rgba(26, 18, 16, 0.3));
    border-radius: 2px;
}

.details-info { display: flex; flex-direction: column; }

.details-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.details-lang-tag {
    padding: 5px 14px;
    background: rgba(44, 74, 62, 0.08);
    color: var(--forest);
    font-weight: 700;
    font-size: clamp(12px, 1vw, 13px);
    border-radius: var(--r-full);
    border: 1px solid rgba(44, 74, 62, 0.12);
}

.details-category-tag {
    color: var(--gold);
    font-weight: 800;
    font-size: clamp(12px, 1vw, 13px);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.details-title {
    font-size: clamp(20px, 2.5vw, 30px);
    color: var(--walnut);
    margin-bottom: 6px;
    font-weight: 800;
    word-break: break-word;
}

.details-author {
    font-size: clamp(15px, 1.3vw, 17px);
    color: var(--ink-muted);
    margin-bottom: 24px;
}

.details-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--gold), rgba(197, 150, 58, 0.2), transparent);
    margin-bottom: 24px;
}

body.en-mode .details-divider {
    background: linear-gradient(90deg, transparent, rgba(197, 150, 58, 0.2), var(--gold));
}

.details-price {
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 800;
    color: var(--walnut);
    margin-bottom: 24px;
    font-family: var(--font-display-en);
}

.details-price span {
    font-size: clamp(14px, 1.2vw, 16px);
    font-weight: 600;
    color: var(--ink-muted);
    font-family: var(--font-body-ar);
}

.details-desc-title {
    font-size: clamp(16px, 1.4vw, 18px);
    font-weight: 700;
    color: var(--walnut-light);
    margin-bottom: 10px;
}

.details-desc {
    color: var(--ink-soft);
    font-size: clamp(14px, 1.1vw, 15px);
    line-height: 1.85;
    margin-bottom: 28px;
}

.details-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
    background: var(--parchment);
    padding: clamp(16px, 2vw, 20px) clamp(18px, 2vw, 24px);
    border-radius: var(--r-md);
    border: 1px solid rgba(197, 150, 58, 0.08);
}

@media (max-width: 480px) {
    .details-specs {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.spec-item { display: flex; flex-direction: column; gap: 4px; }
.spec-label { font-size: 12px; color: var(--ink-light); text-transform: uppercase; letter-spacing: 0.5px; }
.spec-val { font-size: clamp(14px, 1.1vw, 15px); font-weight: 700; color: var(--walnut); }

.details-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.quantity-picker {
    display: flex;
    align-items: center;
    border: 1px solid rgba(197, 150, 58, 0.2);
    border-radius: var(--r-md);
    overflow: hidden;
    height: clamp(36px, 3.5vw, 42px);
    background: var(--cream);
}

.qty-btn {
    width: clamp(32px, 3vw, 40px);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--parchment);
    font-weight: 700;
    font-size: clamp(14px, 1.2vw, 16px);
    color: var(--walnut);
    transition: var(--t-fast);
}

.qty-input {
    width: 40px;
    text-align: center;
    font-weight: 700;
    font-size: clamp(13px, 1.1vw, 14px);
    color: var(--walnut);
    border-left: 1px solid rgba(197, 150, 58, 0.15);
    border-right: 1px solid rgba(197, 150, 58, 0.15);
    background: transparent;
}

.details-buy-btn {
    flex-grow: 1;
    height: clamp(36px, 3.5vw, 42px);
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--walnut) 0%, var(--walnut-light) 100%);
    color: var(--gold);
    font-weight: 700;
    font-size: clamp(13px, 1.1vw, 14px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--t-normal);
    box-shadow: var(--shadow-sm);
}

.details-buy-btn:hover {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hover) 100%);
    color: var(--walnut-dark);
    box-shadow: var(--shadow-gold);
    transform: translateY(-2px);
}

.details-wishlist-btn {
    width: clamp(44px, 4.5vw, 52px);
    height: clamp(44px, 4.5vw, 52px);
    border-radius: var(--r-md);
    border: 1px solid rgba(197, 150, 58, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(18px, 1.6vw, 20px);
    color: var(--ink-muted);
    transition: var(--t-normal);
}

.details-wishlist-btn:hover, .details-wishlist-btn.active {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(155, 59, 59, 0.3);
}

.drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(420px, 100%);
    height: 100dvh;
    background: var(--cream);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    transition: all 0.45s var(--ease);
    display: flex;
    flex-direction: column;
}

body:not(.en-mode) .drawer { left: auto; right: -100%; }
.drawer.open { left: 0; }
body:not(.en-mode) .drawer.open { left: auto; right: 0; }

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 18, 16, 0.55);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--t-normal);
    backdrop-filter: blur(6px);
}

.drawer-overlay.open { opacity: 1; visibility: visible; }

.drawer-header {
    padding: clamp(12px, 1.5vw, 18px) clamp(14px, 2vw, 22px);
    border-bottom: 1px solid rgba(197, 150, 58, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--parchment);
}

.drawer-header h3 {
    font-size: clamp(16px, 1.3vw, 18px);
    color: var(--walnut);
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-close {
    width: 38px; height: 38px;
    border-radius: var(--r-full);
    background: var(--cream);
    color: var(--ink-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: var(--t-fast);
    border: 1px solid rgba(197, 150, 58, 0.1);
}

.drawer-close:hover { background: var(--danger-bg); color: var(--danger); border-color: rgba(155, 59, 59, 0.2); }

.drawer-body { flex-grow: 1; overflow-y: auto; padding: clamp(16px, 2vw, 24px) clamp(18px, 2.5vw, 28px); }

.drawer-item {
    display: flex;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(197, 150, 58, 0.06);
    position: relative;
}

.drawer-item-img {
    width: 50px; height: 68px;
    background: var(--parchment-dark);
    border-radius: var(--r-sm);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.drawer-item-img img { height: 85%; width: auto; object-fit: contain; }

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

.drawer-item-title {
    font-size: clamp(14px, 1.1vw, 15px); font-weight: 700;
    color: var(--walnut);
    margin-bottom: 3px; line-height: 1.3;
}

.drawer-item-author { font-size: clamp(11px, 0.9vw, 12px); color: var(--ink-light); margin-bottom: 6px; }

.drawer-item-price { font-size: clamp(14px, 1.1vw, 15px); font-weight: 800; color: var(--walnut-light); font-family: var(--font-display-en); }

.drawer-item-remove {
    position: absolute; top: 0; left: 0;
    color: var(--ink-faint); font-size: 13px;
    transition: var(--t-fast);
}

body.en-mode .drawer-item-remove { left: auto; right: 0; }
.drawer-item-remove:hover { color: var(--danger); }

.drawer-footer {
    padding: clamp(16px, 2vw, 24px) clamp(18px, 2.5vw, 28px);
    border-top: 1px solid rgba(197, 150, 58, 0.1);
    background: var(--parchment);
}

.drawer-summary-row {
    display: flex; justify-content: space-between;
    margin-bottom: 16px; font-size: clamp(14px, 1.2vw, 16px);
}

.drawer-summary-total { font-weight: 800; color: var(--walnut); font-size: clamp(18px, 1.6vw, 20px); font-family: var(--font-display-en); }

.drawer-btn {
    width: 100%; height: clamp(46px, 4.5vw, 52px);
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: clamp(14px, 1.3vw, 16px); gap: 10px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: clamp(20px, 3vw, 40px);
    align-items: start;
}

.checkout-card {
    background: var(--cream);
    border-radius: var(--r-lg);
    padding: clamp(14px, 2vw, 24px);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(197, 150, 58, 0.06);
}

.checkout-card h3 {
    font-size: clamp(16px, 1.4vw, 20px);
    color: var(--walnut);
    margin-bottom: clamp(14px, 2vw, 20px);
    padding-bottom: clamp(8px, 1vw, 10px);
    border-bottom: 1px solid rgba(197, 150, 58, 0.1);
}

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

.form-group label {
    display: block;
    font-size: 14px; font-weight: 700;
    color: var(--walnut-light);
    margin-bottom: 8px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: clamp(11px, 1.2vw, 13px) clamp(14px, 1.5vw, 18px);
    background: var(--parchment);
    border: 1px solid rgba(197, 150, 58, 0.12);
    border-radius: var(--r-md);
    font-size: clamp(14px, 1.1vw, 15px);
    color: var(--ink);
    transition: var(--t-fast);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--gold);
    background: var(--cream);
    box-shadow: 0 0 0 3px rgba(197, 150, 58, 0.1);
}

.checkout-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(197, 150, 58, 0.06);
    font-size: clamp(14px, 1.1vw, 15px);
}

.checkout-summary-total {
    font-size: clamp(18px, 1.6vw, 20px); font-weight: 800; color: var(--walnut);
    border-bottom: none; margin-top: 12px;
    background: var(--gold-pale);
    padding: 18px;
    border-radius: var(--r-md);
    border: 1px solid rgba(197, 150, 58, 0.15);
}

.payment-method-box {
    background: var(--gold-pale);
    border: 1px solid rgba(197, 150, 58, 0.25);
    padding: clamp(14px, 1.5vw, 18px);
    border-radius: var(--r-md);
    margin: 24px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    color: var(--walnut);
}

.payment-method-box i { font-size: clamp(22px, 2vw, 26px); color: var(--gold); }

.order-success-box {
    max-width: 580px;
    margin: 50px auto;
    text-align: center;
    background: var(--cream);
    padding: clamp(36px, 5vw, 60px) clamp(20px, 4vw, 48px);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(197, 150, 58, 0.08);
}

.success-icon {
    width: clamp(70px, 8vw, 90px); height: clamp(70px, 8vw, 90px);
    background: var(--success-bg);
    color: var(--success);
    border-radius: var(--r-full);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: clamp(32px, 4vw, 42px); margin-bottom: 28px;
    box-shadow: 0 0 0 12px rgba(59, 122, 69, 0.08);
}

.order-success-box h2 { font-size: clamp(22px, 2.8vw, 30px); color: var(--walnut); margin-bottom: 14px; }
.order-success-box p { color: var(--ink-muted); margin-bottom: 32px; line-height: 1.8; }

.admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 200px);
    gap: 0;
}

.admin-sidebar {
    background: linear-gradient(180deg, var(--walnut-dark) 0%, var(--walnut) 100%);
    color: var(--cream);
    padding: clamp(20px, 3vw, 32px) clamp(16px, 2vw, 20px);
    border-radius: 0 var(--r-xl) var(--r-xl) 0;
    position: relative;
    overflow: hidden;
}

body.en-mode .admin-sidebar { border-radius: var(--r-xl) 0 0 var(--r-xl); }

.admin-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
    pointer-events: none;
}

.admin-sidebar > * { position: relative; z-index: 1; }

.admin-sidebar-title {
    font-size: clamp(16px, 1.4vw, 18px); margin-bottom: 36px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(197, 150, 58, 0.15);
    color: var(--gold);
    text-align: center;
    font-family: var(--font-display-en);
    letter-spacing: 1px;
}

.admin-nav { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.admin-nav-item button {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--r-md);
    color: rgba(255, 253, 247, 0.7);
    font-weight: 600;
    text-align: right;
    display: flex; align-items: center;
    gap: 12px; font-size: clamp(14px, 1.1vw, 15px);
    transition: var(--t-fast);
}

body.en-mode .admin-nav-item button { text-align: left; }

.admin-nav-item button:hover { background: rgba(255, 255, 255, 0.06); color: var(--cream); }

.admin-nav-item.active button {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hover) 100%);
    color: var(--walnut-dark);
    font-weight: 700;
    box-shadow: var(--shadow-gold);
}

.admin-content-pane {
    padding: clamp(20px, 3vw, 40px);
    background: var(--parchment);
}

.admin-login-container {
    max-width: 460px;
    margin: 80px auto;
    background: var(--cream);
    padding: clamp(28px, 4vw, 48px);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(197, 150, 58, 0.08);
}

.admin-login-container h2 {
    font-size: clamp(24px, 2.5vw, 28px);
    color: var(--walnut);
    margin-bottom: 8px;
    text-align: center;
}

.admin-actions-bar {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 32px;
}

.admin-table-container {
    background: var(--cream);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(197, 150, 58, 0.06);
}

.admin-table {
    width: 100%; border-collapse: collapse; font-size: 14px;
}

.admin-table th {
    background: var(--walnut);
    color: var(--gold-pale);
    text-align: right;
    padding: clamp(12px, 1.5vw, 16px) clamp(14px, 1.8vw, 20px);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.en-mode .admin-table th { text-align: left; }

.admin-table td {
    padding: clamp(12px, 1.5vw, 16px) clamp(14px, 1.8vw, 20px);
    border-bottom: 1px solid rgba(197, 150, 58, 0.06);
    color: var(--ink-soft);
}

.admin-table tr { transition: var(--t-fast); }
.admin-table tr:hover { background: var(--parchment); }

.admin-table-img {
    width: 44px; height: 60px;
    object-fit: contain;
    background: var(--parchment-dark);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
}

.status-badge {
    padding: 5px 14px;
    border-radius: var(--r-full);
    font-size: 12px; font-weight: 700;
    display: inline-block;
    letter-spacing: 0.3px;
}

.status-badge.status-pending { background: #FFF3CD; color: #856404; }
.status-badge.status-processing { background: var(--info-bg); color: #004085; }
.status-badge.status-completed { background: var(--success-bg); color: var(--success); }
.status-badge.status-cancelled { background: var(--danger-bg); color: var(--danger); }

.modal {
    position: fixed; inset: 0;
    background: rgba(26, 18, 16, 0.5);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: var(--t-normal);
}

.modal.open { opacity: 1; visibility: visible; }

.modal-content {
    background: var(--cream);
    border-radius: var(--r-xl);
    width: 90%; max-width: 650px;
    max-height: 90dvh; overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: translateY(24px) scale(0.97);
    transition: var(--t-normal);
    border: 1px solid rgba(197, 150, 58, 0.08);
}

.modal.open .modal-content { transform: translateY(0) scale(1); }

.modal-header {
    padding: 22px 28px;
    border-bottom: 1px solid rgba(197, 150, 58, 0.1);
    display: flex; justify-content: space-between; align-items: center;
}

.modal-header h3 { font-size: 20px; color: var(--walnut); }
.modal-body { padding: 28px; }

.modal-footer {
    padding: 18px 28px;
    border-top: 1px solid rgba(197, 150, 58, 0.1);
    display: flex; justify-content: flex-end; gap: 12px;
    background: var(--parchment);
    border-radius: 0 0 var(--r-xl) var(--r-xl);
}

.image-upload-wrapper {
    border: 2px dashed rgba(197, 150, 58, 0.25);
    background: var(--parchment);
    border-radius: var(--r-md);
    padding: clamp(20px, 3vw, 36px);
    text-align: center;
    cursor: pointer;
    transition: var(--t-normal);
    position: relative;
}

.image-upload-wrapper:hover {
    border-color: var(--gold);
    background: var(--gold-pale);
}

.image-upload-wrapper i { font-size: clamp(32px, 4vw, 44px); color: var(--gold); margin-bottom: 14px; }
.image-upload-wrapper p { font-size: 14px; color: var(--ink-muted); }

.image-preview {
    max-width: 120px; max-height: 160px;
    object-fit: contain; margin-top: 16px;
    display: none;
    box-shadow: var(--shadow-book);
    border-radius: 2px;
}

footer {
    background: linear-gradient(180deg, var(--walnut-dark) 0%, #1A1210 100%);
    color: var(--cream);
    padding: clamp(28px, 4vw, 48px) 0 clamp(12px, 1.5vw, 16px) 0;
    margin-top: auto;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 32px);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: clamp(24px, 4vw, 48px);
}

.footer-col h3 {
    font-size: clamp(16px, 1.5vw, 20px);
    margin-bottom: clamp(10px, 1.2vw, 14px);
    color: var(--gold);
    font-family: var(--font-display-en);
}

.footer-col p {
    color: rgba(255, 253, 247, 0.6);
    margin-bottom: 16px;
    font-size: clamp(12px, 0.9vw, 13px);
    line-height: 1.7;
}

.social-links { display: flex; gap: 10px; }

.social-icon {
    width: clamp(36px, 3.5vw, 42px); height: clamp(36px, 3.5vw, 42px);
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--cream);
    display: flex; align-items: center; justify-content: center;
    font-size: clamp(15px, 1.4vw, 17px);
    transition: var(--t-normal);
}

.social-icon:hover {
    background: var(--gold);
    color: var(--walnut-dark);
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}

.footer-col h4 {
    font-size: clamp(14px, 1.3vw, 16px);
    margin-bottom: clamp(14px, 1.8vw, 20px);
    color: var(--cream);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-body-ar);
    font-weight: 700;
}

.footer-links {
    list-style: none;
    display: flex; flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: rgba(255, 253, 247, 0.6);
    font-size: clamp(13px, 1vw, 14px);
    transition: var(--t-fast);
}

.footer-links a:hover {
    color: var(--gold);
    padding-right: 6px;
}

body.en-mode .footer-links a:hover { padding-right: 0; padding-left: 6px; }

.footer-contact { display: flex; flex-direction: column; gap: clamp(12px, 1.2vw, 16px); }

.contact-item {
    display: flex; align-items: center; gap: 12px;
    color: rgba(255, 253, 247, 0.6);
    font-size: clamp(13px, 1vw, 14px);
}

.contact-item i { color: var(--gold); font-size: clamp(14px, 1.2vw, 15px); width: 20px; text-align: center; 
 flex-shrink: 0; }

.footer-bottom {
    max-width: 1280px;
    margin: clamp(24px, 4vw, 48px) auto 0;
    padding: clamp(14px, 1.8vw, 20px) clamp(16px, 3vw, 32px) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex; justify-content: space-between; align-items: center;
    color: rgba(255, 253, 247, 0.4);
    font-size: clamp(12px, 1vw, 13px);
}

.hamburger-btn {
    display: none;
    width: clamp(40px, 4vw, 44px);
    height: clamp(40px, 4vw, 44px);
    border-radius: var(--r-full);
    background: var(--cream);
    color: var(--walnut-light);
    align-items: center;
    justify-content: center;
    font-size: clamp(18px, 1.8vw, 20px);
    border: 1px solid rgba(197, 150, 58, 0.1);
    cursor: pointer;
    transition: var(--t-normal);
    box-shadow: var(--shadow-sm);
}

.hamburger-btn:hover {
    background: var(--walnut);
    color: var(--gold);
}

@media (max-width: 1024px) {
    .hero-container { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .hero-content p { margin-left: auto; margin-right: auto; }
    .hero-buttons { justify-content: center; }
    .hero-visual { order: -1; }
    .hero-logo { width: min(200px, 45vw); height: min(200px, 45vw); }
    .details-container { grid-template-columns: 1fr; }
    .checkout-grid { grid-template-columns: 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { border-radius: 0; }
    .footer-container { grid-template-columns: 1fr 1fr; }
    .controls-bar { grid-template-columns: 1fr 1fr; }
    .controls-bar .search-box { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
    .header-container { padding: 12px clamp(10px, 2vw, 16px); }
    .nav-links { display: none; }
    .hamburger-btn { display: flex; }
    .hero-content h1 { font-size: clamp(22px, 4.5vw, 30px); }
    body.en-mode .hero-content h1 { font-size: clamp(20px, 4.5vw, 28px); }
    .hero-logo { width: min(200px, 50vw); height: min(200px, 50vw); }
    .controls-bar { grid-template-columns: 1fr; }
    .books-grid { grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); gap: clamp(12px, 2vw, 18px); }
    .book-card-img { height: clamp(160px, 28vw, 220px); }
    .main-content { padding: clamp(24px, 5vw, 40px) clamp(10px, 2vw, 16px); }
    .section-header h2 { font-size: clamp(22px, 3.5vw, 28px); }
    .footer-container { grid-template-columns: 1fr; gap: clamp(20px, 4vw, 32px); }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    .drawer { width: 100%; left: -110%; }
    body:not(.en-mode) .drawer { right: -110%; }
    .form-row { grid-template-columns: 1fr; }
    .details-container { padding: clamp(14px, 3vw, 24px); }
    .checkout-card { padding: clamp(16px, 3vw, 24px); }
    .hero-logo { width: min(140px, 36vw); height: min(140px, 36vw); }
    .nav-links {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--cream);
        border-bottom: 1px solid var(--glass-border);
        box-shadow: var(--shadow-md);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
        z-index: 99;
        backdrop-filter: blur(18px);
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links a {
        padding: 14px 18px;
        border-radius: var(--r-md);
        font-size: 16px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: clamp(18px, 6vw, 24px);
    }
    body.en-mode .hero-content h1 {
        font-size: clamp(17px, 6vw, 22px);
    }
    .hero-container {
        padding: clamp(20px, 8vw, 36px) clamp(8px, 2vw, 12px);
    }
    .hero-logo {
        width: min(110px, 45vw);
        height: min(110px, 45vw);
    }
    .hero-subtitle {
        font-size: 11px;
        padding: 6px 14px;
    }
    .hero-content p {
        font-size: 14px;
    }
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        white-space: normal;
    }
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
        gap: 10px;
    }
    .book-card-img {
        height: clamp(140px, 40vw, 190px);
    }
    .book-card-info {
        padding: 10px 10px 14px;
    }
    .book-card-title {
        font-size: 13px;
        min-height: 36px;
    }
    .book-card-price {
        font-size: 15px;
    }
    .section-header h2 {
        font-size: 18px;
    }
    .main-content {
        padding: 16px 6px;
    }
    .controls-bar {
        padding: 10px 12px;
    }
    .details-container {
        padding: 12px;
        gap: 20px;
    }
    .details-title {
        font-size: 22px;
    }
    .details-price {
        font-size: 24px;
    }
    .details-gallery {
        min-height: 240px;
        padding: 16px;
    }
    .details-specs {
        grid-template-columns: 1fr;
    }
    .checkout-card {
        padding: 14px;
    }
    .footer-container {
        padding: 0 clamp(8px, 2vw, 16px);
    }
    .footer-bottom {
        padding: 12px clamp(8px, 2vw, 16px) 0;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .logo-text {
        font-size: 20px;
    }
    .logo-icon {
        width: 34px;
        height: 34px;
    }
    .action-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    .lang-switch-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    .order-success-box {
        padding: 28px 16px;
    }
    .legal-content {
        padding: 20px 16px;
    }
    .header-container {
        padding: 8px 10px;
    }
}

@media (max-width: 380px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .book-card-img {
        height: clamp(120px, 35vw, 160px);
    }
    .book-card-title {
        font-size: 12px;
        min-height: 32px;
    }
    .book-card-price {
        font-size: 14px;
    }
    .book-card-info {
        padding: 8px 8px 10px;
    }
    .add-cart-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .wishlist-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
        top: 6px;
        right: 6px;
    }
    .logo-text {
        font-size: 18px;
    }
    .hero-content h1 {
        font-size: 20px;
    }
    .section-header h2 {
        font-size: 18px;
    }
    .hero-logo {
        width: min(120px, 50vw);
        height: min(120px, 50vw);
    }
}

@media (max-width: 320px) {
    .books-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .book-card-img {
        height: 110px;
    }
    .book-card-title {
        font-size: 11px;
        min-height: 28px;
    }
    .book-card-info {
        padding: 6px 6px 8px;
    }
    .book-card-category {
        font-size: 9px;
    }
    .book-card-author {
        font-size: 10px;
    }
    .book-card-price {
        font-size: 12px;
    }
    .add-cart-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    .wishlist-btn {
        width: 26px;
        height: 26px;
        font-size: 10px;
        top: 4px;
        right: 4px;
    }
    .logo-text {
        font-size: 16px;
    }
    .logo-icon {
        width: 30px;
        height: 30px;
    }
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .lang-switch-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    .hero-content h1 {
        font-size: 18px;
    }
    .hero-subtitle {
        font-size: 10px;
        padding: 4px 10px;
    }
    .section-header h2 {
        font-size: 16px;
    }
    .hero-logo {
        width: min(100px, 45vw);
        height: min(100px, 45vw);
    }
    .discount-badge {
        width: 100px;
        font-size: 9px;
        padding: 3px 0;
        top: 10px;
        left: -24px;
    }
    body.en-mode .discount-badge {
        right: -24px;
    }
}

@media (max-width: 240px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
    .book-card-img {
        height: 180px;
    }
    .logo-text {
        font-size: 14px;
    }
    .logo-icon {
        width: 26px;
        height: 26px;
    }
    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
    .lang-switch-btn {
        padding: 2px 6px;
        font-size: 9px;
    }
    .hamburger-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .hero-content h1 {
        font-size: 16px;
    }
    .hero-logo {
        width: 80px;
        height: 80px;
    }
    .nav-links a {
        font-size: 14px;
        padding: 10px 14px;
    }
    .discount-badge {
        width: 80px;
        font-size: 8px;
        left: -18px;
        top: 8px;
    }
    body.en-mode .discount-badge {
        right: -18px;
    }
}

@media (min-width: 1400px) {
    .hero-logo {
        width: 280px;
        height: 280px;
    }
    .hero-content h1 {
        font-size: clamp(40px, 3.5vw, 48px);
    }
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (min-width: 2000px) {
    .header-container,
    .hero-container,
    .main-content,
    .footer-container,
    .footer-bottom {
        max-width: 1600px;
    }
    .hero-content h1 {
        font-size: clamp(44px, 2.8vw, 56px);
    }
    .hero-logo {
        width: 340px;
        height: 340px;
    }
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--parchment); }
::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

::selection { background: var(--gold); color: var(--walnut-dark); }

.uiglass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(18, 20, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.uiglass-strong {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
}

body.auth-body {
    background: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(197, 160, 33, 0.18), transparent 55%),
                radial-gradient(ellipse 80% 60% at 100% 100%, rgba(27, 48, 34, 0.45), transparent 50%),
                linear-gradient(165deg, var(--brand-dark) 0%, #1a2520 45%, var(--brand-green) 100%);
    min-height: 100vh;
}

body.auth-body::before {
    opacity: 0.35;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 32px) clamp(12px, 3vw, 20px);
    position: relative;
}

.auth-page::before,
.auth-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.auth-page::before {
    width: 280px;
    height: 280px;
    top: 12%;
    right: 8%;
    background: rgba(197, 160, 33, 0.15);
}

.auth-page::after {
    width: 220px;
    height: 220px;
    bottom: 10%;
    left: 6%;
    background: rgba(27, 48, 34, 0.35);
}

.auth-shell {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}

.auth-brand img {
    width: clamp(72px, 8vw, 96px);
    height: clamp(72px, 8vw, 96px);
    border-radius: 50%;
    margin: 0 auto 14px;
    object-fit: cover;
    border: 2px solid var(--glass-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.auth-brand h1 {
    font-size: clamp(1.4rem, 2.5vw, 1.75rem);
    color: var(--brand-cream);
    margin-bottom: 6px;
}

.auth-brand p {
    color: rgba(245, 241, 230, 0.65);
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
}

.auth-card {
    width: 100%;
    border-radius: var(--r-xl);
    padding: clamp(22px, 3vw, 32px) clamp(22px, 3vw, 36px);
}

.auth-card h2 {
    margin-bottom: 20px;
    font-size: clamp(1.15rem, 1.8vw, 1.35rem);
    color: var(--brand-cream);
    text-align: center;
}

.auth-card form { display: grid; gap: 14px; }

.auth-card label {
    font-weight: 700;
    color: rgba(245, 241, 230, 0.75);
    font-size: 13px;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card textarea {
    width: 100%;
    padding: clamp(11px, 1.2vw, 13px) clamp(14px, 1.5vw, 16px);
    border-radius: var(--r-md);
    background: rgba(18, 20, 23, 0.35);
    border: 1px solid rgba(197, 160, 33, 0.2);
    font-size: clamp(14px, 1.1vw, 15px);
    color: var(--brand-cream);
    transition: var(--t-fast);
}

.auth-card input::placeholder {
    color: rgba(245, 241, 230, 0.4);
}

.auth-card input:focus,
.auth-card textarea:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(197, 160, 33, 0.2);
    background: rgba(18, 20, 23, 0.5);
}

.auth-actions {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-wrap: wrap;
    margin-top: 8px;
}

.auth-actions .btn { flex: 1; min-width: 120px; justify-content: center; }

.auth-note {
    margin-top: 16px;
    color: rgba(245, 241, 230, 0.6);
    font-size: 13px;
    text-align: center;
}

.auth-note a {
    color: var(--brand-gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-note a:hover { color: #e0c04a; }

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: rgba(245, 241, 230, 0.7);
    font-size: 14px;
}

.auth-back:hover { color: var(--brand-gold); }

.auth-message {
    padding: 12px 14px;
    border-radius: var(--r-md);
    font-size: 14px;
    text-align: center;
    margin-bottom: 4px;
}

.auth-message--error {
    background: rgba(155, 59, 59, 0.25);
    border: 1px solid rgba(220, 100, 100, 0.35);
    color: #ffc9c9;
}

.auth-message--success {
    background: rgba(59, 122, 69, 0.25);
    border: 1px solid rgba(100, 200, 120, 0.35);
    color: #c8f5d0;
}

.auth-body .btn-primary {
    background: linear-gradient(135deg, var(--brand-gold) 0%, var(--gold-hover) 100%);
    color: var(--brand-dark);
    font-weight: 700;
    border: none;
}

.auth-body .btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: var(--shadow-gold);
}

.auth-body .btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--brand-cream);
}

.auth-body .btn-outline:hover {
    background: var(--glass-bg);
    border-color: var(--brand-gold);
    color: var(--brand-gold);
}

.nav-logout-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: clamp(6px, 1vw, 8px) clamp(10px, 1.2vw, 14px);
    font-size: clamp(12px, 1vw, 14px);
    font-weight: 600;
    color: var(--walnut);
    border-radius: var(--r-full);
    border: 1px solid rgba(197, 160, 33, 0.25);
}

.nav-logout-link:hover {
    background: var(--gold-pale);
    color: var(--gold-deep);
}

.profile-card {
    max-width: 720px;
    margin: 40px auto;
    padding: 28px;
    border-radius: var(--r-lg);
}

.profile-row {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.profile-avatar {
    width: clamp(64px, 7vw, 84px);
    height: clamp(64px, 7vw, 84px);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--walnut) 0%, var(--walnut-light) 100%);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(24px, 3vw, 30px);
    box-shadow: var(--shadow-sm);
}

.profile-fields { flex: 1; }

.profile-fields input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(197, 160, 33, 0.15);
    background: var(--parchment);
}

.order-card {
    padding: 14px 18px;
    border-radius: var(--r-md);
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .auth-card { padding: 24px 22px; }
    .profile-row { flex-direction: column; align-items: stretch; }
    .auth-actions { flex-direction: column; }
}

.page-hero {
    text-align: center;
    padding: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 24px) clamp(20px, 3vw, 32px);
    max-width: 720px;
    margin: 0 auto;
}

.page-hero h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--walnut);
    margin-bottom: 10px;
}

.page-hero p {
    color: var(--ink-muted);
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
}

.page-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(16px, 2.5vw, 28px);
    max-width: 1100px;
    margin: 0 auto 60px;
    padding: 0 clamp(12px, 3vw, 24px);
}

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

.content-card {
    padding: clamp(20px, 3vw, 28px) clamp(20px, 3vw, 32px);
    border-radius: var(--r-xl);
}

.content-card h3 {
    margin-bottom: 16px;
    color: var(--walnut);
    font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.contact-info-list {
    list-style: none;
    display: grid;
    gap: 16px;
}

.contact-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    color: var(--ink-soft);
}

.contact-info-list i {
    color: var(--gold);
    font-size: 1.1rem;
    margin-top: 4px;
}

.contact-form .form-group {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.contact-form label {
    font-weight: 700;
    font-size: 13px;
    color: var(--ink-muted);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--r-md);
    border: 1px solid rgba(27, 48, 34, 0.12);
    background: rgba(255, 255, 255, 0.6);
    color: var(--ink);
}

.contact-form textarea { min-height: 120px; resize: vertical; }

.legal-page {
    max-width: 820px;
    margin: 0 auto 60px;
    padding: 0 clamp(12px, 3vw, 24px);
}

.legal-content {
    padding: clamp(20px, 3vw, 36px) clamp(16px, 3.5vw, 40px);
    border-radius: var(--r-xl);
    line-height: 1.85;
    color: var(--ink-soft);
}

.legal-content h3 {
    margin: 24px 0 10px;
    color: var(--walnut);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.legal-content h3:first-child { margin-top: 0; }

.legal-content ul {
    margin: 10px 0 10px 1.25rem;
}

.legal-content li { margin-bottom: 8px; }

.confirm-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
}

.confirm-card {
    max-width: 520px;
    width: 100%;
    text-align: center;
    padding: 40px 36px;
    border-radius: var(--r-xl);
}

.confirm-card .confirm-icon {
    width: clamp(60px, 7vw, 72px);
    height: clamp(60px, 7vw, 72px);
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(59, 122, 69, 0.2);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.confirm-card h2 { margin-bottom: 12px; color: var(--walnut); }

.confirm-order-id {
    font-family: monospace;
    font-size: 13px;
    background: var(--gold-pale);
    padding: 10px 14px;
    border-radius: var(--r-md);
    margin: 16px 0;
    word-break: break-all;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

.checkout-card.uiglass,
.details-container.uiglass {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border: 1px solid var(--glass-border);
}

.order-card { padding: 18px 20px; margin-bottom: 14px; border-radius: var(--r-lg); }

.order-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.order-status {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--r-full);
    background: var(--gold-pale);
    color: var(--gold-deep);
}

.order-status--delivered { background: var(--success-bg); color: var(--success); }
.order-status--cancelled { background: var(--danger-bg); color: var(--danger); }

.order-meta { font-size: 13px; color: var(--ink-muted); margin-bottom: 4px; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--ink-muted);
}

.empty-state a { color: var(--gold-deep); font-weight: 700; }

.checkout-whatsapp-note {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.08) 0%, rgba(18, 140, 126, 0.04) 100%);
    border: 1px solid rgba(37, 211, 102, 0.25);
    border-radius: var(--r-md);
    padding: 16px 18px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.checkout-whatsapp-note .whatsapp-note-icon {
    width: clamp(40px, 4vw, 48px);
    height: clamp(40px, 4vw, 48px);
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(20px, 2vw, 24px);
}

.checkout-whatsapp-note .whatsapp-note-text {
    flex-grow: 1;
}

.checkout-whatsapp-note .whatsapp-note-text p {
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 8px;
    line-height: 1.6;
}

.checkout-whatsapp-note .whatsapp-note-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--r-full);
    transition: var(--t-normal);
}

.checkout-whatsapp-note .whatsapp-note-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
}

/* =====================================================
OFFERS STRIP — Animated Discount Marquee
===================================================== */

.offers-strip {
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, #1a2c20 0%, #2d1f1a 50%, #1a2c20 100%);
    overflow: hidden;
    position: relative;
    border-top: 1px solid rgba(197,160,33,0.12);
    border-bottom: 1px solid rgba(197,160,33,0.12);
}

.offers-strip-inner {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 12px;
}

.offers-strip-label {
    flex-shrink: 0;
    color: var(--gold);
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 14px;
    letter-spacing: 0.5px;
}

.offers-strip-track {
    overflow: hidden;
    flex: 1;
    height: 100%;
    position: relative;
}

.offers-strip-track::before,
.offers-strip-track::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 2;
    pointer-events: none;
}

.offers-strip-track::before {
    left: 0;
    background: linear-gradient(to right, #1a2c20, transparent);
}

.offers-strip-track::after {
    right: 0;
    background: linear-gradient(to left, #1a2c20, transparent);
}

.offers-strip-marquee {
    display: flex;
    align-items: center;
    height: 100%;
    width: fit-content;
    animation: offersScroll 45s linear infinite;
}

.offers-strip:hover .offers-strip-marquee {
    animation-play-state: paused;
}

.offers-strip-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 22px;
    color: rgba(255,255,255,0.85);
    font-size: clamp(11px, 0.9vw, 13px);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease;
    height: 100%;
    text-decoration: none;
}

.offers-strip-item:hover {
    color: var(--gold);
}

.offers-strip-item .offers-badge {
    background: linear-gradient(135deg, var(--danger), #b84343);
    padding: 1px 9px;
    border-radius: 10px;
    font-weight: 800;
    font-size: clamp(10px, 0.7vw, 11px);
    color: #fff;
    line-height: 1.6;
}

.offers-strip-item .offers-title {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offers-strip-sep {
    color: var(--gold);
    opacity: 0.25;
    font-size: 10px;
    flex-shrink: 0;
}

@keyframes offersScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (max-width: 600px) {
    .offers-strip { height: 38px; }
    .offers-strip-label { font-size: 11px; margin-left: 10px; }
    .offers-strip-item { padding: 0 14px; font-size: 11px; }
    .offers-strip-item .offers-title { max-width: 120px; }
    .offers-strip-marquee { animation-duration: 30s; }
}

/* =====================================================
BESTSELLERS — Modern Redesign
===================================================== */

.bestsellers-section {
    padding: clamp(24px, 4vw, 48px) 0;
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
}

.bestsellers-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 30% 20%, rgba(197,160,33,0.03) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 70% 80%, rgba(27,48,34,0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.bestsellers-section > * {
    position: relative;
    z-index: 1;
}

.bestsellers-section .section-header {
    text-align: center;
    margin-bottom: clamp(20px, 3vw, 36px);
    padding: 0 clamp(12px, 3vw, 32px);
}

.bestsellers-section .section-header h2 {
    font-size: clamp(22px, 2.8vw, 30px);
    color: var(--walnut);
    font-weight: 800;
    font-family: 'Amiri', serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.bestsellers-section .section-header h2 i {
    color: var(--gold);
    font-size: clamp(18px, 2vw, 24px);
}

.bestsellers-section .section-header p {
    color: var(--ink-muted);
    font-size: clamp(13px, 1.1vw, 15px);
    margin-top: 6px;
}

/* ---- Scroll Wrapper ---- */
.bestsellers-wrapper {
    position: relative;
    padding: 0 clamp(12px, 3vw, 32px);
}

.bestsellers-scroll {
    display: flex;
    gap: clamp(14px, 1.8vw, 24px);
    overflow-x: auto;
    padding: 12px 4px 28px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
}



.bestsellers-scroll::-webkit-scrollbar {
    display: none;
}

.bestsellers-scroll.dragging {
    scroll-snap-type: none;
    cursor: grabbing;
    user-select: none;
}

/* ---- Navigation Arrows ---- */
.bestsellers-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(197,160,33,0.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    color: var(--walnut);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    opacity: 0;
    pointer-events: none;
}

.bestsellers-wrapper:hover .bestsellers-arrow {
    opacity: 1;
    pointer-events: auto;
}

.bestsellers-arrow:hover {
    background: var(--walnut);
    color: var(--gold);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 20px rgba(27,48,34,0.18);
}

.bestsellers-arrow--left {
    left: 4px;
}

.bestsellers-arrow--right {
    right: 4px;
}

@media (max-width: 768px) {
    .bestsellers-arrow { display: none; }
}

/* ---- Card Base ---- */
.bestseller-card {
    flex: 0 0 clamp(120px, 14vw, 185px);
    scroll-snap-align: start;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(24px) scale(0.92);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.34,1.56,.64,1);
    will-change: transform;
}

.bestseller-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bestseller-card.magnet-active {
    animation: none !important;
}

.bestseller-card-inner {
    background: var(--cream);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    height: 100%;
    box-shadow:
        0 2px 8px rgba(27,48,34,0.06),
        0 8px 24px rgba(27,48,34,0.04);
    transition: box-shadow 0.4s ease, border-color 0.3s ease, transform 0.15s ease-out;
    border: 1px solid rgba(197,160,33,0.10);
}

.bestseller-card:hover .bestseller-card-inner {
    box-shadow:
        0 12px 40px rgba(27,48,34,0.14),
        0 4px 12px rgba(197,160,33,0.10),
        0 0 0 1px rgba(197,160,33,0.15);
}

.bestseller-card:hover .bestseller-card-img img {
    transform: scale(1.08);
}

.bestseller-card:last-child {
    border-right: none;
}

.bestseller-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bestseller-card.magnet-active {
    animation: none !important;
}

.bestseller-card-inner {
    background: var(--cream);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    height: 100%;
}

.bestseller-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}



.bestseller-card-inner {
    background: var(--cream);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    box-shadow:
        0 2px 8px rgba(27,48,34,0.06),
        0 8px 24px rgba(27,48,34,0.04);
    transition: box-shadow 0.4s ease, border-color 0.3s ease, transform 0.15s ease-out;
    border: 1px solid rgba(197,160,33,0.10);
}

/* Hover highlight for strip */
.bestseller-card:hover {
    background: rgba(197,160,33,0.04);
}

.bestseller-card:hover .bestseller-card-img img {
    transform: scale(1.06);
}

/* Magnet active — pause float, apply inline transform via JS */
.bestseller-card.magnet-active {
    animation: none !important;
}

/* ---- Badge ---- */
.bestseller-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), #d4a82a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(197,160,33,0.35);
}

/* ---- Image ---- */
.bestseller-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--parchment);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bestseller-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-out;
    display: block;
}

.bestseller-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(32px, 5vw, 44px);
    color: var(--ink-faint);
    background: var(--parchment);
}

/* ---- CTA Overlay ---- */
.bestseller-card-cta {
    position: absolute;
    inset: 0;
    background: rgba(27,48,34,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

/* ---- Discount Badge ---- */
.bestseller-card-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: #fff;
    font-size: clamp(10px, 0.9vw, 11px);
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(155,59,59,0.3);
}

/* ---- Body ---- */
.bestseller-card-body {
    padding: clamp(10px, 1.2vw, 14px) clamp(10px, 1.2vw, 16px);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 4px;
    transition: transform 0.2s ease-out;
}

.bestseller-card-body .bestseller-card-cat {
    font-size: clamp(9px, 0.8vw, 10px);
    color: var(--gold-deep);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.bestseller-card-body h3 {
    font-size: clamp(13px, 1.1vw, 15px);
    font-weight: 700;
    color: var(--walnut);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(clamp(13px, 1.1vw, 15px) * 1.3 * 2);
}

.bestseller-card-author {
    font-size: clamp(11px, 0.9vw, 12px);
    color: var(--ink-muted);
    margin-bottom: 2px;
}

/* ---- Rating ---- */
.bestseller-card-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 6px;
}

.bestseller-card-rating i {
    font-size: clamp(10px, 0.8vw, 11px);
    color: #e6b800;
}

.bestseller-card-rating i.empty {
    color: var(--ink-faint);
    opacity: 0.3;
}

.bestseller-card-rating span {
    font-size: clamp(10px, 0.8vw, 11px);
    color: var(--ink-muted);
    margin-right: 4px;
}

/* ---- Price ---- */
.bestseller-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(197,160,33,0.06);
}

.bestseller-card-price {
    font-size: clamp(15px, 1.3vw, 17px);
    font-weight: 800;
    color: var(--walnut);
    font-family: var(--font-display-en);
}

.bestseller-card-price span {
    font-size: clamp(9px, 0.7vw, 10px);
    font-weight: 600;
    color: var(--ink-muted);
    margin-right: 2px;
    font-family: var(--font-body-ar);
}

.bestseller-card-old-price {
    text-decoration: line-through;
    color: var(--ink-muted);
    font-size: clamp(11px, 0.9vw, 12px);
    font-weight: 400;
    margin-left: 6px;
}

.bestseller-card-add {
    width: clamp(30px, 2.5vw, 34px);
    height: clamp(30px, 2.5vw, 34px);
    border-radius: 50%;
    background: var(--walnut);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(11px, 0.9vw, 12px);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.bestseller-card-add:hover {
    background: var(--gold);
    color: var(--walnut-dark);
    transform: scale(1.12);
}

/* ---- Empty State ---- */
.bestsellers-empty {
    width: 100%;
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-muted);
    font-size: 15px;
}

.bestsellers-empty i {
    font-size: 44px;
    color: var(--gold);
    opacity: 0.3;
    display: block;
    margin-bottom: 14px;
}

/* ---- CTA Button ---- */
.bestsellers-cta {
    text-align: center;
    margin-top: clamp(8px, 1.5vw, 20px);
}

.bestsellers-cta .btn {
    padding: 10px 32px;
    font-size: 14px;
}

/* ---- Skeleton Loading ---- */
.bestsellers-skeleton {
    display: flex;
    gap: clamp(14px, 1.8vw, 24px);
    padding: 12px 4px 28px;
}

.bestseller-skeleton-card {
    flex: 0 0 clamp(120px, 14vw, 185px);
    border-radius: 12px;
    overflow: hidden;
    background: var(--cream);
    border: 1px solid rgba(197,160,33,0.06);
}

.bestseller-skeleton-img {
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(110deg, #e8e0d4 30%, #f2ece2 50%, #e8e0d4 70%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}

.bestseller-skeleton-body {
    padding: 12px 14px;
    display: grid;
    gap: 8px;
}

.bestseller-skeleton-line {
    height: 11px;
    border-radius: 99px;
    background: linear-gradient(110deg, #e0d8cc 30%, #ece4d8 50%, #e0d8cc 70%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}

.bestseller-skeleton-line.short { width: 50%; }
.bestseller-skeleton-line.medium { width: 70%; }
.bestseller-skeleton-line.long { width: 90%; }

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

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .bestseller-card {
        flex: 0 0 clamp(140px, 24vw, 190px);
    }
    .bestseller-skeleton-card {
        flex: 0 0 clamp(140px, 24vw, 190px);
    }
}

@media (max-width: 480px) {
    .bestseller-card {
        flex: 0 0 calc(46vw - 12px);
    }
    .bestseller-skeleton-card {
        flex: 0 0 calc(46vw - 12px);
    }
    .bestseller-card-body h3 {
        font-size: 12px;
    }
    .bestseller-card-img {
        aspect-ratio: 3/4;
    }
    .bestsellers-section .section-header h2 {
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .bestseller-card {
        flex: 0 0 calc(70vw - 12px);
    }
    .bestseller-skeleton-card {
        flex: 0 0 calc(70vw - 12px);
    }
}
