/* CSS Variable System for Theme Consistency */
:root {
    --bg-primary: #FAF6EE;
    /* Warm Creme paper background */
    --bg-secondary: #F3ECE0;
    /* Deeper warm paper tone */
    --bg-card: #FFFFFF;
    /* Pure white for card elevation */

    --primary: #1B2A4A;
    /* Deep Navy (main branding) */
    --primary-light: #2A3E63;

    --accent-burgundy: #800020;
    /* Rich Burgundy for accents and highlights */
    --accent-burgundy-hover: #5F0018;

    --accent-gold: #D4AF37;
    /* Warm Gold for premium vibes/stars */
    --accent-gold-dark: #B3922E;

    --text-main: #2D251E;
    /* Very dark warm brown for text */
    --text-muted: #6A5D54;
    /* Muted brown/gray for subtitles */
    --border-color: #E2D7C7;

    --success: #2E7D32;
    --error: #C62828;

    --font-cairo: 'Cairo', sans-serif;
    --font-tajawal: 'Tajawal', sans-serif;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --box-shadow-sm: 0 4px 6px -1px rgba(45, 37, 30, 0.05);
    --box-shadow-md: 0 10px 15px -3px rgba(45, 37, 30, 0.08), 0 4px 6px -2px rgba(45, 37, 30, 0.04);
    --box-shadow-lg: 0 20px 25px -5px rgba(45, 37, 30, 0.12), 0 10px 10px -5px rgba(45, 37, 30, 0.04);
}

/* Base Styles & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-cairo);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

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

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

/* Sticky Header styling */
.main-header {
    background-color: rgba(250, 246, 238, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition-normal);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    height: 54px;
    width: 54px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--primary);
    box-shadow: var(--box-shadow-sm);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-tajawal);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-burgundy);
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--accent-burgundy);
}

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

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-family: var(--font-cairo);
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition-normal);
    gap: 8px;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 42, 74, 0.25);
}

.btn-gold {
    background-color: var(--accent-gold);
    color: #FFFFFF;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-gold:hover {
    background-color: var(--accent-gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}

.btn-outline {
    background-color: transparent;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
}

.btn-outline:hover {
    background-color: #FFFFFF;
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Hero Section */
.hero-section {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 120px 0;
    color: #FFFFFF;
    position: relative;
    border-bottom: 4px solid var(--accent-gold);
}

.hero-container {
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 650px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.hero-badge {
    background-color: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--accent-gold);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-family: var(--font-tajawal);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 36px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

/* Common Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-subtitle {
    color: var(--accent-burgundy);
    font-family: var(--font-tajawal);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
}

.title-underline {
    width: 60px;
    height: 4px;
    background-color: var(--accent-gold);
    margin: 16px auto 0 auto;
    border-radius: 2px;
}

/* About Section */
.about-section {
    padding: 80px 0;
    background-color: var(--bg-secondary);
}

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

.about-card {
    background-color: var(--bg-card);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-sm);
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
    text-align: center;
}

.about-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--box-shadow-lg);
}

.about-card.highlighted {
    background-color: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.about-card.highlighted h3 {
    color: var(--accent-gold);
}

.about-card.highlighted p {
    color: rgba(255, 255, 255, 0.85);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.about-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.about-card p {
    font-family: var(--font-tajawal);
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
}

/* Book Catalog Section */
.catalog-section {
    padding: 100px 0;
}

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

.loading-catalog {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    padding: 50px;
    color: var(--text-muted);
}

/* Beautiful Book Cards */
.book-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-sm);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-lg);
}

/* Book image container — fixed height, no bleed */
.book-image-container {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: var(--transition-normal);
}

.book-card:hover .book-cover-img {
    transform: scale(1.05);
}

/* Legacy alias — keep for SVG placeholders injected inline */
.book-img-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    background-color: #ECE7DF;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.book-card:hover .book-cover {
    transform: scale(1.05);
}

/* Sold-out badge — overlays top-left corner with high z-index */
.sold-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background-color: rgba(30, 30, 30, 0.88);
    color: #FFFFFF;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 4px;
    z-index: 20;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

/* Sold-out card visual dimming */
.book-card--sold {
    opacity: 0.75;
}

.book-card--sold .book-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    z-index: 10;
    pointer-events: none;
}

