/* ============================================================
   طريق الأسانيد - Professional Mobile-First Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&family=Outfit:wght@300;400;600;700&display=swap');

/* ===== CSS Variables ===== */
:root {
    --primary: #BE161D;
    --primary-dark: #9B1118;
    --primary-light: rgba(190, 22, 29, 0.08);
    --accent: #00B6A3;
    --accent-dark: #009686;
    --accent-light: rgba(0, 182, 163, 0.08);

    --bg: #F4F6F9;
    --bg-card: #FFFFFF;
    --bg-dark: #1A1D23;

    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --text-muted: #A0AEC0;

    --border: #E8ECF0;
    --border-dark: #CBD5E0;

    --shadow-xs: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);

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

    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Almarai', 'Outfit', sans-serif;

    --header-h: 94px; /* top ticker (36px) + header inner (58px) */
    --bottom-nav-h: 68px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    direction: rtl;
    text-align: right;
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: var(--header-h);
    padding-bottom: calc(var(--bottom-nav-h) + 12px);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: var(--radius-full); }

/* ============================================================
   APP HEADER
   ============================================================ */
.app-header {
    position: fixed;
    top: 36px;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.app-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    height: 58px;
}

/* Logo */
.app-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    text-decoration: none;
}

.app-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.app-logo-text {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Search */
.app-search-form {
    flex: 1;
    min-width: 0;
}

.app-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    transition: var(--transition);
    overflow: hidden;
}

.app-search-wrapper:focus-within {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.app-search-icon {
    position: absolute;
    right: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
}

.app-search-input {
    width: 100%;
    height: 38px;
    padding: 0 36px 0 36px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 600;
}

.app-search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.app-search-clear {
    position: absolute;
    left: 8px;
    width: 22px;
    height: 22px;
    background: var(--text-muted);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition);
}

.app-search-clear:hover { background: var(--primary); }

/* Header Actions & Unified Header Buttons System */
.app-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.hdr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 36px;
    padding: 0 0.8rem;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1.5px solid var(--border);
    background: #FAFBFD;
    color: var(--text-primary);
}

.hdr-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.hdr-country-btn {
    background: rgba(190, 22, 29, 0.06);
    border-color: rgba(190, 22, 29, 0.2);
    color: var(--primary-dark);
}

.hdr-country-btn .hdr-flag {
    font-size: 1.15rem;
    line-height: 1;
}

.hdr-country-btn .hdr-currency-symbol {
    font-size: 0.72rem;
    opacity: 0.85;
    font-family: 'Outfit', sans-serif;
}

.hdr-lang-btn {
    background: #FAFBFD;
    border-color: var(--border);
    color: var(--text-primary);
}

.hdr-lang-btn .hdr-lang-icon {
    color: var(--accent);
    font-size: 0.95rem;
}

.hdr-login-btn {
    background: rgba(0, 182, 163, 0.08);
    border-color: rgba(0, 182, 163, 0.25);
    color: var(--accent-dark);
}
.hdr-login-btn:hover {
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--accent);
}

.hdr-reg-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(190, 22, 29, 0.25);
}
.hdr-reg-btn:hover {
    box-shadow: 0 6px 16px rgba(190, 22, 29, 0.35);
    color: #FFFFFF;
}

.hdr-profile-btn {
    background: rgba(0, 182, 163, 0.08);
    border-color: rgba(0, 182, 163, 0.25);
    color: var(--accent-dark);
}

.hdr-logout-btn {
    background: rgba(229, 62, 62, 0.08);
    border-color: rgba(229, 62, 62, 0.2);
    color: var(--primary);
    width: 36px;
    padding: 0;
    border-radius: 50%;
}
.hdr-logout-btn:hover {
    background: var(--primary);
    color: #FFFFFF;
}

.app-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
}


.app-icon-btn:hover, .app-icon-btn:active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.app-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 16px;
    height: 16px;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid white;
}

/* ===== Category Chips Bar ===== */
.category-chips-bar {
    height: 52px;
    display: flex;
    align-items: center;
    border-top: 1px solid #EDF2F7;
    background: #FFFFFF;
    box-shadow: inset 0 -1px 0 var(--border);
}

.category-chips-scroll {
    display: flex;
    gap: 10px;
    padding: 0 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: center;
    height: 100%;
}

.category-chips-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 0.45rem 1.15rem;
    border-radius: var(--radius-full);
    font-size: 0.83rem;
    font-weight: 800;
    border: 1.5px solid var(--border);
    color: var(--text-primary);
    background: #F8FAFC;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.cat-chip:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: rgba(190, 22, 29, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(190, 22, 29, 0.15);
}

.cat-chip.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-dark);
    color: #FFFFFF !important;
    box-shadow: 0 4px 14px rgba(190, 22, 29, 0.35);
}

.cat-chip.active i {
    color: #FFFFFF !important;
}

.cat-chip i { font-size: 0.8rem; color: var(--accent); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.app-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 12px 20px;
}

/* ===== Sort Bar ===== */
.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-xs);
}

.sort-bar-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sort-bar-label i {
    color: var(--primary);
    font-size: 0.85rem;
}

.sort-count {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
}

.sort-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.sort-select:focus {
    border-color: var(--primary);
}

/* ============================================================
   BOOKS GRID - Professional 2-column
   ============================================================ */
.books-grid-new {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ===== Book Card ===== */
.book-card-new {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    position: relative;
}

.book-card-new:hover, .book-card-new:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-dark);
}

/* Book Image */
.book-card-image {
    position: relative;
    padding-top: 130%;  /* 4:5 aspect ratio portrait */
    background: linear-gradient(145deg, #F7F4EE 0%, #EDE8DC 100%);
    overflow: hidden;
    flex-shrink: 0;
}

.book-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.book-card-new:hover .book-card-image img {
    transform: scale(1.04);
}

.book-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #C5A85C;
}

/* Discount Badge */
.badge-discount {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    z-index: 2;
    box-shadow: 0 2px 6px rgba(190, 22, 29, 0.35);
}

/* Ijaza Badge */
.badge-ijaza {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 182, 163, 0.35);
}

/* Card Body */
.book-card-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
}

