/* ==========================================================================
   1. CSS Custom Properties
   ========================================================================== */

:root {
    --primary-color: #2b4c7e;
    --secondary-color: #2a9d8f;
    --dark-color: #1d2d44;
    --light-bg: #f8f9fa;
}

/* ==========================================================================
   13. Pagination
   ========================================================================== */

.pagination {
    gap: 4px;
}

.pagination .page-item .page-link {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color);
    background: transparent;
    transition: all 0.2s ease;
}

.pagination .page-item .page-link:hover {
    background-color: rgba(43, 76, 126, 0.08);
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(43, 76, 126, 0.25);
}

.pagination .page-item.disabled .page-link {
    color: #adb5bd;
    background: transparent;
    pointer-events: none;
}

.pagination .page-item .page-link:focus {
    box-shadow: none;
}

/* ==========================================================================
    14. Responsive
   ========================================================================== */

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* ==========================================================================
   3. Typography
   ========================================================================== */

.heading-serif {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
}

.section-label {
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--primary-color);
}

/* ==========================================================================
   4. Utility Classes
   ========================================================================== */

.bg-primary-custom {
    background-color: var(--primary-color);
}

.text-primary-custom {
    color: var(--primary-color);
}

.section-divider {
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
    margin: 0 auto 1.5rem;
}

.section-intro {
    max-width: 500px;
    margin: 0 auto;
}

/* ==========================================================================
   5. Buttons
   ========================================================================== */

