/**
 * eZBooks Plugin — Brand Override
 * Replaces purple (#3A0353) with Ezekiel Kevin Annan navy/orange palette
 */

/* Amazon buy button */
.ezbooks-amazon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    margin-top: .75rem;
    padding: .75rem 1.25rem;
    background: #FF9900;
    color: #111 !important;
    font-weight: 700;
    font-size: .95rem;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background .2s ease, transform .15s ease;
    box-sizing: border-box;
}
.ezbooks-amazon-btn:hover {
    background: #e68a00;
    transform: translateY(-2px);
    color: #111 !important;
}
.ezbooks-amazon-btn-sm {
    font-size: .82rem;
    padding: .55rem 1rem;
    margin-top: .5rem;
}

/* ═══════════════════════════════════════════════════════════
   OVERRIDE public-modern.css CSS variables (--ezb-*)
   ═══════════════════════════════════════════════════════════ */
:root {
    /* Replace purple with navy */
    --ezb-primary:           #0d1b2a !important;
    --ezb-primary-dark:      #070f17 !important;
    --ezb-primary-light:     #1a2f45 !important;
    --ezb-secondary:         #1a2f45 !important;

    /* Gold accent stays similar — shift to site orange */
    --ezb-accent-gold:       #f5a623 !important;
    --ezb-accent-gold-dark:  #d4891a !important;

    /* Backgrounds */
    --ezb-accent-cream:      #f7f8fa !important;
    --ezb-accent-beige:      #f7f8fa !important;
    --ezb-bg-primary:        #ffffff !important;
    --ezb-bg-secondary:      #f7f8fa !important;
    --ezb-bg-card:           #ffffff !important;

    /* Text */
    --ezb-text-primary:      #0d1b2a !important;
    --ezb-text-secondary:    #1a2f45 !important;
    --ezb-text-light:        #6b7280 !important;
    --ezb-text-muted:        #6b7280 !important;

    /* Borders */
    --ezb-border:            #e5e7eb !important;
    --ezb-border-light:      #f3f4f6 !important;

    /* ALSO override public.css variables (--ezbooks-*) */
    --ezbooks-dark:          #0d1b2a !important;
    --ezbooks-darker:        #070f17 !important;
    --ezbooks-light:         #f7f8fa !important;
    --ezbooks-lighter:       #ffffff !important;
    --ezbooks-mid-gray:      #6b7280 !important;
    --ezbooks-light-gray:    #e5e7eb !important;
    --ezbooks-border:        #e5e7eb !important;
    --ezbooks-accent:        #f5a623 !important;
    --ezbooks-accent-hover:  #d4891a !important;
    --ezbooks-accent-light:  rgba(245,166,35,.10) !important;
    --ezbooks-accent-glow:   rgba(245,166,35,.25) !important;
}

/* ═══════════════════════════════════════════════════════════
   FLOATING CART BUTTON
   ═══════════════════════════════════════════════════════════ */
.ezbooks-floating-cart .floating-cart-btn {
    background: #f5a623 !important;
    color: #0d1b2a !important;
    box-shadow: 0 8px 24px rgba(245,166,35,.4) !important;
}
.ezbooks-floating-cart .floating-cart-btn:hover {
    background: #d4891a !important;
    box-shadow: 0 12px 32px rgba(245,166,35,.5) !important;
}
.ezbooks-floating-cart .floating-cart-count {
    background: #0d1b2a !important;
    color: #ffffff !important;
}

/* ═══════════════════════════════════════════════════════════
   TYPOGRAPHY — Use site fonts
   ═══════════════════════════════════════════════════════════ */
.ezbooks-catalog-wrapper,
.ezbooks-cart-wrapper,
.ezbooks-checkout-wrapper,
.ezbooks-account-wrapper,
.ezbooks-library-wrapper,
.ezbooks-book-detail,
.ezb-catalog,
.ezb-cart,
.ezb-checkout,
.ezb-account,
.ezb-library {
    font-family: 'Inter', system-ui, sans-serif !important;
}

