/* ============================================
   TriniBooks - Premium Christian Bookstore
   Color Palette: Deep Navy + Warm Gold + Cream
   ============================================ */

:root {
    --navy: #1B2A4A;
    --navy-light: #2C3E6B;
    --navy-dark: #0F1B33;
    --gold: #C8A951;
    --gold-light: #E8D48B;
    --gold-dark: #A68B3C;
    --cream: #FDF8F0;
    --cream-dark: #F5EDE0;
    --warm-white: #FEFCF9;
    --text-dark: #1A1A2E;
    --text-body: #3D3D5C;
    --text-muted: #6B7280;
    --border-light: #E8E0D4;
    --success: #2D8B4E;
    --danger: #C0392B;
    --warning: #D4A017;
    --info: #2980B9;
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow-sm: 0 2px 8px rgba(27, 42, 74, 0.06);
    --shadow-md: 0 4px 16px rgba(27, 42, 74, 0.08);
    --shadow-lg: 0 8px 32px rgba(27, 42, 74, 0.12);
    --shadow-hover: 0 12px 40px rgba(27, 42, 74, 0.15);
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Base ---- */
body {
    font-family: var(--font-body);
    color: var(--text-body);
    background-color: var(--warm-white);
    font-size: 0.95rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .hero-title, .section-title, .navbar-brand {
    font-family: var(--font-heading);
    color: var(--navy);
    font-weight: 600;
}

a { color: var(--navy); transition: var(--transition); }
a:hover { color: var(--gold-dark); }

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

/* ---- Bootstrap Overrides ---- */
.btn-primary {
    background: var(--navy);
    border-color: var(--navy);
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--navy-light);
    border-color: var(--navy-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    color: var(--navy);
    border-color: var(--navy);
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
}
.btn-outline-primary:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
    transform: translateY(-1px);
}

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

.btn-light {
    background: #fff;
    color: var(--navy);
    font-weight: 600;
    border-radius: var(--radius);
}
.btn-light:hover {
    background: var(--cream);
    color: var(--navy-dark);
}

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

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn-sm {
    border-radius: 0.5rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
}

.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    background: #fff;
}

.badge {
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 0.35em 0.7em;
    border-radius: 0.5rem;
}

.alert {
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
}

.form-control, .form-select {
    border-radius: 0.5rem;
    border-color: var(--border-light);
    padding: 0.6rem 0.9rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
}

.table th {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom-width: 2px;
}

/* ---- Top Bar ---- */
.top-bar {
    background: var(--navy-dark) !important;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    border-bottom: 2px solid var(--gold);
}
.top-bar .bi-quote { color: var(--gold-light); }

/* ---- Navbar ---- */
.navbar {
    background: #fff !important;
    padding: 0.75rem 0;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy) !important;
    letter-spacing: -0.01em;
}
.navbar-brand i {
    color: var(--gold) !important;
    margin-right: 0.3rem;
}
.brand-text {
    font-family: var(--font-heading);
    color: var(--navy);
}

.navbar .nav-link {
    color: var(--text-body);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
}
.navbar .nav-link:hover {
    color: var(--gold-dark);
}

.search-form {
    max-width: 420px;
    width: 100%;
}
.search-form .form-control {
    border-radius: 2rem 0 0 2rem;
    border-right: none;
    padding-left: 1.25rem;
    background: var(--cream);
    border-color: var(--border-light);
}
.search-form .form-control:focus {
    background: #fff;
    border-color: var(--gold);
}
.search-form .btn {
    border-radius: 0 2rem 2rem 0;
    background: var(--navy);
    border-color: var(--navy);
    padding: 0.5rem 1rem;
}
.search-form .btn:hover {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
}

/* ---- Category Nav ---- */
.category-nav {
    background: var(--cream) !important;
    border-bottom: 1px solid var(--border-light) !important;
}
.category-nav .nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-body) !important;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    transition: var(--transition);
}
.category-nav .nav-link:hover {
    color: var(--navy) !important;
    background: rgba(27, 42, 74, 0.06);
}