.book-card-category {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.book-card-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-author {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
}

.book-card-author i { font-size: 0.65rem; }

/* Price Row */
.book-card-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.book-card-prices {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

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

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

.btn-add-cart {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-add-cart:hover, .btn-add-cart:active {
    background: var(--accent-dark);
    transform: scale(0.95);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-top: 1rem;
}

.empty-state-icon {
    width: 70px;
    height: 70px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1.2rem;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.empty-state p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.btn-primary-full {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.btn-primary-full:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    background: #FFFFFF;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 700;
    transition: var(--transition);
    position: relative;
    padding: 8px 4px 10px;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    transition: var(--transition);
}

.bottom-nav-item:active {
    opacity: 0.7;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active i {
    color: var(--primary);
}

.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.bottom-nav-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid white;
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 2rem 1.5rem;
    margin-top: 2rem;
}

.app-footer-inner { max-width: 600px; margin: 0 auto; }

.footer-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
}

.footer-logo-row i { color: var(--primary); }

.app-footer p {
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
}

.footer-copy {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    margin-top: 0.8rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeUp 0.35s ease forwards; }

.books-grid-new .book-card-new {
    animation: fadeUp 0.35s ease forwards;
}

.books-grid-new .book-card-new:nth-child(2)  { animation-delay: 0.05s; }
.books-grid-new .book-card-new:nth-child(3)  { animation-delay: 0.08s; }
.books-grid-new .book-card-new:nth-child(4)  { animation-delay: 0.11s; }
.books-grid-new .book-card-new:nth-child(5)  { animation-delay: 0.14s; }
.books-grid-new .book-card-new:nth-child(6)  { animation-delay: 0.17s; }
.books-grid-new .book-card-new:nth-child(n+7) { animation-delay: 0.2s; }

/* ============================================================
   GLOW BACKGROUND (subtle)
   ============================================================ */
.glow-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.glow-1 {
    position: absolute;
    top: -200px;
    right: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(190,22,29,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.glow-2 {
    position: absolute;
    bottom: -150px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0,182,163,0.04) 0%, transparent 70%);
    border-radius: 50%;
}

/* ============================================================
   DESKTOP LAYOUT (min-width: 768px)
   ============================================================ */
@media (min-width: 768px) {
    :root {
        --header-h: 64px;
    }

    body {
        padding-bottom: 20px;
    }

    /* Desktop header - single row */
    .app-header-inner {
        max-width: 1100px;
        margin: 0 auto;
        padding: 12px 24px;
        height: 64px;
    }

    .app-logo-text {
        font-size: 1.1rem;
    }

    .app-search-input {
        font-size: 0.9rem;
        height: 42px;
    }

    .category-chips-bar {
        display: none; /* On desktop, use nav links instead */
    }

    /* Desktop nav links row */
    .app-header::after {
        content: '';
        display: none;
    }

    /* Desktop body padding */
    .app-main {
        padding: 24px 24px 40px;
    }

    .books-grid-new {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    .book-card-image {
        padding-top: 140%;
    }

    .book-card-body {
        padding: 14px;
        gap: 6px;
    }

    .book-card-category { font-size: 0.72rem; }
    .book-card-title { font-size: 0.95rem; }
    .book-card-author { font-size: 0.8rem; }
    .price-current { font-size: 1rem; }

    .btn-add-cart {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .bottom-nav {
        display: none;
    }

    /* Desktop sidebar layout */
    .desktop-layout {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 24px;
        max-width: 1100px;
        margin: 0 auto;
    }
}

/* ============================================================
   LARGE SCREENS
   ============================================================ */
@media (min-width: 1100px) {
    .app-header-inner { max-width: 1200px; }
    .app-main { max-width: 1200px; }
    .books-grid-new {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* ============================================================
   DETAIL PAGE / BOOK PAGE STYLES
   ============================================================ */
.detail-header-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.detail-header-back i { color: var(--primary); }

/* ============================================================
   BACK-TO-STORE BAR — Used in book.php and filtered index views
   ============================================================ */
.back-to-store-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    max-width: 960px;
    margin: 0 auto;
    background: transparent;
}

.back-to-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 99px;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.back-to-store-btn:hover {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(190, 22, 29, 0.2);
}

.back-to-store-btn i { font-size: 0.75rem; }

.back-to-store-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(190, 22, 29, 0.05);
    border: 1px solid rgba(190, 22, 29, 0.12);
    padding: 4px 10px;
    border-radius: 99px;
}

/* Category filtered-view header bar (index.php) */
.category-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 10px 0 6px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}

.category-view-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
}

.category-view-title i { font-size: 0.9rem; }

@media (max-width: 480px) {
    .back-to-store-bar {
        padding: 6px 10px;
    }
    .back-to-store-btn {
        font-size: 0.72rem;
        padding: 5px 11px;
        gap: 5px;
    }
    .back-to-store-breadcrumb {
        font-size: 0.68rem;
        padding: 3px 8px;
        max-width: 48%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .category-view-header {
        gap: 0.5rem;
        padding: 6px 0 4px;
        margin-bottom: 0.7rem;
    }
    .category-view-title {
        font-size: 0.85rem;
    }
}

/* ===== Checkout Box & Desktop Layout System ===== */
.checkout-container {
    max-width: 1020px;
    margin: 1.5rem auto 3rem;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

.welcome-steps-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.83rem;
}

.checkout-fields-row {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Tablet & Desktop Layout (768px+) */
@media (min-width: 768px) {
    .checkout-container {
        max-width: 1020px !important;
        margin: 2rem auto 4rem !important;
        padding: 0 1rem !important;
        grid-template-columns: 1fr 370px !important;
        gap: 1.5rem !important;
    }

    .checkout-fields-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
    }

    .checkout-box {
        background: #FFFFFF;
        border: 1px solid rgba(226, 232, 240, 0.9);
        border-radius: 18px;
        padding: 1.8rem;
        box-shadow: 0 8px 30px rgba(15, 23, 42, 0.04);
    }

    .order-summary-box {
        background: #FFFFFF;
        border: 1px solid rgba(226, 232, 240, 0.9);
        border-radius: 18px;
        padding: 1.5rem;
        box-shadow: 0 8px 30px rgba(15, 23, 42, 0.04);
        position: sticky;
        top: 100px;
    }

    .payment-methods-grid {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .pay-method-card {
        padding: 0.85rem 1rem;
        border-radius: 12px;
        border: 1.5px solid #E2E8F0;
        transition: all 0.22s ease;
    }

    .pay-method-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 14px rgba(0,0,0,0.04);
    }

    .pay-method-card.selected {
        border-color: var(--accent);
        background: rgba(0, 182, 163, 0.04);
        box-shadow: 0 4px 14px rgba(0, 182, 163, 0.1);
    }
}

/* Summary Book Preview Card */
.summary-book-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #FAFBFD 0%, #F1F5F9 100%);
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.2rem;
}

.summary-book-cover {
    width: 58px;
    height: 78px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    background: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

.summary-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.summary-book-info {
    flex: 1;
    min-width: 0;
}

.summary-book-cat {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 2px;
}

.summary-book-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.summary-book-author {
    font-size: 0.76rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.summary-ijaza-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #B45309;
    background: #FEF3C7;
    padding: 2px 7px;
    border-radius: 4px;
    margin-top: 4px;
}

/* Trust Badges Bar */
.checkout-trust-badges {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 0.5rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px dashed #E2E8F0;
}

.trust-badge-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.trust-badge-item i {
    color: var(--accent);
    font-size: 0.9rem;
}

.checkout-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.checkout-box-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkout-box-title i { color: var(--primary); }

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 1.1rem;
    text-align: right;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ===== Premium Buttons ===== */
.btn-premium {
    background: var(--accent);
    color: white !important;
    padding: 0.75rem 1.8rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: 0 4px 12px rgba(0, 182, 163, 0.25);
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    text-decoration: none;
}

.btn-premium:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-outline {
    border: 1.5px solid var(--border);
    background: #FFFFFF;
    color: var(--text-primary);
    padding: 0.75rem 1.8rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.92rem;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

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

/* ===== Detail Page Layout ===== */
.detail-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin: 1rem;
}

@media (min-width: 768px) {
    .detail-container {
        grid-template-columns: 280px 1fr;
        gap: 2.5rem;
        padding: 2.5rem;
        margin: 2rem auto;
        max-width: 900px;
    }
}

.detail-image-box {
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
    aspect-ratio: 3/4;
    background: linear-gradient(145deg, #F7F4EE 0%, #EDE8DC 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: #C5A85C;
    overflow: hidden;
}

.detail-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-category {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.4rem;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.detail-author {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.detail-desc-box { margin-bottom: 1.2rem; }

.detail-desc-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.detail-desc-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.ijaza-highlight {
    background: rgba(197, 168, 92, 0.06);
    border-right: 4px solid #C5A85C;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.ijaza-highlight-title {
    font-weight: 800;
    color: #C5A85C;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.detail-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 1rem 1.2rem;
    border-radius: var(--radius-md);
    gap: 1rem;
}

@media (max-width: 480px) {
    .detail-action-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .detail-action-bar .btn-premium { width: 100%; }
}

.detail-price-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.2rem;
}

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

.detail-price del {
    font-size: 1rem;
    color: var(--primary);
    margin-left: 0.5rem;
    font-weight: bold;
}

/* ===== Rating Stars ===== */
.rating-stars {
    display: flex;
    gap: 2px;
    color: #FBBF24;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

/* ===== Dashboard / Order Panel ===== */
.dashboard-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.panel-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.7rem;
}

.panel-title i { color: var(--primary); }

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.88rem;
}

th {
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    font-weight: 800;
    border-bottom: 2px solid var(--border);
    font-size: 0.82rem;
    white-space: nowrap;
}

td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.85rem;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ===== Badges ===== */
.badge-status {
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
}

.status-paid   { background: #C6F6D5; color: #22543D; }
.status-pending { background: #FEFCBF; color: #744210; }
.status-rejected { background: #FED7D7; color: #9B2C2C; }

/* ===== Alerts ===== */
.alert-popup {
    background: #C6F6D5;
    border: 1px solid #38A169;
    color: #22543D;
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border-right: 4px solid #38A169;
    animation: fadeUp 0.3s ease forwards;
    font-size: 0.88rem;
}

.alert-popup.danger {
    background: #FED7D7;
    border: 1px solid #E53E3E;
    color: #9B2C2C;
    border-right: 4px solid #E53E3E;
}

/* ===== Modals ===== */
.edit-book-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.edit-book-modal.active {
    display: flex;
    animation: fadeUp 0.2s ease forwards;
}

.modal-content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

/* ===== Checkout Payment UI ===== */
.checkout-stepper {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.2rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.checkout-stepper .active-step {
    color: var(--text-primary);
    font-weight: 700;
}

.payment-methods-grid {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 1.2rem;
}

.pay-method-card {
    border: 1.5px solid var(--border);
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse;
}

.pay-method-card:hover { background: #EDF2F7; }
.pay-method-card.selected { border-color: var(--accent); background: var(--accent-light); }

.pay-method-name-wrapper {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.pay-method-radio {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.pay-method-logos {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pay-method-logos img { height: 18px; object-fit: contain; }

.payment-details-panel {
    display: none;
    border-top: 1px dashed var(--border);
    padding-top: 1.2rem;
    margin-top: 1.2rem;
}

.payment-details-panel.active {
    display: block;
    animation: fadeUp 0.3s ease;
}

.paymob-card-form {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    padding: 1rem;
    margin-bottom: 1rem;
}

.paymob-form-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.paymob-input-group {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #FFFFFF;
    margin-bottom: 0.7rem;
    position: relative;
    display: flex;
    align-items: center;
}

.paymob-input-group:focus-within {
    border-color: var(--accent);
}

.paymob-input-group i.input-icon {
    position: absolute;
    right: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.paymob-control {
    width: 100%;
    padding: 0.75rem 2rem 0.75rem 0.75rem;
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 0.88rem;
    background: transparent;
}

.card-brand-logos {
    position: absolute;
    left: 10px;
    display: flex;
    gap: 0.25rem;
}

.card-brand-logos img { height: 14px; object-fit: contain; }

.paymob-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
}

.paymob-row .paymob-input-group { margin-bottom: 0; }

.refund-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0.4rem 0.1rem;
    margin-bottom: 1.2rem;
}

.btn-paymob-pay {
    width: 100%;
    padding: 0.9rem;
    background: #3182CE;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-paymob-pay:hover { background: #2B6CB0; }

.paymob-brand-footer {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.8rem;
}

.paymob-brand-footer span { font-weight: 800; color: #3182CE; }

/* Order Summary */
.order-summary-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.summary-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coupon-container {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1.2rem;
    background: #FFFFFF;
}

.coupon-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 0.88rem;
}

.coupon-btn {
    padding: 0 1.2rem;
    background: var(--text-primary);
    color: white;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.coupon-btn:hover { background: var(--primary); }

.summary-table {
    width: 100%;
    margin-bottom: 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    background: #FFFFFF;
}

.summary-item:last-child { border-bottom: none; }
.summary-item.saved { background: #C6F6D5 !important; color: #22543D !important; font-weight: 700; }
.summary-item.shipping { color: var(--primary); font-weight: 700; }

.btn-confirm-order {
    width: 100%;
    padding: 1rem;
    background: #4A5568;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.2);
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font);
}

.btn-confirm-order:hover { background: #2D3748; }

.yellow-notice-box {
    background: #FEFCBF;
    border: 1px solid #F6E05E;
    color: #744210;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.6;
    margin-top: 1.2rem;
}

/* ===== Cursor ===== */
.cursor-pointer { cursor: pointer; }

/* ===== Modal Overlay Fix ===== */
.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ============================================================
   HERO PROMO BANNER (LIGHT 100% FULL-WIDTH EDGE TO EDGE)
   ============================================================ */
.hero-promo-section {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 2.5rem;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border-bottom: 2px solid var(--border);
    padding: 2.5rem 0 3rem;
}

.promo-banner-card {
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    background: transparent;
    border-radius: 0;
    padding: 0 2rem;
    color: var(--text-primary);
    box-shadow: none;
    border: none;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.promo-banner-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(190, 22, 29, 0.08) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.promo-content {
    max-width: 650px;
    z-index: 2;
}

.promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(190, 22, 29, 0.08);
    color: var(--primary-dark);
    border: 1px solid rgba(190, 22, 29, 0.2);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.promo-content h2 {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 0.8rem;
    color: var(--primary-dark);
}

.promo-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.promo-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.btn-hero-primary {
    background: var(--primary);
    color: #FFFFFF !important;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(190, 22, 29, 0.3);
    transition: var(--transition);
}

.btn-hero-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-hero-secondary {
    background: #FAFBFD;
    color: var(--text-primary) !important;
    border: 1.5px solid var(--border);
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-hero-secondary:hover {
    background: #EDF2F7;
}

.promo-visual-card {
    background: #FAFBFD;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    text-align: center;
    min-width: 200px;
    z-index: 2;
    box-shadow: var(--shadow-sm);
}

/* Feature boxes */
.features-grid {
    max-width: 1350px;
    margin: 1.5rem auto 0;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
}

.feature-item-box {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}

.feature-item-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.feature-item-box i {
    font-size: 1.6rem;
}

.feature-item-box strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.feature-item-box span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Category Sections */
.category-section-block {
    margin-bottom: 2.5rem;
}

.category-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--border);
}

.category-section-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

@media (max-width: 768px) {
    .promo-banner-card {
        flex-direction: column;
        padding: 1.5rem 1rem;
        text-align: center;
    }
    .promo-visual-card {
        display: none;
    }
    .promo-btns {
        justify-content: center;
    }
}

/* ===== HERO SVG WAVE DIVIDER & TICKER ===== */
.hero-svg-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 1;
}

.hero-svg-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 40px;
}

/* ===== TOP RED ANIMATED TICKER RIBBON (FIXED PINNED AT TOP) ===== */
.top-ticker-ribbon {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 36px;
    background: linear-gradient(90deg, #9B1118 0%, #BE161D 50%, #800A10 100%);
    color: #FFFFFF;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(190, 22, 29, 0.35);
    z-index: 10001;
    display: flex;
    align-items: center;
    direction: ltr; /* LTR coordinate track for accurate Left -> Right movement */
}

.top-ticker-content-track {
    display: flex;
    white-space: nowrap;
    width: max-content;
    animation: marqueeTickerTop 45s linear infinite;
    gap: 3.5rem;
}


.top-ticker-content-track:hover {
    animation-play-state: paused;
}

.top-ticker-content-track span {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    direction: rtl; /* RTL for correct Arabic text reading */
}

@keyframes marqueeTickerTop {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100vw);
    }
}



/* Red Accent Line below Hero Section */
.hero-red-accent-line {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 4px;
    background: linear-gradient(90deg, rgba(190, 22, 29, 0.1) 0%, #BE161D 50%, rgba(190, 22, 29, 0.1) 100%);
    margin-bottom: 2.5rem;
    box-shadow: 0 2px 10px rgba(190, 22, 29, 0.25);
}

/* Section Divider Title */
.section-divider-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin: 1.5rem 0 2.2rem;
}

.section-divider-title .divider-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--border-dark) 50%, transparent 100%);
}

.section-divider-title .divider-badge {
    background: #FFFFFF;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.55rem 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   HERO PROMO BANNER SLIDER (IMAGE CAROUSEL)
   ============================================================ */
/* ============================================================
   HERO PROMO BANNER SLIDER (IMAGE CAROUSEL)
   ============================================================ */
.hero-promo-slider-container {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 2.5rem;
    overflow: hidden;
    background: #0F172A;
    border-bottom: 3px solid var(--primary);
}

.hero-slider-track {
    position: relative;
    width: 100%;
}

.hero-slide-item {
    width: 100%;
    min-width: 100%;
    position: relative;
    height: 400px;
    display: none;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.hero-slide-item.active {
    display: flex;
    opacity: 1;
}

.hero-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.88) 0%, rgba(15, 23, 42, 0.5) 50%, rgba(15, 23, 42, 0.88) 100%);
}

.hero-slide-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    color: #FFFFFF;
    text-align: right;
}

.hero-slide-content .slide-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(190, 22, 29, 0.85);
    color: #FFFFFF;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(190, 22, 29, 0.4);
}

.hero-slide-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    line-height: 1.3;
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-slide-content p {
    font-size: 1.05rem;
    color: #E2E8F0;
    margin-bottom: 1.8rem;
    max-width: 650px;
    line-height: 1.6;
}

.hero-slide-btns {
    display: flex;
    gap: 1rem;
}

/* Hero Slide 3D Tactile CTA Button System */
.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(180deg, #E11D48 0%, #BE161D 100%);
    color: #FFFFFF !important;
    padding: 0.85rem 2.2rem;
    border-radius: 50px;
    font-weight: 900;
    font-size: 1.02rem;
    text-decoration: none !important;
    border: 2px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 6px 0 #800A10, 0 10px 25px rgba(190, 22, 29, 0.6), inset 0 2px 2px rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    line-height: 1;
    letter-spacing: 0.3px;
}

.btn-hero-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.6s ease;
}

.btn-hero-primary:hover::before {
    left: 100%;
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #800A10, 0 14px 30px rgba(225, 29, 72, 0.7), inset 0 2px 3px rgba(255, 255, 255, 0.6);
    background: linear-gradient(180deg, #F43F5E 0%, #E11D48 100%);
    color: #FFFFFF !important;
}

.btn-hero-primary:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #800A10, 0 4px 10px rgba(190, 22, 29, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-hero-primary i {
    font-size: 1.05rem;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.btn-hero-primary:hover i {
    transform: translateX(-5px) scale(1.15);
}

/* Like Heart Button System */
.book-like-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 12;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    padding: 0;
}

.book-like-btn:hover {
    transform: scale(1.15);
    color: #EF4444;
    background: #FFFFFF;
}

.book-like-btn.liked {
    background: #FFF1F2;
    color: #EF4444;
    border-color: #FECDD3;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.38);
}

.book-like-btn.liked i {
    animation: heartPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
    0% { transform: scale(0.6); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

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

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

.slider-dot.active {
    background: var(--primary);
    width: 32px;
    border-radius: 10px;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 5;
    transition: var(--transition);
}

.slider-arrow:hover {
    background: var(--primary);
    border-color: var(--primary);
}

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

@media (max-width: 768px) {
    .hero-slide-item { height: 320px; }
    .hero-slide-content h2 { font-size: 1.5rem; }
    .hero-slide-content p { font-size: 0.88rem; }
    .slider-arrow { display: none; }
}

/* ============================================================
   CATEGORY VISUAL CARDS GRID ("تصنيفات رئيسية")
   ============================================================ */
.category-visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-bottom: 3rem;
}

.cat-visual-card {
    background: #FFFFFF;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.8rem 1.2rem;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}

.cat-visual-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(190, 22, 29, 0.12);
}

.cat-visual-card .cat-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(190, 22, 29, 0.06);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.cat-visual-card:hover .cat-icon-circle {
    background: var(--primary);
    color: #FFFFFF;
    transform: scale(1.1);
}

.cat-visual-card h4 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.cat-visual-card span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ============================================================
   HADITH QUOTE BOX ("أقوال مأثورة")
   ============================================================ */
.quote-box-section {
    background: linear-gradient(135deg, #FAFBFD 0%, #F1F5F9 100%);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    margin: 3rem 0;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.quote-box-section i.fa-quote-right {
    font-size: 2.2rem;
    color: rgba(190, 22, 29, 0.15);
    margin-bottom: 0.8rem;
}

.quote-text {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.7;
    margin-bottom: 0.8rem;
}

.quote-author {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent);
}

/* ============================================================
   RICH ENHANCED FOOTER WITH SOCIAL & PAYMENTS
   ============================================================ */
.app-footer-enhanced {
    background: #0F172A;
    color: #94A3B8;
    margin-top: 4rem;
    padding-top: 0;
    border-top: 4px solid var(--primary);
}

.footer-newsletter-bar {
    background: linear-gradient(90deg, #9B1118 0%, #BE161D 50%, #800A10 100%);
    color: #FFFFFF;
    padding: 1.8rem 1.5rem;
}

.newsletter-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.newsletter-text {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.newsletter-text i {
    font-size: 2.5rem;
    color: #ECC94B;
}

.newsletter-text strong {
    display: block;
    font-size: 1.15rem;
    color: #FFFFFF;
}

.newsletter-text span {
    font-size: 0.88rem;
    color: #F8FAFC;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 480px;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1.2rem;
    border-radius: var(--radius-md);
    border: none;
    outline: none;
    font-size: 0.9rem;
}

.newsletter-form button {
    background: #ECC94B;
    color: #744210;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: #D69E2E;
}

.footer-body-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.8fr;
    gap: 2.5rem;
}

.footer-col-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.footer-col-brand .logo-icon {
    width: 42px;
    height: 42px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.footer-col-brand .footer-logo span {
    font-size: 1.3rem;
    font-weight: 800;
    color: #FFFFFF;
}

.footer-desc {
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: #94A3B8;
}

.footer-social-icons {
    display: flex;
    gap: 0.6rem;
}

.social-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-btn:hover {
    transform: translateY(-3px);
    color: white;
}

.social-btn.wa:hover { background: #25D366; }
.social-btn.tg:hover { background: #0088cc; }
.social-btn.yt:hover { background: #FF0000; }
.social-btn.fb:hover { background: #1877F2; }
.social-btn.ig:hover { background: #E4405F; }
.social-btn.tt:hover { background: #000000; }

.footer-col-links h4, .footer-col-payments h4 {
    color: #FFFFFF;
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.footer-col-links ul {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.footer-col-links a {
    color: #94A3B8;
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col-links a:hover {
    color: var(--primary);
    padding-right: 5px;
}

.footer-col-payments p {
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

.payment-badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.pay-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pay-badge.visa i { color: #6772E5; }
.pay-badge.mc i { color: #EB001B; }
.pay-badge.paypal i { color: #003087; }
.pay-badge.instapay i { color: #7B2CBF; }

.footer-bottom-copyright {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.2rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #64748B;
    background: #090D16;
}

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

@media (max-width: 600px) {
    .footer-body-inner {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   COMPREHENSIVE MOBILE RESPONSIVE — ALL SCREEN SIZES
   ============================================================ */

/* ── TABLET (481px – 767px) ── */
@media (min-width: 481px) and (max-width: 767px) {
    :root {
        --header-h: 84px; /* ticker 32 + header 52 */
        --bottom-nav-h: 60px;
    }

    body { font-size: 15px; }

    .app-header-inner { padding: 6px 12px; height: 52px; gap: 8px; }
    .app-logo-text { font-size: 0.85rem; }
    .app-search-input { font-size: 0.8rem; height: 34px; border-radius: 20px; }

    /* Compact header buttons on tablet */
    .hdr-btn { height: 32px; padding: 0 0.6rem; font-size: 0.78rem; border-radius: 16px; }
    .hdr-country-btn .hdr-currency-symbol { display: none; }
    .hdr-btn-text { font-size: 0.75rem; }

    /* Ticker smaller on tablet */
    .top-ticker-ribbon { height: 32px; }
    .top-ticker-content-track span { font-size: 0.78rem; }

    /* Category chips */
    .category-chips-bar { height: 46px; }
    .cat-chip { padding: 0.35rem 0.85rem; font-size: 0.76rem; }
}

/* ── MOBILE (≤480px) ── */
@media (max-width: 480px) {
    :root {
        --header-h: 74px; /* ticker 26 + header 48 */
        --bottom-nav-h: 50px;
    }

    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body {
        font-size: 13px;
        padding-top: var(--header-h);
        padding-bottom: calc(var(--bottom-nav-h) + 6px);
    }

    /* ── TICKER ── */
    .top-ticker-ribbon { height: 26px; }
    .top-ticker-content-track span { font-size: 0.68rem; gap: 0.25rem; }

    /* ── HEADER (Sleek Single-Row Mobile Header) ── */
    .app-header { top: 26px; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(12px); width: 100%; left: 0; right: 0; }
    .app-header-inner {
        padding: 3px 6px;
        height: 48px;
        gap: 4px;
        flex-wrap: nowrap;
    }

    /* Logo icon only on mobile to save space */
    .app-logo { gap: 0; text-decoration: none; flex-shrink: 0; }
    .app-logo-icon { width: 28px; height: 28px; font-size: 0.8rem; border-radius: 8px; }
    .app-logo-text { display: none; }

    /* Search bar auto-expands nicely */
    .app-search-form { flex: 1; min-width: 0; margin: 0 2px; }
    .app-search-wrapper { border-radius: 16px; background: #F1F5F9; border-color: #E2E8F0; }
    .app-search-input {
        height: 28px;
        font-size: 0.72rem;
        padding: 0 24px 0 20px;
    }
    .app-search-icon { font-size: 0.68rem; right: 6px; }
    .app-search-clear { left: 4px; width: 16px; height: 16px; font-size: 0.6rem; }

    /* Header action buttons: Compact Circular Icons System */
    .app-header-actions { gap: 3px; flex-shrink: 0; }

    .hdr-btn,
    .hdr-profile-btn,
    .hdr-login-btn,
    .hdr-reg-btn,
    .hdr-auth-btn,
    .hdr-logout-btn {
        width: 28px !important;
        height: 28px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        font-size: 0.78rem !important;
        justify-content: center !important;
        border-width: 1px;
    }

    /* Hide text labels & header fav button on mobile header */
    .hdr-country-name,
    .hdr-currency-symbol,
    .hdr-lang-name,
    .hdr-btn-text,
    .hdr-profile-btn .hdr-btn-text,
    .hdr-profile-btn span,
    .hdr-fav-btn {
        display: none !important;
    }

    .hdr-country-btn {
        background: #FFFFFF;
        border-color: #CBD5E1;
        box-shadow: 0 2px 5px rgba(0,0,0,0.04);
    }
    .hdr-country-btn .hdr-flag {
        font-size: 1.1rem;
        line-height: 1;
    }

    .hdr-lang-btn {
        background: #FFFFFF;
        border-color: #CBD5E1;
    }

    /* ── CATEGORY CHIPS ── */
    .category-chips-bar { height: 38px; }
    .category-chips-scroll { padding: 0 6px; gap: 4px; }
    .cat-chip {
        padding: 0.25rem 0.65rem;
        font-size: 0.68rem;
        gap: 3px;
        border-radius: 99px;
    }
    .cat-chip i { font-size: 0.62rem; }

    /* ── MAIN CONTENT ── */
    .app-main { padding: 6px 6px 12px; max-width: 100%; overflow-x: hidden; }

    /* ── HERO SLIDER (EDGE-TO-EDGE FULL WIDTH ON MOBILE) ── */
    .hero-promo-slider-container {
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    .hero-slider-track {
        width: 100% !important;
    }

    .hero-slide-item {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: 200px !important;
    }

    .hero-slide-overlay {
        background: linear-gradient(90deg, rgba(10, 18, 35, 0.92) 0%, rgba(10, 18, 35, 0.6) 60%, rgba(10, 18, 35, 0.85) 100%);
    }

    .hero-slide-content {
        padding: 0.85rem 1.2rem !important;
        text-align: right !important;
    }

    .hero-slide-content .slide-badge {
        font-size: 0.62rem;
        padding: 0.2rem 0.55rem;
        margin-bottom: 0.35rem;
    }
    .hero-slide-content h2 {
        font-size: 0.96rem;
        margin-bottom: 0.3rem;
        line-height: 1.3;
    }
    .hero-slide-content p {
        font-size: 0.7rem;
        margin-bottom: 0.65rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .hero-slide-btns { gap: 0.4rem; flex-wrap: wrap; }
    .btn-hero-primary {
        font-size: 0.78rem !important;
        padding: 0.5rem 1.2rem !important;
        border-radius: 30px !important;
        gap: 0.45rem !important;
        box-shadow: 0 4px 0 #800A10, 0 6px 16px rgba(190, 22, 29, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
        border: 1.5px solid rgba(255, 255, 255, 0.5) !important;
        font-weight: 900 !important;
    }
    .btn-hero-secondary {
        font-size: 0.65rem;
        padding: 0.32rem 0.65rem;
        border-radius: 7px;
    }
    .slider-dots { bottom: 8px; gap: 4px; }
    .slider-dot { width: 6px; height: 6px; }
    .slider-dot.active { width: 18px; }

    /* ── RED ACCENT LINE ── */
    .hero-red-accent-line { height: 2px; margin-bottom: 1rem; }

    /* ── SECTION DIVIDER ── */
    .section-divider-title {
        margin: 0.8rem 0 1rem;
        gap: 0.4rem;
    }
    .section-divider-title .divider-badge {
        font-size: 0.72rem;
        padding: 0.3rem 0.75rem;
        gap: 0.3rem;
        border-radius: 99px;
    }

    /* ── CATEGORY VISUAL GRID ── */
    .category-visual-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.45rem;
        margin-bottom: 1.2rem;
    }
    .cat-visual-card {
        padding: 0.7rem 0.5rem;
        border-radius: 12px;
    }
    .cat-visual-card .cat-icon-circle {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin-bottom: 0.45rem;
    }
    .cat-visual-card h4 { font-size: 0.74rem; margin-bottom: 0.1rem; }
    .cat-visual-card span { font-size: 0.6rem; }

    /* ── SORT BAR ── */
    .sort-bar {
        padding: 7px 10px;
        border-radius: 10px;
        margin-bottom: 10px;
    }
    .sort-bar-label { font-size: 0.76rem; gap: 4px; }
    .sort-count { font-size: 0.72rem; }
    .sort-select { font-size: 0.73rem; padding: 4px 7px; }

    /* ── BOOKS GRID — Compact 2-column for search/filtered views ── */
    .books-grid-new {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    /* ── SINGLE-ROW HORIZONTAL SCROLL FOR CATEGORY SECTIONS ON MOBILE (SLIGHTLY LARGER BOOKS) ── */
    #catalog-sections .books-grid-new {
        display: flex !important;
        grid-template-columns: none !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        gap: 9px !important;
        padding-bottom: 6px !important;
        padding-top: 2px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none;
    }

    #catalog-sections .books-grid-new::-webkit-scrollbar {
        display: none;
    }

    #catalog-sections .books-grid-new .book-card-new {
        flex: 0 0 146px !important;
        width: 146px !important;
        min-width: 146px !important;
        max-width: 146px !important;
        scroll-snap-align: start !important;
    }

    .book-card-new { border-radius: 12px; }
    .book-card-image { padding-top: 125%; }
    .book-card-body { padding: 6px 7px 7px 7px; gap: 2px; }

    .book-card-category { font-size: 0.55rem; letter-spacing: 0; }
    .book-card-title {
        font-size: 0.72rem;
        line-height: 1.25;
        font-weight: 800;
        -webkit-line-clamp: 2;
    }
    .book-card-author { font-size: 0.62rem; margin-top: 0; gap: 2px; color: #64748B; }
    .book-card-author i { font-size: 0.58rem; }

    .book-card-price-row { padding-top: 3px; margin-top: 2px; }
    .price-current { font-size: 0.68rem; font-weight: 900; }
    .price-old { font-size: 0.52rem; }
    .btn-add-cart { width: 21px; height: 21px; font-size: 0.6rem; border-radius: 5px; }

    /* Discount / Ijaza badges */
    .badge-discount { font-size: 0.52rem; padding: 1px 4px; top: 3px; right: 3px; border-radius: 4px; }
    .badge-ijaza { width: 16px; height: 16px; font-size: 0.5rem; top: 3px; left: 3px; }

    /* ── CATEGORY SECTION HEADERS ── */
    .category-section-header { margin-bottom: 0.45rem; padding-bottom: 0.25rem; }
    .category-section-header h3 { font-size: 0.82rem; gap: 0.3rem; }
    .category-section-block { margin-bottom: 1rem; }

    /* ── QUOTE BOX ── */
    .quote-box-section { padding: 1.2rem 1rem; margin: 1.5rem 0; }
    .quote-text { font-size: 0.95rem; }
    .quote-author { font-size: 0.78rem; }

    /* ── BOTTOM NAV ── */
    .bottom-nav { height: var(--bottom-nav-h); }
    .bottom-nav-item { font-size: 0.6rem; padding: 6px 4px 8px; gap: 2px; }
    .bottom-nav-item i { font-size: 1.1rem; }

    /* ── FOOTER ── */
    .footer-newsletter-bar { padding: 1.2rem 1rem; }
    .newsletter-inner { flex-direction: column; text-align: center; gap: 0.8rem; }
    .newsletter-text i { font-size: 1.8rem; }
    .newsletter-text strong { font-size: 0.95rem; }
    .newsletter-text span { font-size: 0.78rem; }
    .newsletter-form { width: 100%; max-width: 100%; gap: 0.4rem; }
    .newsletter-form input { font-size: 0.82rem; padding: 0.6rem 0.8rem; }
    .newsletter-form button { padding: 0.6rem 1rem; font-size: 0.82rem; }

    .footer-body-inner {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 1.5rem 1rem 1rem;
    }
    .footer-col-brand .footer-logo span { font-size: 1.1rem; }
    .footer-desc { font-size: 0.82rem; margin-bottom: 0.8rem; }
    .footer-col-links h4, .footer-col-payments h4 { font-size: 0.9rem; }
    .footer-col-links a { font-size: 0.82rem; }
    .payment-badges-grid { gap: 0.4rem; }
    .pay-badge { font-size: 0.75rem; padding: 0.4rem 0.7rem; }
    .footer-bottom-copyright { font-size: 0.75rem; padding: 1rem; }

    /* ── EMPTY STATE ── */
    .empty-state { padding: 2rem 1rem; }
    .empty-state-icon { width: 55px; height: 55px; font-size: 1.4rem; }
    .empty-state h3 { font-size: 0.95rem; }
    .btn-primary-full { padding: 0.6rem 1.5rem; font-size: 0.85rem; }

    /* ── CHECKOUT PAGE COMPACT MOBILE RESPONSIVE ── */
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 4px;
        margin: 6px auto 20px;
    }

    .checkout-box, .order-summary-box {
        padding: 0.9rem 0.8rem !important;
        border-radius: 16px !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.03) !important;
    }

    .checkout-stepper {
        padding: 0.45rem 0.75rem !important;
        font-size: 0.73rem !important;
        gap: 0.35rem !important;
        margin-bottom: 0.8rem !important;
    }

    .checkout-box-title {
        font-size: 0.92rem !important;
        margin-bottom: 0.65rem !important;
    }

    .form-group {
        margin-bottom: 0.8rem !important;
    }

    .form-group label {
        font-size: 0.76rem !important;
        margin-bottom: 0.25rem !important;
    }

    .form-control {
        height: 38px !important;
        font-size: 0.8rem !important;
        padding: 0 10px !important;
        border-radius: 10px !important;
    }

    .payment-methods-grid {
        gap: 0.5rem !important;
        margin-bottom: 0.8rem !important;
    }

    .pay-method-card {
        padding: 0.6rem 0.75rem !important;
        border-radius: 12px !important;
    }

    .pay-method-name-wrapper .method-name {
        font-size: 0.8rem !important;
    }

    .payment-details-panel {
        padding-top: 0.75rem !important;
        margin-top: 0.75rem !important;
    }

    .paymob-card-form {
        padding: 0.8rem !important;
        border-radius: 12px !important;
    }

    .btn-confirm-order {
        padding: 0.8rem !important;
        font-size: 0.9rem !important;
        border-radius: 12px !important;
    }

    .yellow-notice-box {
        padding: 0.65rem 0.8rem !important;
        font-size: 0.74rem !important;
        margin-top: 0.85rem !important;
    }
}


/* ── VERY SMALL MOBILE (≤380px — iPhone SE, Galaxy S21 Ultra small) ── */
@media (max-width: 380px) {
    :root {
        --header-h: 84px;
        --bottom-nav-h: 58px;
    }

    .app-header-inner { height: 48px; padding: 4px 8px; gap: 5px; }
    .app-logo-text { display: none; } /* hide text, show icon only */
    .app-logo-icon { width: 28px; height: 28px; font-size: 0.8rem; }
    .app-search-input { height: 30px; font-size: 0.72rem; }
    .app-icon-btn { width: 28px; height: 28px; font-size: 0.82rem; }

    .top-ticker-ribbon { height: 30px; }
    .top-ticker-content-track span { font-size: 0.7rem; }
    .app-header { top: 30px; }

    .category-chips-bar { height: 40px; }
    .cat-chip { padding: 0.26rem 0.65rem; font-size: 0.68rem; }

    .hero-slide-item { height: 185px; }
    .hero-slide-content h2 { font-size: 0.92rem; }
    .hero-slide-content p { display: none; }
    .btn-hero-primary { font-size: 0.7rem; padding: 0.4rem 0.7rem; }
    .btn-hero-secondary { display: none; }

    .books-grid-new { gap: 6px; }
    .book-card-body { padding: 6px; }
    .book-card-title { font-size: 0.68rem; }
    .price-current { font-size: 0.72rem; }
    .btn-add-cart { width: 24px; height: 24px; font-size: 0.65rem; }

    .category-visual-grid { gap: 5px; }
    .cat-visual-card { padding: 0.8rem 0.5rem; border-radius: 12px; }
    .cat-visual-card .cat-icon-circle { width: 36px; height: 36px; font-size: 1rem; margin-bottom: 0.4rem; }
    .cat-visual-card h4 { font-size: 0.72rem; }
    .cat-visual-card span { display: none; }

    .sort-bar { padding: 5px 8px; }
    .sort-bar-label { font-size: 0.7rem; }
    .sort-select { font-size: 0.68rem; padding: 3px 5px; }

    .bottom-nav-item { font-size: 0.56rem; padding: 5px 3px 7px; }
    .bottom-nav-item i { font-size: 1rem; }

    /* Section titles */
    .section-divider-title .divider-badge { font-size: 0.73rem; padding: 0.32rem 0.8rem; }
    .category-section-header h3 { font-size: 0.88rem; }
}

/* ── DESKTOP — ensure no bottom nav, proper layout ── */
@media (min-width: 768px) {
    :root {
        --header-h: 100px;
    }

    body { padding-top: 100px; padding-bottom: 20px; }

    .top-ticker-ribbon { display: flex; height: 36px; top: 0; left: 0; right: 0; z-index: 10001; }
    .app-header, .auth-top-bar { top: 36px; z-index: 9999; }

    .app-header-inner {
        max-width: 1200px;
        margin: 0 auto;
        padding: 12px 28px;
        height: 64px;
    }

    .app-logo-text { font-size: 1.05rem; }
    .app-search-input { font-size: 0.9rem; height: 42px; }
    .app-icon-btn { width: 40px; height: 40px; font-size: 1.05rem; }

    .category-chips-bar { display: none; }

    .app-main {
        max-width: 1200px;
        margin: 0 auto;
        padding: 24px 24px 40px;
    }

    .books-grid-new {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 18px;
    }

    .book-card-image { padding-top: 140%; }
    .book-card-body { padding: 14px; gap: 6px; }
    .book-card-title { font-size: 0.95rem; }
    .book-card-author { font-size: 0.8rem; }
    .price-current { font-size: 1rem; }
    .btn-add-cart { width: 36px; height: 36px; font-size: 0.95rem; }
    .badge-discount { font-size: 0.72rem; }
    .badge-ijaza { width: 26px; height: 26px; font-size: 0.75rem; }

    .bottom-nav { display: none; }

    /* Desktop hero */
    .hero-slide-item { height: 420px; }
    .hero-slide-content h2 { font-size: 2.4rem; }
    .hero-slide-content p { font-size: 1.1rem; }

    /* Category visual grid – desktop */
    .category-visual-grid { grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
    .cat-visual-card { padding: 1.8rem 1.2rem; }
    .cat-visual-card .cat-icon-circle { width: 64px; height: 64px; font-size: 1.8rem; }
    .cat-visual-card h4 { font-size: 1.1rem; }
    .cat-visual-card span { font-size: 0.8rem; }

    /* Category section header larger */
    .category-section-header h3 { font-size: 1.3rem; }

    /* Footer */
    .footer-body-inner { grid-template-columns: 2fr 1fr 1fr 1.8fr; }
}

/* ── LARGE DESKTOP (1100px+) ── */
@media (min-width: 1100px) {
    .books-grid-new {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* ============================================================
   RESPONSIVE USER INVOICES & ORDERS TABLE SYSTEM (.table-cards)
   ============================================================ */
.table-cards {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-cards th {
    background: #F8FAFC;
    color: #475569;
    font-weight: 800;
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1.5px solid #E2E8F0;
    font-size: 0.85rem;
}

.table-cards td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}

/* Mobile Stacking (< 768px) - Turns table into clean compact stacked cards */
@media (max-width: 767px) {
    .table-cards, 
    .table-cards tbody, 
    .table-cards tr, 
    .table-cards td {
        display: block;
        width: 100%;
    }

    .table-cards thead {
        display: none;
    }

    .table-cards tr {
        background: #FFFFFF;
        border: 1.5px solid #E2E8F0;
        border-radius: 14px;
        margin-bottom: 0.85rem;
        padding: 0.85rem 1rem;
        box-shadow: 0 3px 10px rgba(0,0,0,0.03);
    }

    .table-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.55rem 0;
        border-bottom: 1px dashed #F1F5F9;
        text-align: left;
    }

    .table-cards td:last-child {
        border-bottom: none;
        padding-top: 0.75rem;
        justify-content: center;
    }

    .table-cards td::before {
        content: attr(data-label);
        font-weight: 800;
        color: #64748B;
        font-size: 0.82rem;
        text-align: right;
        margin-left: 0.5rem;
        flex-shrink: 0;
    }
}

/* ==========================================================================
   GLOBAL ULTRA-COMPACT MOBILE RESPONSIVE ENGINE (Down to 320px)
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --header-height: 52px;
    }
    
    body {
        padding-top: 72px !important;
        font-size: 0.82rem !important;
        line-height: 1.5 !important;
    }
    
    /* Compact Container Spacing */
    .app-main, .container, main, .auth-container, .admin-container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        margin-top: 0.5rem !important;
    }
    
    /* Compact Cards & Containers */
    .card, .auth-card, .admin-card, .book-card, .order-card, .checkout-card {
        padding: 0.75rem 0.65rem !important;
        border-radius: 14px !important;
    }
    
    /* Compact Typography */
    h1, .hero-title {
        font-size: 1.15rem !important;
    }
    h2, .section-title {
        font-size: 1.02rem !important;
    }
    h3 {
        font-size: 0.88rem !important;
    }
    h4 {
        font-size: 0.82rem !important;
    }
    
    /* Compact Buttons */
    .btn, .btn-primary, .btn-hero-primary, .btn-premium, .hdr-btn {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.78rem !important;
        border-radius: 8px !important;
    }
    
    /* Compact Form Inputs */
    .form-control, input[type="text"], input[type="password"], input[type="tel"], input[type="email"], select, textarea {
        font-size: 16px !important; /* Prevents auto zoom on mobile */
        padding: 0.55rem 0.75rem !important;
        border-radius: 10px !important;
    }
    
    /* Compact Grid Spacing */
    .books-grid, .grid-container {
        gap: 0.6rem !important;
    }
    
    /* Compact Product Card (Store) */
    .book-card {
        margin-bottom: 0.6rem !important;
    }
    .book-card-title {
        font-size: 0.88rem !important;
        margin-bottom: 0.25rem !important;
    }
    .book-card-author {
        font-size: 0.75rem !important;
    }
    .book-card-price {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 68px !important;
    }
    .app-header-inner, .nav-container {
        padding: 0.25rem 0.4rem !important;
    }
    .app-logo-text, .logo-text {
        font-size: 0.85rem !important;
    }
    .app-logo-icon, .logo-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.85rem !important;
    }
    .auth-container, .login-box, .register-box {
        max-width: 100% !important;
        margin: 0 auto !important;
    }
}

/* ===== HERO BANNER AUDIO PLAYER STYLING (Protected & Live Playback) ===== */
.hero-audio-player-card {
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(226, 232, 240, 0.25);
    border-radius: 18px;
    padding: 1.1rem 1.4rem;
    margin-top: 1.2rem;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
    transition: all 0.3s ease;
    text-align: right;
    box-sizing: border-box;
}

.hero-audio-player-card:hover {
    border-color: rgba(226, 232, 240, 0.45);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.audio-player-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
}

.audio-pulse-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, #991B1B 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(190, 22, 29, 0.4);
    flex-shrink: 0;
}

.audio-title-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.audio-title-info strong {
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 800;
}

.audio-title-info span {
    color: #94A3B8;
    font-size: 0.78rem;
}

.audio-protected-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #F8FAFC;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.72rem;
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.custom-audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.22s ease;
    flex-shrink: 0;
}

.audio-play-btn:hover {
    transform: scale(1.08);
    background: #FFF5F5;
    box-shadow: 0 8px 25px rgba(190, 22, 29, 0.35);
}

.audio-progress-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.audio-time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #CBD5E1;
    font-size: 0.76rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.sound-wave-bars {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 16px;
}

.sound-wave-bars span {
    width: 3px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.sound-wave-bars.playing span {
    background: #EF4444;
    animation: soundWave 0.8s ease-in-out infinite alternate;
}

.sound-wave-bars.playing span:nth-child(1) { animation-delay: 0.1s; }
.sound-wave-bars.playing span:nth-child(2) { animation-delay: 0.3s; }
.sound-wave-bars.playing span:nth-child(3) { animation-delay: 0.5s; }
.sound-wave-bars.playing span:nth-child(4) { animation-delay: 0.2s; }
.sound-wave-bars.playing span:nth-child(5) { animation-delay: 0.4s; }

@keyframes soundWave {
    0% { height: 4px; }
    100% { height: 16px; }
}

.audio-seek-bar {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
    height: 5px;
    border-radius: 3px;
}

/* Mobile Ultra-Compact Styling for Hero Audio Player Card */
@media (max-width: 768px) {
    .hero-slide-item {
        height: auto !important;
        min-height: 230px !important;
        padding: 0.5rem 0 !important;
    }

    .hero-audio-player-card {
        padding: 0.5rem 0.75rem !important;
        margin-top: 0.4rem !important;
        border-radius: 12px !important;
        border-width: 1px !important;
        max-width: 100% !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    }

    .audio-player-header {
        gap: 0.5rem !important;
        margin-bottom: 0.35rem !important;
    }

    .audio-pulse-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
        border-radius: 8px !important;
    }

    .audio-title-info strong {
        font-size: 0.76rem !important;
        line-height: 1.2 !important;
    }

    .audio-title-info span {
        font-size: 0.62rem !important;
        line-height: 1.2 !important;
    }

    .audio-protected-badge {
        font-size: 0.58rem !important;
        padding: 0.12rem 0.4rem !important;
    }

    .custom-audio-controls {
        gap: 0.55rem !important;
    }

    .audio-play-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
        box-shadow: 0 3px 10px rgba(0,0,0,0.2) !important;
    }

    .audio-time-row {
        font-size: 0.65rem !important;
    }

    .audio-seek-bar {
        height: 4px !important;
    }
}