.ezbooks-catalog-wrapper h1, .ezbooks-catalog-wrapper h2, .ezbooks-catalog-wrapper h3,
.ezbooks-cart-wrapper h1, .ezbooks-cart-wrapper h2,
.ezbooks-checkout-wrapper h1, .ezbooks-checkout-wrapper h2,
.ezbooks-account-wrapper h1, .ezbooks-account-wrapper h2,
.ezbooks-library-wrapper h1, .ezbooks-library-wrapper h2,
.ezbooks-book-detail h1, .ezbooks-book-detail h2, .ezbooks-book-detail h3,
.ezb-book-title, .ezb-section-title, .ezb-page-title {
    font-family: 'Playfair Display', Georgia, serif !important;
    color: #0d1b2a !important;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
/* Primary: orange */
.ezb-btn-primary,
.ezbooks-btn-primary,
.ezbooks-add-to-cart,
.ezb-add-to-cart,
button.ezb-btn-primary,
a.ezb-btn-primary,
.ezb-buy-btn,
.ezb-checkout-btn,
[class*="ezb"][class*="btn-primary"],
[class*="ezbooks"][class*="add-to-cart"] {
    background: #f5a623 !important;
    background-image: none !important;
    border-color: #f5a623 !important;
    color: #0d1b2a !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
}

/* Force uniform Add to Cart button size — catalog grid cards only (not detail page) */
.ezbooks-book-card .ezbooks-add-to-cart-section {
    display: block !important;
}
.ezbooks-book-card .ezbooks-add-to-cart {
    flex: none !important;
    width: 100% !important;
    height: 44px !important;
    min-width: unset !important;
    padding: 0 16px !important;
    font-size: .88rem !important;
    line-height: 44px !important;
    text-align: center !important;
    display: block !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* Restore detail page Add to Cart + wishlist layout */
.ezbooks-book-detail .ezbooks-add-to-cart-section {
    display: flex !important;
}
.ezbooks-book-detail .ezbooks-add-to-cart {
    flex: 1 !important;
    height: 56px !important;
    line-height: normal !important;
    font-size: 1rem !important;
    white-space: normal !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.ezb-btn-primary:hover, .ezbooks-btn-primary:hover,
.ezbooks-add-to-cart:hover, .ezb-add-to-cart:hover,
.ezb-buy-btn:hover, .ezb-checkout-btn:hover {
    background: #d4891a !important;
    border-color: #d4891a !important;
    color: #0d1b2a !important;
}

/* Secondary / outline */
.ezb-btn-secondary, .ezb-btn-outline,
.ezbooks-btn-secondary, .ezbooks-btn-outline {
    border-color: #0d1b2a !important;
    color: #0d1b2a !important;
    background: transparent !important;
}
.ezb-btn-secondary:hover, .ezb-btn-outline:hover {
    background: #0d1b2a !important;
    color: #ffffff !important;
}

/* ═══════════════════════════════════════════════════════════
   BOOK CARDS
   ═══════════════════════════════════════════════════════════ */
.ezb-book-card, .ezbooks-book-card {
    border-radius: 12px !important;
    border-color: #e5e7eb !important;
    transition: all .25s ease !important;
}
.ezb-book-card:hover, .ezbooks-book-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 12px 32px rgba(0,0,0,.12) !important;
    border-color: #f5a623 !important;
}

/* Book title links */
.ezb-book-title a, .ezb-book-card a.ezb-book-title,
.ezbooks-book-title a {
    color: #0d1b2a !important;
}
.ezb-book-title a:hover, .ezbooks-book-title a:hover {
    color: #f5a623 !important;
}

/* ═══════════════════════════════════════════════════════════
   BADGES & TAGS
   ═══════════════════════════════════════════════════════════ */
/* Genre/format badges (replace purple) */
.ezb-book-type-badge, .ezb-genre-badge,
.ezbooks-book-type, .ezbooks-format-badge {
    background: #0d1b2a !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    letter-spacing: .06em !important;
}

/* Cover-image badges — pinned to top-left of the wrapper */
.ezbooks-sale-badge,
.ezbooks-coming-soon-badge {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    z-index: 4 !important;
    display: inline-block !important;
    max-width: calc(100% - 24px) !important;
    padding: 3px 10px !important;
    border-radius: 999px !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    line-height: 1.6 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.3) !important;
    pointer-events: none !important;
    transition: none !important;
}

/* Sale badge colours */
.ezb-sale-badge, .ezbooks-sale-badge {
    background: #f5a623 !important;
    color: #0d1b2a !important;
}

/* Coming Soon badge colours */
.ezbooks-coming-soon-badge {
    background: #374151 !important;
    color: #ffffff !important;
}

/* Coming Soon card — dim cover, block link click */
.ezbooks-coming-soon .ezbooks-book-cover-wrapper a {
    pointer-events: none !important;
    cursor: default !important;
}
.ezbooks-coming-soon img.ezbooks-book-cover,
.ezbooks-coming-soon .ezbooks-book-cover-wrapper img {
    opacity: .78 !important;
    /* prevent scale-up on hover for coming-soon cards */
    transform: none !important;
    transition: none !important;
}

/* "Coming Soon" label inside the card info area */
.ezbooks-coming-soon-text {
    font-size: .72rem !important;
    font-weight: 700 !important;
    color: #6b7280 !important;
    text-transform: uppercase !important;
    letter-spacing: .07em !important;
    margin: 6px 0 0 !important;
}

/* ═══════════════════════════════════════════════════════════
   PRICE
   ═══════════════════════════════════════════════════════════ */
.ezb-price-current, .ezb-current-price,
.ezbooks-price, .ezbooks-current-price {
    color: #0d1b2a !important;
    font-weight: 700 !important;
}
.ezb-price-original, .ezb-original-price,
.ezbooks-original-price {
    color: #6b7280 !important;
    text-decoration: line-through !important;
}
.ezb-price-sale, .ezbooks-sale-price {
    color: #d4891a !important;
    font-weight: 700 !important;
}

/* ═══════════════════════════════════════════════════════════
   FILTER SIDEBAR & SEARCH
   ═══════════════════════════════════════════════════════════ */
.ezb-filters label, .ezb-filter-label,
.ezbooks-filter-label, [class*="ezb-filter"] label {
    color: #0d1b2a !important;
    font-weight: 600 !important;
    font-size: .82rem !important;
    text-transform: uppercase !important;
    letter-spacing: .06em !important;
}
.ezb-search-input, .ezb-filter-select,
.ezb-filters input, .ezb-filters select {
    border-color: #e5e7eb !important;
    border-radius: 8px !important;
    color: #0d1b2a !important;
}
.ezb-search-input:focus, .ezb-filter-select:focus {
    border-color: #f5a623 !important;
    box-shadow: 0 0 0 3px rgba(245,166,35,.12) !important;
    outline: none !important;
}
.ezb-filter-active, .ezb-filter-selected {
    background: rgba(245,166,35,.12) !important;
    border-color: #f5a623 !important;
    color: #d4891a !important;
}

/* ═══════════════════════════════════════════════════════════
   TABS (book detail, account)
   ═══════════════════════════════════════════════════════════ */
.ezb-tab.active, .ezb-tab-active,
.ezb-tabs .active, .ezbooks-tab.active {
    border-bottom-color: #f5a623 !important;
    color: #f5a623 !important;
}
.ezb-tab:hover, .ezbooks-tab:hover {
    color: #f5a623 !important;
}

/* ═══════════════════════════════════════════════════════════
   LINKS
   ═══════════════════════════════════════════════════════════ */
.ezb-breadcrumb a, .ezbooks-breadcrumb a {
    color: #6b7280 !important;
}
.ezb-breadcrumb a:hover { color: #f5a623 !important; }
.ezb-breadcrumb .ezb-breadcrumb-current { color: #0d1b2a !important; }

/* ═══════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════ */
.ezbooks-pagination {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin-top: 2.5rem !important;
    padding-top: 2rem !important;
    border-top: 1px solid #e5e7eb !important;
    flex-wrap: wrap !important;
}

/* All page links and spans */
.ezbooks-pagination .ezbooks-page-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 42px !important;
    height: 42px !important;
    padding: 0 14px !important;
    border-radius: 8px !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    background: #ffffff !important;
    color: #0d1b2a !important;
    border: 1px solid #e5e7eb !important;
    transition: all .2s ease !important;
    cursor: pointer !important;
}

/* Hover on links */
.ezbooks-pagination a.ezbooks-page-link:hover {
    background: #0d1b2a !important;
    border-color: #0d1b2a !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(13,27,42,.2) !important;
}

/* Current/active page */
.ezbooks-pagination span.ezbooks-page-link.current,
.ezbooks-pagination .ezbooks-page-link.current,
.ezb-pagination .active, .ezb-pagination .current,
.ezbooks-pagination .active {
    background: #f5a623 !important;
    border-color: #f5a623 !important;
    color: #0d1b2a !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(245,166,35,.35) !important;
    cursor: default !important;
}

/* Prev / Next buttons — slightly wider with arrow */
.ezbooks-pagination a.ezbooks-page-link.prev,
.ezbooks-pagination a.ezbooks-page-link.next {
    padding: 0 18px !important;
    font-weight: 600 !important;
    background: #0d1b2a !important;
    border-color: #0d1b2a !important;
    color: #ffffff !important;
}
.ezbooks-pagination a.ezbooks-page-link.prev:hover,
.ezbooks-pagination a.ezbooks-page-link.next:hover {
    background: #f5a623 !important;
    border-color: #f5a623 !important;
    color: #0d1b2a !important;
}

/* Dots */
.ezbooks-pagination .ezbooks-page-dots {
    color: #6b7280 !important;
    padding: 0 4px !important;
    user-select: none !important;
}

/* Page numbers row */
.ezbooks-pagination .ezbooks-page-numbers {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* ═══════════════════════════════════════════════════════════
   FORMS (checkout, account)
   ═══════════════════════════════════════════════════════════ */
.ezb-form input:focus, .ezb-form select:focus, .ezb-form textarea:focus,
.ezbooks-form input:focus {
    border-color: #f5a623 !important;
    box-shadow: 0 0 0 3px rgba(245,166,35,.12) !important;
}

/* ═══════════════════════════════════════════════════════════
   STARS / RATINGS
   ═══════════════════════════════════════════════════════════ */
.ezb-star.filled, .ezb-rating-star.active,
.ezbooks-star-filled { color: #f5a623 !important; }

/* ═══════════════════════════════════════════════════════════
   PROGRESS BARS (library)
   ═══════════════════════════════════════════════════════════ */
.ezb-progress-fill, .ezb-reading-progress-bar,
.ezbooks-progress-bar { background: #f5a623 !important; }

/* ═══════════════════════════════════════════════════════════
   NOTIFICATIONS / ALERTS
   ═══════════════════════════════════════════════════════════ */
.ezb-notification.success, .ezb-alert-success,
.ezbooks-notification.success {
    background: rgba(245,166,35,.1) !important;
    border-color: #f5a623 !important;
    color: #d4891a !important;
}

/* ═══════════════════════════════════════════════════════════
   ORDER TOTALS & CART
   ═══════════════════════════════════════════════════════════ */
.ezb-cart-total-amount, .ezb-order-total,
.ezbooks-cart-total {
    color: #0d1b2a !important;
    font-family: 'Playfair Display', Georgia, serif !important;
}
.ezb-discount-badge, .ezb-coupon-applied {
    background: rgba(245,166,35,.12) !important;
    color: #d4891a !important;
    border-color: #f5a623 !important;
}

/* ═══════════════════════════════════════════════════════════
   PAGE HERO — Remove extra padding that conflicts with theme
   ═══════════════════════════════════════════════════════════ */
.page-template-default .ezb-catalog-header,
.ezb-page-hero {
    background: #0d1b2a !important;
}

/* ═══════════════════════════════════════════════════════════
   CATALOG / CART / CHECKOUT — Remove .prose max-width so the
   plugin layout fills the full container width
   ═══════════════════════════════════════════════════════════ */
body.ezbooks-is-catalog .prose,
body.ezbooks-is-cart .prose,
body.ezbooks-is-checkout .prose,
body.ezbooks-is-account .prose,
body.ezbooks-is-library .prose {
    max-width: none !important;
    width: 100% !important;
}

/* Catalog layout: sidebar + full-width book grid */
body.ezbooks-is-catalog .ezbooks-catalog-layout {
    grid-template-columns: 260px 1fr !important;
    gap: 2rem !important;
    width: 100% !important;
}

/* Books grid: 3 columns (matches ~900px content area after sidebar) */
body.ezbooks-is-catalog .ezbooks-books-grid.grid-view {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem !important;
}

/* Book card cover: fix wrapper aspect-ratio vs image height mismatch.
   The wrapper uses aspect-ratio:2/3 (~556px) but the plugin caps the
   image at 280px — leaving a 276px blank gap. Fix: give the wrapper a
   fixed height and make the image (class=ezbooks-book-cover) fill it. */
body.ezbooks-is-catalog .ezbooks-book-cover-wrapper {
    aspect-ratio: unset !important;
    height: 300px !important;
    overflow: hidden !important;
}

body.ezbooks-is-catalog img.ezbooks-book-cover,
body.ezbooks-is-catalog .ezbooks-book-cover {
    height: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES
   ═══════════════════════════════════════════════════════════ */

/* Tablet: stack sidebar above books */
@media (max-width: 900px) {
    body.ezbooks-is-catalog .ezbooks-catalog-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    body.ezbooks-is-catalog .ezbooks-catalog-sidebar {
        position: static !important;
        width: 100% !important;
    }
    body.ezbooks-is-catalog .ezbooks-books-grid.grid-view {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.25rem !important;
    }
}

/* Mobile: 2-column books grid */
@media (max-width: 640px) {
    body.ezbooks-is-catalog .ezbooks-books-grid.grid-view {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    body.ezbooks-is-catalog .ezbooks-book-cover-wrapper {
        height: 220px !important;
    }
    .ezbooks-catalog-controls {
        flex-wrap: wrap;
        gap: .75rem;
    }
}

/* Small phones: single column for very narrow screens */
@media (max-width: 400px) {
    body.ezbooks-is-catalog .ezbooks-books-grid.grid-view {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: .75rem !important;
    }
    body.ezbooks-is-catalog .ezbooks-book-cover-wrapper {
        height: 180px !important;
    }
    .ezbooks-book-info { padding: .75rem !important; }
    .ezbooks-book-title { font-size: .85rem !important; }
}

/* Book detail page: disable sticky cover on mobile */
@media (max-width: 900px) {
    .ezbooks-book-gallery {
        position: relative !important;
        top: auto !important;
    }
}