/* Disabled sold-out button */
.btn-sold-out {
    background-color: #9CA3AF;
    color: #FFFFFF;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: var(--font-cairo);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: not-allowed;
    opacity: 0.85;
}

.condition-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: var(--box-shadow-sm);
}

.condition-badge.used {
    background-color: #800020;
    color: #FFFFFF;
}

.condition-badge.new {
    background-color: #2E7D32;
    color: #FFFFFF;
}

.book-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.book-author {
    font-family: var(--font-tajawal);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

.book-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-burgundy);
}

.book-price span {
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 4px;
    color: var(--text-muted);
}

/* Before/After Pricing — strikethrough original price */
.book-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.book-price-original {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: line-through;
}

.book-price-current {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-burgundy);
}

/* ==========================================
   Special Offers Section
   ========================================== */
.offers-section {
    padding: 80px 0 40px;
    background-color: var(--bg-primary);
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
}

/* Hero-image card: the photo fills the ENTIRE card as a background layer,
   with a dark gradient + the offer content overlaid on top of it. */
.offer-card {
    position: relative;
    isolation: isolate;
    min-height: 420px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--box-shadow-md);
    border: 1px solid var(--accent-gold);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-light) 100%);
    transition: var(--transition-normal);
}

.offer-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--box-shadow-lg);
}

.offer-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s ease;
}

.offer-card:hover .offer-media {
    transform: scale(1.06);
}

/* Dark gradient so text stays readable over any photo; stronger for cards
   with a real photo, lighter (mostly decorative) for the gradient-only fallback */
.offer-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(0deg, rgba(15, 20, 35, 0.94) 0%, rgba(15, 20, 35, 0.55) 45%, rgba(15, 20, 35, 0.15) 75%, rgba(15, 20, 35, 0) 100%);
}

.offer-card:not(.has-media) .offer-overlay {
    background: linear-gradient(0deg, rgba(15, 20, 35, 0.55) 0%, rgba(15, 20, 35, 0.15) 60%, rgba(15, 20, 35, 0) 100%);
}

.offer-body {
    position: relative;
    z-index: 2;
    padding: 26px 26px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.offer-flag {
    display: inline-block;
    align-self: flex-start;
    background-color: var(--accent-gold);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.78rem;
    padding: 4px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.offer-title {
    color: #FFFFFF;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.4;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.offer-description {
    font-family: var(--font-tajawal);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 4px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.offer-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.offer-price-tag {
    color: var(--accent-gold);
    font-size: 1.5rem;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.offer-price-tag span {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.offer-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.offer-details-link {
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--font-tajawal);
    font-size: 0.85rem;
    text-decoration: underline;
}

.offer-details-link:hover {
    color: var(--accent-gold);
}

.offer-cta {
    align-self: flex-start;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* ==========================================
   Book Accessories / Reading Essentials Section
   ========================================== */
.accessories-section {
    padding: 60px 0 80px;
    background-color: var(--bg-primary);
}

.accessories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 22px;
}

.accessory-card {
    background-color: #FFFFFF;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}

.accessory-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-md);
}

.accessory-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #EDE3D3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.accessory-placeholder {
    font-size: 2.5rem;
}

.accessory-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.accessory-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.4;
}

.accessory-description {
    font-family: var(--font-tajawal);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
}

/* Custom book notes — shown in the order modal, under the book title */
.modal-book-notes {
    background-color: #FFF8E6;
    border: 1px dashed var(--accent-gold-dark);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-tajawal);
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.6;
    margin: -4px 0 10px;
}

/* Reviews and Testimonials */
.reviews-section {
    padding: 100px 0;
    background-color: var(--bg-secondary);
}

.reviews-banners {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 60px;
}

.review-banner-wrapper {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow-md);
    border: 1px solid var(--border-color);
}

.review-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.review-banner-img:hover {
    transform: scale(1.02);
}

.gallery-title {
    text-align: center;
    font-size: 1.4rem;
    color: var(--primary);
    margin: 40px 0 24px 0;
    font-weight: 700;
}

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

.comment-img-wrapper {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow-sm);
    border: 1px solid var(--border-color);
    background-color: #fff;
    aspect-ratio: 1;
}

.comment-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.comment-img:hover {
    transform: scale(1.05);
}