/* ---- Hero Section ---- */
.hero-section {
    padding: 2.5rem 0;
}
.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--navy);
}
.hero-title .text-primary {
    color: var(--gold-dark) !important;
}
.hero-subtitle {
    line-height: 1.8;
    color: var(--text-muted);
    font-size: 1.05rem;
}
.hero-actions .btn {
    margin-bottom: 0.5rem;
}
.hero-stats h4 { color: var(--gold-dark) !important; }

/* Scripture card on hero */
.hero-section .card.bg-primary {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%) !important;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ---- Section Titles ---- */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
    position: relative;
}
.section-title i {
    color: var(--gold);
}

/* ---- Book Cards ---- */
.book-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    background: #fff;
}
.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--gold-light);
}

.book-cover-wrapper {
    height: 260px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    position: relative;
}
.book-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.book-card:hover .book-cover {
    transform: scale(1.06);
}
.book-cover-placeholder {
    height: 260px;
    background: var(--cream);
}

.book-title {
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--navy);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-group {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}
.price-group .fw-bold {
    color: var(--navy) !important;
}

.book-card .badge {
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
}
.book-card .badge.bg-danger {
    background: var(--danger) !important;
}
.book-card .badge.bg-success {
    background: var(--success) !important;
}

.book-card .btn-primary {
    background: var(--navy);
    border-color: var(--navy);
    font-size: 0.82rem;
    padding: 0.8rem 0.75rem;
    border-radius: 0.5rem;
}
.book-card .btn-primary:hover {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
}

/* ---- Category Cards ---- */
.category-hover {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    background: #fff;
}
.category-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--gold-light);
}
.category-hover i {
    color: var(--gold-dark) !important;
    transition: var(--transition);
}
.category-hover:hover i {
    color: var(--navy) !important;
    transform: scale(1.1);
}

/* ---- Star Rating ---- */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}
.star-rating i {
    font-size: 0.85rem;
    color: var(--gold) !important;
}

/* Rating Input */
.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
}
.rating-input input { display: none; }
.rating-input label {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ddd;
    transition: color 0.15s;
}
.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input:checked ~ label {
    color: var(--gold);
}

/* ---- Book Detail ---- */
.book-detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
}

.book-desc-text {
    line-height: 1.85;
    color: var(--text-body);
}

/* ---- Promo Banner ---- */
.promo-banner .card {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%) !important;
    border: none;
    border-radius: var(--radius-lg);
}

/* ---- Pagination ---- */
.pagination .page-link {
    border-radius: 0.5rem;
    margin: 0 3px;
    border: 1px solid var(--border-light);
    color: var(--navy);
    font-weight: 500;
    transition: var(--transition);
}
.pagination .page-link:hover {
    background: var(--cream);
    border-color: var(--gold-light);
    color: var(--navy);
}
.pagination .page-item.active .page-link {
    background: var(--navy);
    border-color: var(--navy);
}

/* ---- Footer ---- */
.footer {
    background: var(--navy-dark) !important;
    margin-top: 3rem;
    border-top: 3px solid var(--gold);
}
.footer-heading {
    font-family: var(--font-heading);
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}
.footer-links a:hover {
    color: var(--gold-light);
    padding-left: 4px;
}
.social-links a {
    color: rgba(255,255,255,0.5);
    transition: var(--transition);
}
.social-links a:hover { color: var(--gold-light) !important; }

/* ---- Review Item ---- */
.review-item { border-color: var(--border-light) !important; }
.review-item:last-child { border-bottom: none !important; }

/* ---- Cards & Shadows ---- */
.card.border-0 {
    border: 1px solid var(--border-light) !important;
}
.card.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}
.card.shadow-sm:hover {
    box-shadow: var(--shadow-md) !important;
}

/* ---- Auth Pages ---- */
.card .card-body h3 {
    color: var(--navy);
}

/* ---- Breadcrumb ---- */
.breadcrumb-item a {
    color: var(--navy);
    text-decoration: none;
}
.breadcrumb-item a:hover {
    color: var(--gold-dark);
}

/* ---- Blockquote (Scripture) ---- */
blockquote {
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--navy);
}
.blockquote-footer {
    color: var(--gold-dark);
    font-family: var(--font-body);
    font-style: normal;
}