.btn-primary-custom {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary-custom:hover {
    background-color: var(--dark-color);
    color: white;
}

/* ==========================================================================
   6. Navbar
   ========================================================================== */

.navbar-main {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.navbar-logo {
    height: auto;
    width: auto;
    max-height: 50px;
    max-width: 280px;
}

.search-form {
    max-width: 420px;
    width: 100%;
}

.search-form .form-control {
    box-shadow: none;
}

.navbar-spacer {
    width: 160px;
}

.navbar-center-spacer {
    max-width: 420px;
    width: 100%;
}

/* ==========================================================================
   6b. Hero Section
   ========================================================================== */

.hero-section {
    background-color: var(--primary-color);
    color: #fff;
    padding: 3.5rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.hero-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 500px;
}

.hero-search-form {
    max-width: 520px;
}

.hero-search-form .input-group {
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero-search-form .input-group-text {
    background-color: #fff;
    border: none;
    color: var(--primary-color);
    padding-left: 1.25rem;
    padding-right: 0.5rem;
}

.hero-search-form .form-control {
    background-color: #fff;
    border: none;
    padding: 0.75rem 0.5rem;
    font-size: 0.95rem;
    color: #333;
}

.hero-search-form .form-control:focus {
    box-shadow: none;
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.hero-search-form .form-control::placeholder {
    color: #999;
}

.btn-hero-search {
    background-color: var(--dark-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 0 50px 50px 0;
    transition: background-color 0.3s ease;
}

.btn-hero-search:hover {
    background-color: #141f30;
    color: #fff;
}

.btn-hero-cta {
    background-color: #fff;
    color: var(--primary-color);
    border: 2px solid #fff;
    padding: 0.65rem 1.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-hero-cta:hover {
    background-color: #f0f0f0;
    color: var(--dark-color);
    border-color: #f0f0f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

@media (max-width: 575.98px) {
    .hero-section {
        padding: 2.5rem 0 2rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .btn-hero-search {
        padding: 0.65rem 1rem;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   6c. Hero - Compact Variant (Catalog Page)
   ========================================================================== */

.hero-section--compact {
    padding: 2.5rem 0 2rem;
}

/* ==========================================================================
   6d. Navbar - Active State
   ========================================================================== */

.navbar-nav .nav-link {
    font-weight: 500;
    color: #555;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
}

.navbar-nav .nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* ==========================================================================
   6d2. About Section
   ========================================================================== */

.about-section {
    background-color: #fff;
}

.about-logo {
    max-width: 100px;
    height: auto;
}

/* ==========================================================================
   6f. New Releases Section
   ========================================================================== */

.new-releases-section .book-card-img {
    height: 260px;
}

/* ==========================================================================
   7. Book Cards (Catalog Grid)
   ========================================================================== */

.book-card {
    background: transparent;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    box-shadow: none;
}

.book-card-img {
    position: relative;
    height: 280px;
    overflow: hidden;
}

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

.book-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(29, 45, 68, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover .book-card-overlay {
    opacity: 1;
}

.book-card-overlay i {
    color: #fff;
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-card-body {
    padding: 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-card-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.book-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.book-card-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: auto;
    margin-bottom: 0;
}

.book-item.hide {
    display: none !important;
}

/* ==========================================================================
   8. Filter - Accordion Style (Desktop & Mobile)
   ========================================================================== */

.filter-group {
    border-bottom: 1px solid #e9ecef;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.875rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark-color);
    transition: color 0.2s;
}

.filter-header:hover {
    color: var(--primary-color);
}

.filter-header i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.filter-header[aria-expanded="false"] i {
    transform: rotate(-90deg);
}

.filter-content {
    padding-bottom: 0.875rem;
}

/* ==========================================================================
   9. Filter - Mobile Offcanvas
   ========================================================================== */

.filter-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1045;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 22px;
    box-shadow: 0 4px 20px rgba(43, 76, 126, 0.4);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-toggle-btn:hover,
.filter-toggle-btn:focus {
    background-color: var(--dark-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(43, 76, 126, 0.5);
}

.filter-badge {
    background-color: #dc3545;
    color: #fff;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 0 5px;
}

.filter-badge[data-count="0"],
.filter-badge:empty {
    display: none;
}

/* Offcanvas Panel */
.offcanvas.offcanvas-start {
    max-width: 320px !important;
}

.offcanvas-header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1rem 1.25rem;
}

.offcanvas-header .btn-close {
    filter: brightness(0) invert(1);
}

.offcanvas-title {
    font-weight: 700;
    font-size: 1rem;
}

#author-filter-mobile {
    max-height: 300px;
    overflow-y: auto;
}

#author-filter-mobile::-webkit-scrollbar {
    width: 4px;
}

#author-filter-mobile::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#author-filter-mobile::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 4px;
}

.btn-apply-filter {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-apply-filter:hover {
    background-color: var(--dark-color);
    color: #fff;
}

.btn-reset-mobile {
    border-radius: 8px;
}

/* ==========================================================================
   10. Book Detail Page
   ========================================================================== */

.book-detail-section {
    background-color: #fff;
}

.btn-back-link {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.btn-back-link:hover {
    color: var(--dark-color);
}

.book-detail-img {
    max-height: 480px;
    width: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.book-detail-category {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.book-detail-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.3;
    margin-bottom: 1.25rem;
}

.book-detail-meta {
    margin-bottom: 1.5rem;
}

.book-detail-meta p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.4rem;
}

.book-detail-meta i {
    color: var(--primary-color);
    width: 18px;
    text-align: center;
}

.book-detail-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
}

.book-detail-tabs .nav-tabs {
    border-bottom: 2px solid #e9ecef;
}

.book-detail-tabs .nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.book-detail-tabs .nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: rgba(43, 76, 126, 0.3);
}

.book-detail-tabs .nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

.book-detail-tabs .tab-content {
    padding: 1.5rem 0;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.7;
}

.book-detail-specs {
    list-style: none;
    padding: 0;
    margin: 0;
}

.book-detail-specs li {
    display: flex;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f1f1;
}

.book-detail-specs li:last-child {
    border-bottom: none;
}

.book-detail-specs .spec-label {
    width: 140px;
    min-width: 140px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
}

.book-detail-specs .spec-value {
    color: #555;
    font-size: 0.875rem;
}

.author-profile {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f1f1f1;
}

.author-profile:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.author-profile h6 {
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.author-profile p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.btn-whatsapp {
    background-color: #25d366;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50px;
    transition: background-color 0.3s ease;
}

.btn-whatsapp:hover {
    background-color: #1ebe5d;
    color: #fff;
}

@media (max-width: 767.98px) {
    .book-detail-cover img {
        max-height: 320px;
    }

    .book-detail-title {
        font-size: 1.4rem;
    }

    .book-detail-price-value {
        font-size: 1.25rem;
    }

    .book-detail-specs .spec-label {
        width: 110px;
        min-width: 110px;
    }
}

/* ==========================================================================
   11. Contact Section
   ========================================================================== */

.contact-card {
    border-radius: 0;
}

.contact-map-wrapper {
    height: 200px;
    overflow: hidden;
}

.contact-map-wrapper iframe {
    border: 0;
}

.contact-border-separator {
    border-color: #e8e0d5 !important;
}

.contact-download-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.contact-download-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* ==========================================================================
   12. Footer
   ========================================================================== */

.footer-icon {
    font-size: 2.5rem;
}

.footer-logo {
    height: auto;
    width: auto;
    max-height: 52px;
    max-width: 320px;
    filter: brightness(0) invert(1);
}

/* ==========================================================================
   13. Responsive
   ========================================================================== */

@media (min-width: 992px) {
    .filter-toggle-btn {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .navbar-logo {
        max-height: 36px;
        max-width: 200px;
    }
    .footer-logo {
        max-height: 38px;
        max-width: 240px;
    }
}