/* Footer Section styling */
.main-footer {
    background-color: var(--primary);
    color: #FFFFFF;
    padding: 80px 0 0 0;
    border-top: 5px solid var(--accent-burgundy);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand .footer-logo-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.footer-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
}

.footer-brand h3 {
    font-size: 1.5rem;
    color: var(--accent-gold);
}

.footer-brand p {
    font-family: var(--font-tajawal);
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.8;
}

.footer-links h4,
.footer-shipping h4 {
    font-size: 1.15rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
    font-weight: 700;
}

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

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.85);
    transition: var(--transition-fast);
}

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

.footer-shipping p {
    font-family: var(--font-tajawal);
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 20px;
    line-height: 1.8;
}

.payment-method {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    border-radius: 8px;
    border-right: 4px solid var(--accent-gold);
    font-weight: 700;
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0;
    text-align: center;
    font-family: var(--font-tajawal);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Modal Checkout Form styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(27, 42, 74, 0.75);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px;
    position: relative;
    border: 1px solid var(--border-color);
    transform: scale(0.9);
    transition: var(--transition-normal);
}

.modal-overlay.open .modal-card {
    transform: scale(1);
}

.btn-close-modal {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
    line-height: 1;
}

.btn-close-modal:hover {
    color: var(--accent-burgundy);
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 800;
}