/* ---- Admin Sidebar ---- */
.admin-sidebar {
    background: var(--navy-dark) !important;
    border-right: 2px solid var(--gold);
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.65);
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background: rgba(200, 169, 81, 0.15);
}
.admin-content {
    background: var(--cream) !important;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-image-wrapper { margin-top: 2rem; }
    .book-cover-wrapper { height: 200px; }
    .search-form { max-width: 100%; margin: 0.5rem 0; }
    .top-bar .col-md-6:last-child { display: none; }
    .section-title { font-size: 1.3rem; }
}

@media (max-width: 576px) {
    .hero-title { font-size: 1.65rem; }
    .book-cover-wrapper { height: 180px; }
    .hero-stats { display: none; }
    .category-nav { display: none !important; }
}

/* ---- Smooth Scroll ---- */
html { scroll-behavior: smooth; }

/* ---- Focus Accessibility ---- */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* ---- Loading / Back to Top ---- */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ---- Misc ---- */
.text-primary { color: var(--navy) !important; }
.bg-primary { background-color: var(--navy) !important; }
.text-warning { color: var(--gold) !important; }
.bg-light { background-color: var(--cream) !important; }
.border-bottom { border-color: var(--border-light) !important; }

/* Gold accent for special elements */
.text-gold { color: var(--gold); }
.bg-gold { background-color: var(--gold); }

/* Smooth page transitions */
.main-content {
    animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Premium list group */
.list-group-item {
    border-color: var(--border-light);
    transition: var(--transition);
}
.list-group-item:hover {
    background: var(--cream);
}
.list-group-item.active {
    background: var(--navy);
    border-color: var(--navy);
}

/* Dropdown */
.dropdown-menu {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 1050;
}
.dropdown-item:hover {
    background: var(--cream);
    color: var(--navy);
}

/* ============================================
   MEGA MENU
   ============================================ */
.mega-nav {
    background: #fcfcfc;
    border-bottom: 1px solid var(--border-light);
    border-top: 1px solid #e8dfd466;
    position: relative;
    z-index: 1019;
}

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

.mega-nav-item {
    position: relative;
}

.mega-nav-link {
    display: block;
    padding: 0.7rem 1rem;
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}
.mega-nav-link:hover {
    color: var(--navy);
    border-bottom-color: var(--gold);
}
.mega-nav-link .bi-chevron-down {
    font-size: 0.65rem;
    margin-left: 2px;
    opacity: 0.5;
}

.mega-nav-sale {
    color: #C0392B !important;
    font-weight: 600;
}
.mega-nav-sale:hover {
    border-bottom-color: #C0392B;
}

/* Dropdown Panel */
.mega-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--border-light);
    border-top: 2px solid var(--gold);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 1050;
    min-width: 680px;
    padding: 0;
}

.mega-dropdown-sm {
    min-width: 240px;
}

.mega-nav-item:hover > .mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-dropdown-inner {
    display: flex;
    padding: 1.25rem 1.5rem;
    gap: 1.5rem;
}

.mega-dropdown-sm .mega-dropdown-inner {
    flex-direction: column;
    gap: 0;
    padding: 0.75rem 0;
}

/* Columns */
.mega-col {
    min-width: 0;
    flex: 1;
}

.mega-col-highlight {
    background: var(--cream);
    margin: -1.25rem -1.5rem -1.25rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: 0 0 var(--radius) 0;
}

.mega-heading {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-light);
}

/* Links inside mega menu */
.mega-col a,
.mega-dropdown-sm a {
    display: block;
    padding: 0.3rem 0;
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}
.mega-dropdown-sm .mega-dropdown-inner a {
    padding: 0.4rem 1.25rem;
}

.mega-col a:hover,
.mega-dropdown-sm a:hover {
    color: var(--navy);
    padding-left: 4px;
}
.mega-dropdown-sm .mega-dropdown-inner a:hover {
    background: var(--cream);
    padding-left: 1.5rem;
    color: var(--navy);
}

.mega-link-featured {
    font-weight: 500;
}
.mega-link-featured i {
    width: 20px;
    color: var(--gold-dark);
}

.mega-link-all {
    font-weight: 600;
    color: var(--navy) !important;
}
.mega-link-all:hover {
    color: var(--gold-dark) !important;
}

/* Prevent dropdown from closing when moving mouse to it */
.mega-nav-item:hover > .mega-nav-link {
    color: var(--navy);
    border-bottom-color: var(--gold);
}

/* Mobile: hide mega menu, show in collapse */
@media (max-width: 991px) {
    .mega-nav { display: none !important; }
}

/* Align dropdowns that would overflow right edge */
.mega-nav-list > .mega-nav-item:nth-child(n+5) > .mega-dropdown {
    left: auto;
    right: 0;
}
.mega-nav-list > .mega-nav-item:nth-child(n+5) > .mega-dropdown .mega-col-highlight {
    border-radius: 0 0 0 var(--radius);
    margin-right: 0;
}

/* ============================================
   QUICK VIEW OVERLAY ON BOOK CARDS
   ============================================ */
.book-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(27,42,74,0.7));
    padding: 2rem 1rem 1rem;
    display: flex;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.book-card:hover .book-card-overlay {
    opacity: 1;
}
.quick-view-btn {
    background: #fff !important;
    color: var(--navy) !important;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    border-radius: 2rem;
    padding: 0.4rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.quick-view-btn:hover {
    background: var(--gold-light) !important;
}

/* ============================================
   SOCIAL SHARING BUTTONS
   ============================================ */
.social-share {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.social-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}
.social-share a:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.share-facebook { background: #1877F2; }
.share-twitter { background: #1DA1F2; }
.share-whatsapp { background: #25D366; }
.share-pinterest { background: #E60023; }
.share-email { background: var(--navy); }

/* ============================================
   STICKY ADD TO CART BAR
   ============================================ */
.sticky-cart-bar {
    position: fixed;
    bottom: -80px;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid var(--gold);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 1030;
    transition: bottom 0.3s ease;
    padding: 0.75rem 0;
}
.sticky-cart-bar.visible {
    bottom: 0;
}

/* ============================================
   RECENTLY VIEWED
   ============================================ */
.recently-viewed-section {
    background: var(--cream);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

/* ============================================
   READING LISTS / COLLECTIONS
   ============================================ */
.collection-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}
.collection-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.collection-card-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: #fff;
    padding: 1.5rem;
}
.collection-card-header h5 {
    color: #fff;
    font-family: var(--font-heading);
    margin-bottom: 0.25rem;
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.testimonial-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}
.testimonial-card:hover {
    box-shadow: var(--shadow-md);
}
.testimonial-quote {
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--navy);
    font-size: 1rem;
    line-height: 1.6;
}
.testimonial-author {
    font-weight: 600;
    color: var(--navy);
    font-size: 0.85rem;
}

/* ============================================
   BOOK OF THE WEEK SPOTLIGHT
   ============================================ */
.spotlight-card {
    background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
    border: 2px solid var(--gold-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.spotlight-badge {
    background: var(--gold);
    color: var(--navy-dark);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.8rem;
    border-radius: 2rem;
    display: inline-block;
}

/* ============================================
   POLICY PAGES
   ============================================ */
.policy-content h4 {
    color: var(--navy);
    font-family: var(--font-heading);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.policy-content p, .policy-content li {
    color: var(--text-body);
    line-height: 1.8;
}

/* ============================================
   BOOK RAILS (Horizontal Scroll Carousels)
   ============================================ */
.book-rail {
    position: relative;
    margin-bottom: 2.5rem;
}
.book-rail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.book-rail-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}
.book-rail-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 0.75rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-light) transparent;
}
.book-rail-track::-webkit-scrollbar {
    height: 6px;
}
.book-rail-track::-webkit-scrollbar-track {
    background: transparent;
}
.book-rail-track::-webkit-scrollbar-thumb {
    background: var(--gold-light);
    border-radius: 3px;
}
.book-rail-track::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Rail navigation arrows */
.rail-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    color: var(--navy);
    font-size: 1rem;
    padding: 0;
}
.rail-arrow:hover {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    box-shadow: var(--shadow-lg);
}
.rail-arrow-left { left: -12px; }
.rail-arrow-right { right: -12px; }

/* Rail book card (narrower than grid cards) */
.rail-card {
    flex: 0 0 180px;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
}
.rail-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--gold-light);
    color: inherit;
}
.rail-card-cover {
    height: 220px;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.rail-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.75rem;
    transition: transform 0.4s ease;
}
.rail-card:hover .rail-card-cover img {
    transform: scale(1.06);
}
.rail-card-body {
    padding: 0.75rem;
}
.rail-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.25rem;
}
.rail-card-author {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rail-card-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
}
.rail-card-price-old {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 0.25rem;
}
.rail-card .badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.65rem;
    z-index: 2;
}