.modal-subtitle {
    font-family: var(--font-tajawal);
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Selected Book Summary */
.selected-book-info {
    background-color: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 700;
    color: var(--text-muted);
}

.info-val {
    color: var(--primary);
    font-weight: 700;
}

/* ==========================================
   Creator Feedback Section (Fixed Heights)
   ========================================== */
.creator-feedback-section {
    padding: 60px 0;
    background-color: var(--bg-primary);
}

.feedback-card-wrapper {
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    padding: 20px;
}

/* Fixed container to accommodate full Instagram Reel frame height */
.instagram-reel-box {
    width: 100%;
    max-width: 380px;
    height: 480px;
    /* Crucial: provides enough vertical height so Instagram doesn't clip the video */
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.instagram-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.feedback-info-box {
    width: 100%;
    text-align: center;
    margin-top: 20px;
}

.feedback-info-box h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.feedback-info-box p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.feedback-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-social {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #ffffff;
}

.btn-facebook {
    background-color: #1877f2;
    color: #ffffff;
}

.btn-social:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    color: #ffffff;
}

@media (max-width: 480px) {
    .instagram-reel-box {
        height: 440px;
    }

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





/* Vodafone Cash Info Card */
.vodafone-cash-card {
    background-color: #FFF2F2;
    border: 1px solid #FFCDCD;
    border-radius: var(--border-radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}

.vodafone-cash-logo {
    color: #E60000;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.instruction-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.cash-number-display {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #E60000;
    font-family: monospace;
    margin-bottom: 12px;
    direction: ltr;
}

.btn-copy {
    background-color: var(--primary);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-family: var(--font-cairo);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-copy:hover {
    background-color: var(--accent-burgundy);
}

.instruction-subtext {
    font-family: var(--font-tajawal);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Form Styling */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
}

.form-group label.required::after {
    content: " *";
    color: var(--error);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-cairo);
    font-size: 0.95rem;
    outline: none;
    background-color: #FFFFFF;
    color: var(--text-main);
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.help-text {
    font-family: var(--font-tajawal);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* File Drop Area */
.file-drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background-color: #FFFFFF;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.file-drop-area.dragover {
    border-color: var(--primary);
    background-color: rgba(27, 42, 74, 0.05);
}

.file-drop-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

.file-msg {
    font-family: var(--font-tajawal);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Receipt Preview */
.receipt-preview-container {
    display: none;
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    max-height: 200px;
}

.receipt-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Form Submit Button */
.btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    margin-top: 10px;
}

.btn-submit:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary);
    color: #FFFFFF;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    z-index: 2000;
    /* High z-index to overlay modals */
    transform: translateY(150px);
    opacity: 0;
    transition: var(--transition-normal);
    border-right: 5px solid var(--accent-gold);
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toast-icon {
    background-color: var(--accent-gold);
    color: var(--primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.toast-message {
    font-weight: 700;
    font-size: 0.95rem;
}

/* Error Toast State */
.toast-notification.error-toast {
    border-right-color: var(--error);
}

.toast-notification.error-toast .toast-icon {
    background-color: var(--error);
    color: #FFFFFF;
}

/* ==========================================
   Admin Dashboard Custom Styles
   ========================================== */
.admin-body {
    background-color: var(--bg-secondary);
}

/* Passcode Lock Screen overlay */
.lock-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--primary);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

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

.lock-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.lock-card h2 {
    color: var(--primary);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.lock-card p {
    color: var(--text-muted);
    font-family: var(--font-tajawal);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.lock-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-lock-submit {
    padding: 12px;
}

.lock-error {
    color: var(--error);
    font-size: 0.9rem;
    font-weight: 700;
    display: none;
    margin-top: 8px;
}

.back-to-store-link {
    display: inline-block;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--accent-burgundy);
    font-weight: 700;
}

.back-to-store-link:hover {
    text-decoration: underline;
}

/* Admin Dashboard layout wrapper */
.admin-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.admin-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.admin-main {
    padding-top: 40px;
    padding-bottom: 80px;
    flex-grow: 1;
}

/* Admin Tab Buttons */
.admin-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.admin-tabs::-webkit-scrollbar {
    height: 5px;
}

.admin-tabs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* Sub-tabs inside the "Orders" tab (Books / Offers / Accessories) */
.order-subtabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.order-subtab-btn {
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    font-family: var(--font-cairo);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 9px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.order-subtab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.order-subtab-btn.active {
    background-color: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.order-subtab-content {
    display: none;
}

.order-subtab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.tab-btn {
    background: none;
    border: none;
    font-family: var(--font-cairo);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

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

.tab-btn.active {
    background-color: var(--primary);
    color: #FFFFFF;
}

/* Tab Display logic */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Admin Responsive Dashboard Grid */
.admin-grid {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 30px;
}

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

.admin-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-sm);
    padding: 30px;
}

.admin-card h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.card-underline {
    width: 40px;
    height: 3px;
    background-color: var(--accent-gold);
    margin-bottom: 24px;
    border-radius: 2px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Cover Image selector choices */
.cover-type-selector {
    display: flex;
    gap: 20px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Books & Orders tables */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-tajawal);
    font-size: 0.95rem;
    text-align: right;
    background-color: #FFFFFF;
}

.admin-table th {
    background-color: var(--primary);
    color: #FFFFFF;
    font-family: var(--font-cairo);
    font-weight: 700;
    padding: 14px 16px;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.admin-table tr:hover td {
    background-color: #FCFAF5;
}

.table-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
    font-size: 1.1rem;
}

/* Admin Book Cover Thumbnail */
.admin-book-thumbnail {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.admin-btn-delete {
    background-color: #FFEBEB;
    color: var(--error);
    border: 1px solid #FFD1D1;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: var(--font-cairo);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.admin-btn-delete:hover {
    background-color: var(--error);
    color: #FFFFFF;
    border-color: var(--error);
}

.admin-btn-edit {
    background-color: #EAF1FF;
    color: var(--primary);
    border: 1px solid #C7D8FA;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: var(--font-cairo);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-left: 6px;
}

.admin-btn-edit:hover {
    background-color: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.admin-btn-pdf {
    background-color: #EAF7EE;
    color: var(--success);
    border: 1px solid #BFE6C9;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: var(--font-cairo);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.admin-btn-pdf:hover {
    background-color: var(--success);
    color: #FFFFFF;
    border-color: var(--success);
}

.admin-btn-pdf:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================
   PDF Receipt Generation Overlay
   ========================================== */
/* The receipt template is kept ON-SCREEN while html2canvas captures it
   (rather than positioned far off-canvas), which avoids clipped/cut-off
   PDFs in some browsers. A solid spinner overlay sits on top so the admin
   never actually sees the raw template. */
.pdf-render-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    overflow-y: auto;
    background: var(--primary);
}

.pdf-render-overlay.active {
    display: block;
}

.pdf-render-spinner {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(27, 42, 74, 0.98);
    color: #FFFFFF;
}

.pdf-spinner-icon {
    font-size: 2.6rem;
    animation: pdf-spin 1.3s linear infinite;
}

@keyframes pdf-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pdf-render-spinner p {
    font-family: var(--font-cairo);
    font-weight: 700;
    font-size: 1.1rem;
}

#pdf-receipt-template {
    position: fixed;
    z-index: 1;
    top: 40px;
    left: 40px;
}

.admin-receipt-link {
    color: var(--accent-burgundy);
    font-weight: 700;
    text-decoration: underline;
}

.admin-receipt-link:hover {
    color: var(--accent-burgundy-hover);
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================
   Mobile & Tablet Responsiveness (Store Front)
   ========================================== */

/* Tablet & Mobile Screens (Max-width: 768px) */
@media (max-width: 768px) {

    /* Container Padding */
    .container {
        padding: 0 16px;
    }

    /* Header & Navigation */
    .header-container {
        height: auto;
        padding: 12px 0;
        flex-direction: column;
        gap: 12px;
    }

    .brand-logo {
        height: 44px;
        width: 44px;
    }

    .brand-name {
        font-size: 1.15rem;
    }

    .brand-tagline {
        font-size: 0.75rem;
    }

    .nav-menu {
        gap: 14px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .nav-link {
        font-size: 0.88rem;
    }

    .nav-cta {
        padding: 6px 14px;
        font-size: 0.85rem;
    }

    /* Hero Section */
    .hero-section {
        padding: 60px 0;
        background-attachment: scroll;
        /* Fixes performance lag on iOS Safari */
    }

    .hero-title {
        font-size: 1.8rem;
        line-height: 1.35;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.7;
        margin-bottom: 24px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

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

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

    .section-title {
        font-size: 1.6rem;
    }

    .section-subtitle {
        font-size: 0.88rem;
    }

    /* About Cards Grid */
    .about-section {
        padding: 50px 0;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .about-card {
        padding: 24px 18px;
    }

    /* Book Catalog Grid */
    .catalog-section {
        padding: 60px 0;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    .book-image-container,
    .book-img-wrapper {
        height: 200px;
    }

    .book-info {
        padding: 12px;
    }

    .book-title {
        font-size: 0.95rem;
        height: 2.8em;
    }

    .book-author {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .book-price-current {
        font-size: 1rem;
    }

    .book-price-original {
        font-size: 0.75rem;
    }

    .offers-section {
        padding: 50px 0 20px;
    }

    .offers-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .offer-card {
        min-height: 320px;
    }

    .offer-title {
        font-size: 1.2rem;
    }

    .offer-body {
        padding: 20px;
    }

    .accessories-section {
        padding: 40px 0 50px;
    }

    .accessories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .condition-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
        top: 10px;
        right: 10px;
    }

    .sold-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
        top: 10px;
        left: 10px;
    }

    /* Reviews Section */
    .reviews-section {
        padding: 60px 0;
    }

    .reviews-banners {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 36px;
    }

    .comments-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gallery-title {
        font-size: 1.1rem;
        margin: 24px 0 16px 0;
    }

    /* Footer */
    .main-footer {
        padding: 50px 0 0 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 36px;
    }

    .footer-bottom {
        font-size: 0.8rem;
        padding: 18px 12px;
    }

    /* Admin Dashboard */
    .admin-card {
        padding: 18px;
    }

    .admin-tabs {
        gap: 8px;
    }

    .tab-btn {
        font-size: 0.9rem;
        padding: 8px 14px;
    }

    .order-subtab-btn {
        font-size: 0.85rem;
        padding: 7px 14px;
    }

    .admin-header-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

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

    /* Order Checkout Modal */
    .modal-overlay {
        padding: 12px;
    }

    .modal-card {
        padding: 20px 16px;
        max-height: 95vh;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    .cash-number-display {
        font-size: 1.6rem;
    }

    .vodafone-cash-card {
        padding: 16px;
    }

    .btn-close-modal {
        top: 12px;
        left: 12px;
    }
}

/* Small Phones (Max-width: 400px) */
@media (max-width: 400px) {
    .book-grid {
        grid-template-columns: 1fr 1fr;
        /* Clean 2-column layout on tiny screens */
        gap: 10px;
    }

    .book-image-container,
    .book-img-wrapper {
        height: 180px;
    }

    .accessories-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .offer-card {
        min-height: 280px;
    }

    .offer-title {
        font-size: 1.05rem;
    }

    .offer-description {
        font-size: 0.85rem;
    }
}