/* Responsive rail cards */
@media (max-width: 576px) {
    .rail-card { flex: 0 0 150px; min-width: 150px; }
    .rail-card-cover { height: 180px; }
    .rail-arrow { display: none; }
}

/* ============================================
   TILES (Featured Promo Tiles)
   ============================================ */
.promo-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}
.promo-tile {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    display: block;
    transition: var(--transition);
    min-height: 160px;
}
.promo-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: #fff;
}
.promo-tile-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.promo-tile-content {
    position: relative;
    z-index: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}
.promo-tile-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}
.promo-tile h5 {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.promo-tile p {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-bottom: 0;
}
.promo-tile-arrow {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0;
    transition: var(--transition);
    font-size: 1.2rem;
}
.promo-tile:hover .promo-tile-arrow {
    opacity: 1;
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .promo-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .promo-tiles { grid-template-columns: 1fr; }
    .promo-tile { min-height: 120px; }
}

/* ============================================
   SKELETON LOADING
   ============================================ */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f0ebe3 25%, #f8f3eb 50%, #f0ebe3 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: 0.5rem;
}
.skeleton-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
}
.skeleton-cover {
    height: 260px;
    background: linear-gradient(90deg, #f0ebe3 25%, #f8f3eb 50%, #f0ebe3 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite ease-in-out;
}
.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}
.skeleton-text-sm {
    height: 10px;
    margin-bottom: 6px;
    border-radius: 3px;
}
.skeleton-text-lg {
    height: 20px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.skeleton-btn {
    height: 38px;
    border-radius: 0.5rem;
    margin-top: 8px;
}
.skeleton-rail-card {
    flex: 0 0 180px;
    min-width: 180px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}
.skeleton-rail-cover {
    height: 220px;
    background: linear-gradient(90deg, #f0ebe3 25%, #f8f3eb 50%, #f0ebe3 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite ease-in-out;
}

/* ============================================
   WHATSAPP FLOATING BUTTON
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: var(--transition);
    text-decoration: none;
}
.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
    color: #fff;
}

/* ============================================
   DARK MODE
   ============================================ */
body.dark-mode {
    --warm-white: #1a1a2e;
    --cream: #16213e;
    --cream-dark: #0f1b33;
    --text-body: #c8c8d4;
    --text-dark: #e8e8f0;
    --text-muted: #8888a0;
    --border-light: #2a2a4a;
    background-color: #1a1a2e;
    color: #c8c8d4;
}
body.dark-mode .navbar,
body.dark-mode .mega-nav,
body.dark-mode .mega-dropdown {
    background: #16213e !important;
    border-color: #2a2a4a !important;
}
body.dark-mode .navbar .nav-link,
body.dark-mode .mega-nav-link,
body.dark-mode .brand-text {
    color: #c8c8d4 !important;
}
body.dark-mode .navbar-brand i { color: #C8A951 !important; }
body.dark-mode .card,
body.dark-mode .book-card,
body.dark-mode .dropdown-menu {
    background: #16213e !important;
    border-color: #2a2a4a !important;
    color: #c8c8d4;
}
body.dark-mode .book-cover-wrapper,
body.dark-mode .rail-card-cover,
body.dark-mode .category-hover {
    background: #0f1b33 !important;
}
body.dark-mode .book-title,
body.dark-mode .rail-card-title,
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
    color: #e8e8f0 !important;
}
body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #0f1b33;
    border-color: #2a2a4a;
    color: #c8c8d4;
}
body.dark-mode .table { color: #c8c8d4; }
body.dark-mode .text-dark { color: #c8c8d4 !important; }
body.dark-mode .text-muted { color: #8888a0 !important; }
body.dark-mode .bg-light { background: #16213e !important; }
body.dark-mode .search-form .form-control { background: #0f1b33; }
body.dark-mode .alert { background: #16213e; }
body.dark-mode .skeleton,
body.dark-mode .skeleton-cover,
body.dark-mode .skeleton-rail-cover {
    background: linear-gradient(90deg, #16213e 25%, #1a2744 50%, #16213e 75%);
    background-size: 800px 100%;
}
body.dark-mode .category-nav { background: #16213e !important; }
body.dark-mode .mega-col-highlight { background: #0f1b33 !important; }
body.dark-mode .testimonial-card { background: #16213e; border-color: #2a2a4a; }
body.dark-mode .collection-card { border-color: #2a2a4a; }
body.dark-mode .sticky-cart-bar { background: #16213e; border-color: #C8A951; }
body.dark-mode #darkModeBtn { opacity: 1; }
body.dark-mode #darkModeBtn i::before { content: "\F5A2"; } /* sun icon */

/* ============================================
   GIFT WRAPPING OPTION
   ============================================ */
.gift-wrap-option {
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem;
    transition: var(--transition);
    cursor: pointer;
}
.gift-wrap-option:hover,
.gift-wrap-option.selected {
    border-color: var(--gold);
    background: var(--cream);
}
.gift-wrap-price {
    color: var(--gold-dark);
    font-weight: 600;
}

/* ============================================
   BREADCRUMBS IMPROVED
   ============================================ */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: "\F285";
    font-family: "bootstrap-icons";
    font-size: 0.7rem;
    color: var(--gold);
}
.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}
.breadcrumb-item a:hover {
    color: var(--navy);
}
.breadcrumb-item.active {
    color: var(--navy);
    font-weight: 500;
}

/* ============================================
   FORMAT SELECTOR (Book Detail Page)
   ============================================ */
.format-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    min-width: 120px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: #fff;
    color: var(--text-body);
    margin-left: auto;
    margin-right: auto;
}
.format-btn:hover {
    border-color: var(--gold);
    background: var(--cream);
    color: var(--navy);
    transform: translateY(-1px);
}
.format-btn i {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    color: var(--navy);
}
.format-btn-label {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--navy);
}
.format-btn-price {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Active format */
.format-btn-active {
    border-color: var(--navy);
    background: var(--navy);
    cursor: default;
}
.format-btn-active i,
.format-btn-active .format-btn-label {
    color: #fff;
}
.format-btn-active .format-btn-price {
    color: var(--gold-light);
}
.format-btn-active:hover {
    transform: none;
    background: var(--navy);
}

/* Disabled/unavailable format */
.format-btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8f8f8;
}
.format-btn-disabled:hover {
    border-color: var(--border-light);
    background: #f8f8f8;
    transform: none;
}

/* Fix book cover overlapping mega menu */
.book-detail-cover {
    z-index: 1;
    position: relative;
}
.mega-dropdown {
    z-index: 1050 !important;
}
.mega-nav {
    z-index: 1021 !important;
}
.main-content {
    position: relative;
    z-index: 1;
}

/* ============================================
   Z-INDEX FIX - Stacking order
   ============================================ */
.navbar {
    z-index: 1040 !important;
}
.navbar .dropdown-menu {
    z-index: 1060 !important;
}
.mega-nav {
    z-index: 1030 !important;
}
.mega-dropdown {
    z-index: 1035 !important;
}
.sticky-top {
    z-index: 1 !important;
}
.navbar.sticky-top {
    z-index: 1040 !important;
}

/* Text muted override */
.text-muted {
    --bs-text-opacity1: 1;
    color: rgb(147, 152, 163) !important;
}

/* Navbar dropdown MUST be above mega menu */
.navbar .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}
