/**
 * Modern Frontend Styles for eZBooks
 * Public-facing book catalog, cart, checkout, and library
 *
 * @package EZBooks
 */

:root {
    /* Colors - Royal Purple & Sunlit Gold Palette */
    --ezb-primary: #3A0353;
    --ezb-primary-dark: #2A023D;
    --ezb-primary-light: #5A1D7A;
    --ezb-secondary: #804A8A;
    --ezb-accent-gold: #F59E51;
    --ezb-accent-gold-dark: #D48238;
    --ezb-accent-cream: #FDF8F3;
    --ezb-accent-green: #6D8C78;
    --ezb-accent-red: #E74C3C;
    --ezb-accent-beige: #F9F4E8;

    /* Backgrounds */
    --ezb-bg-primary: #FDFCFE;
    --ezb-bg-secondary: #F5F3FF;
    --ezb-bg-card: #FFFFFF;

    /* Text */
    --ezb-text-primary: #3A0353;
    --ezb-text-secondary: #5A1D7A;
    --ezb-text-light: #804A8A;

    /* Borders & Shadows - Bento Style */
    --ezb-border: #F1E9DA;
    --ezb-shadow-sm: 0 4px 10px rgba(58, 3, 83, 0.03);
    --ezb-shadow-md: 0 10px 25px rgba(58, 3, 83, 0.05);
    --ezb-shadow-lg: 0 15px 40px rgba(58, 3, 83, 0.08);
    --ezb-shadow-xl: 0 25px 60px rgba(58, 3, 83, 0.12);

    /* Gradients */
    --ezb-gradient-purple: linear-gradient(135deg, #3A0353 0%, #804A8A 100%);
    --ezb-gradient-gold: linear-gradient(135deg, #F59E51 0%, #F8D299 100%);
    --ezb-gradient-blue: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    /* For placeholders */

    /* Spacing */
    --ezb-space-xs: 4px;
    --ezb-space-sm: 8px;
    --ezb-space-md: 16px;
    --ezb-space-lg: 24px;
    --ezb-space-xl: 32px;
    --ezb-space-2xl: 48px;

    /* Border Radius - Bento Style */
    --ezb-radius-sm: 8px;
    --ezb-radius-md: 16px;
    --ezb-radius-lg: 24px;
    --ezb-radius-xl: 32px;

    /* Typography */
    --ezb-font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --ezb-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Base Styles */
.ezbooks-page-container {
    padding-top: var(--ezb-space-2xl);
    padding-bottom: var(--ezb-space-2xl);
    min-height: 60vh;
    font-family: var(--ezb-font-body);
    color: var(--ezb-text-primary);
    background-color: var(--ezb-bg-primary);
}

.ezbooks-container {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: var(--ezb-space-xl);
    padding-right: var(--ezb-space-xl);
    width: 100%;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   Button System
   ======================================== */
.ezbooks-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ezb-space-sm);
    padding: 12px 24px;
    border-radius: var(--ezb-radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    font-family: var(--ezb-font-heading);
    line-height: normal;
}

.ezbooks-btn-primary {
    background: var(--ezb-primary);
    /* Solid purple for better contrast */
    color: white;
    box-shadow: var(--ezb-shadow-md);
}

.ezbooks-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--ezb-shadow-lg);
    background: var(--ezb-primary-light);
}

.ezbooks-btn-secondary {
    background: var(--ezb-bg-secondary);
    color: var(--ezb-primary);
}

.ezbooks-btn-secondary:hover {
    background: var(--ezb-border);
}

.ezbooks-btn-large {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 12px;
}

.ezbooks-btn-block {
    width: 100%;
    display: flex;
}

/* ========================================
   Book Catalog
   ======================================== */
.ezbooks-catalog-header {
    text-align: center;
    margin-bottom: var(--ezb-space-2xl);
    padding: var(--ezb-space-2xl);
    background: var(--ezb-bg-secondary);
    border-radius: var(--ezb-radius-xl);
    border: 1px solid var(--ezb-border);
}

.ezbooks-catalog-title {
    font-family: var(--ezb-font-heading);
    font-size: 48px;
    font-weight: 700;
    color: var(--ezb-primary);
    margin: 0 0 var(--ezb-space-sm);
}

.ezbooks-catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--ezb-space-2xl);
    align-items: start;
}

.ezbooks-catalog-sidebar {
    background: var(--ezb-bg-card);
    border-radius: var(--ezb-radius-lg);
    padding: var(--ezb-space-xl);
    box-shadow: var(--ezb-shadow-sm);
    border: 1px solid var(--ezb-border);
    position: sticky;
    top: 40px;
}

.ezbooks-filter-section h3 {
    font-family: var(--ezb-font-heading);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ezb-text-primary);
    margin: 0 0 var(--ezb-space-md);
}

.ezbooks-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--ezb-space-xl);
}

.ezbooks-book-card {
    background: var(--ezb-bg-card);
    border-radius: var(--ezb-radius-lg);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--ezb-border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ezbooks-book-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--ezb-shadow-lg);
    border-color: var(--ezb-primary-light);
}

.ezbooks-book-cover-wrapper {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--ezb-bg-secondary);
}

.ezbooks-book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.ezbooks-book-card:hover .ezbooks-book-cover {
    transform: scale(1.05);
}

.ezbooks-book-info {
    padding: var(--ezb-space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ezbooks-book-title {
    font-family: var(--ezb-font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--ezb-text-primary);
    margin: 0 0 var(--ezb-space-xs);
    line-height: 1.4;
}

.ezbooks-book-author {
    font-size: 14px;
    color: var(--ezb-text-secondary);
    margin-bottom: var(--ezb-space-md);
}

.ezbooks-book-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: var(--ezb-space-md);
    border-top: 1px solid var(--ezb-border);
}

/* ========================================
   Single Book Page
   ======================================== */
.ezbooks-single-book {
    padding: var(--ezb-space-md) 0 var(--ezb-space-2xl);
}

.ezbooks-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--ezb-space-sm);
    font-size: 14px;
    margin-bottom: var(--ezb-space-xl);
    padding: var(--ezb-space-md) var(--ezb-space-lg);
    background: var(--ezb-bg-card);
    border-radius: var(--ezb-radius-md);
    border: 1px solid var(--ezb-border);
}

.ezbooks-breadcrumb a {
    color: var(--ezb-text-secondary);
    text-decoration: none;
}

.ezbooks-breadcrumb .separator {
    color: var(--ezb-border);
}

.ezbooks-breadcrumb .current {
    color: var(--ezb-text-primary);
    font-weight: 600;
}

.ezbooks-book-content {
    display: grid;
    grid-template-columns: 450px 1fr;
    /* Wider cover column */
    gap: var(--ezb-space-2xl);
    margin-bottom: var(--ezb-space-2xl);
    align-items: start;
}

@media (max-width: 900px) {
    .ezbooks-book-content {
        grid-template-columns: 1fr;
    }
}

/* Book Cover & Gallery */
.ezbooks-book-gallery {
    position: sticky;
    top: 40px;
}

.ezbooks-book-cover-main {
    position: relative;
    border-radius: var(--ezb-radius-xl);
    overflow: hidden;
    box-shadow: var(--ezb-shadow-xl);
    border: 1px solid var(--ezb-border);
    background: var(--ezb-bg-card);
    aspect-ratio: 2/3;
}

.ezbooks-book-cover-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Placeholder for when no image exists - Matches Bento screenshot style */
.ezbooks-book-placeholder-large {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--ezb-gradient-blue);
    /* Blue gradient from screenshot */
    padding: var(--ezb-space-xl);
    text-align: center;
    color: white;
}

.ezbooks-book-placeholder-large .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: var(--ezb-space-md);
}

.ezbooks-placeholder-title {
    font-family: var(--ezb-font-heading);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--ezb-space-xs);
    line-height: 1.3;
}

.ezbooks-placeholder-author {
    font-size: 16px;
    opacity: 0.9;
}

/* Book Details Column */
.ezbooks-book-details {
    padding: var(--ezb-space-sm) 0;
}

.ezbooks-book-meta-top {
    display: flex;
    gap: var(--ezb-space-sm);
    margin-bottom: var(--ezb-space-md);
}

.ezbooks-book-type,
.ezbooks-book-genre {
    font-family: var(--ezb-font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: 6px;
}

.ezbooks-book-type {
    background: var(--ezb-primary);
    color: white;
}

.ezbooks-book-genre {
    background: var(--ezb-accent-gold);
    color: white;
}

.ezbooks-book-details .ezbooks-book-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: var(--ezb-space-xs);
    line-height: 1.1;
    color: var(--ezb-text-primary);
    letter-spacing: -0.5px;
}

.ezbooks-book-details .ezbooks-book-author {
    font-size: 20px;
    color: var(--ezb-text-secondary);
    margin-bottom: var(--ezb-space-lg);
    font-weight: 500;
}

/* Price Section */
.ezbooks-book-price-section {
    background: var(--ezb-bg-card);
    padding: var(--ezb-space-lg);
    border-radius: var(--ezb-radius-lg);
    border: 1px solid var(--ezb-border);
    margin-bottom: var(--ezb-space-lg);
    box-shadow: var(--ezb-shadow-sm);
}

.ezbooks-price-wrapper {
    margin-bottom: var(--ezb-space-md);
}

.ezbooks-price {
    font-family: var(--ezb-font-heading);
    font-size: 32px;
    font-weight: 700;
    color: var(--ezb-text-primary);
}

.ezbooks-add-to-cart-section {
    display: flex;
    gap: var(--ezb-space-md);
    flex-wrap: wrap;
}

.ezbooks-add-to-cart {
    flex: 1;
    min-width: 200px;
    height: 56px;
    background: white;
    /* Matches screenshot white button */
    color: var(--ezb-text-primary);
    border: 1px solid var(--ezb-border);
    font-size: 16px;
    box-shadow: var(--ezb-shadow-sm);
}

.ezbooks-add-to-cart:hover {
    background: var(--ezb-bg-secondary);
    border-color: var(--ezb-primary);
    transform: translateY(-2px);
    box-shadow: var(--ezb-shadow-md);
    color: var(--ezb-primary);
}

.ezbooks-wishlist-toggle {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    background: white;
    border: 1px solid var(--ezb-border);
}

/* Info Grid - Bento Style */
.ezbooks-book-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 Columns like screenshot */
    gap: var(--ezb-space-md);
    margin-bottom: var(--ezb-space-xl);
}

.ezbooks-book-info-grid .info-item {
    background: var(--ezb-accent-beige);
    /* Beige background */
    padding: var(--ezb-space-md);
    border-radius: var(--ezb-radius-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ezbooks-book-info-grid .label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ezb-text-light);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.ezbooks-book-info-grid .value {
    font-size: 15px;
    font-weight: 600;
    color: var(--ezb-text-primary);
    font-family: var(--ezb-font-heading);
}

/* Tabs */
.ezbooks-book-tabs {
    background: var(--ezb-bg-card);
    border-radius: var(--ezb-radius-xl);
    border: 1px solid var(--ezb-border);
    overflow: hidden;
    box-shadow: var(--ezb-shadow-sm);
}

.ezbooks-tabs-nav {
    display: flex;
    background: var(--ezb-bg-secondary);
    padding: 0 var(--ezb-space-md);
}

.ezbooks-tab-btn {
    padding: 20px 24px;
    background: transparent;
    border: none;
    font-family: var(--ezb-font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--ezb-text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
}

.ezbooks-tab-btn.active {
    color: var(--ezb-primary);
    border-bottom-color: var(--ezb-primary);
}

.ezbooks-tabs-content {
    padding: var(--ezb-space-xl);
}

/* ========================================
   Shopping Cart
   ======================================== */
.ezbooks-cart-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--ezb-space-xl);
}

.ezbooks-cart-items {
    background: var(--ezb-bg-card);
    border-radius: var(--ezb-radius-xl);
    padding: var(--ezb-space-lg);
    box-shadow: var(--ezb-shadow-sm);
    border: 1px solid var(--ezb-border);
}

.ezbooks-cart-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.ezbooks-cart-table th {
    text-align: left;
    padding: var(--ezb-space-md);
    color: var(--ezb-text-light);
    font-family: var(--ezb-font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--ezb-bg-secondary);
}

.ezbooks-cart-table td {
    padding: var(--ezb-space-lg) var(--ezb-space-md);
    border-bottom: 1px solid var(--ezb-bg-secondary);
    vertical-align: middle;
}

.ezbooks-cart-table tr:last-child td {
    border-bottom: none;
}

.product-name a {
    color: #0EA5E9;
    /* Cyan link color from screenshot */
    font-weight: 700;
    text-decoration: none;
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.product-format {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--ezb-text-light);
    background: var(--ezb-bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Cart Sidebar */
.ezbooks-cart-sidebar>div {
    background: var(--ezb-bg-card);
    border-radius: var(--ezb-radius-lg);
    padding: var(--ezb-space-lg);
    box-shadow: var(--ezb-shadow-sm);
    border: 1px solid var(--ezb-border);
    margin-bottom: var(--ezb-space-lg);
}

.ezbooks-discount-section h3,
.ezbooks-cart-totals h3 {
    font-family: var(--ezb-font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--ezb-primary);
    margin-bottom: var(--ezb-space-lg);
}

.ezbooks-discount-form {
    display: flex;
    gap: var(--ezb-space-sm);
}

.ezbooks-discount-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--ezb-border);
    border-radius: var(--ezb-radius-sm);
}

.ezbooks-discount-form button {
    background: var(--ezb-accent-gold);
    /* Orange button */
    color: white;
    padding: 0 20px;
}

.ezbooks-totals-table {
    width: 100%;
    margin-bottom: var(--ezb-space-lg);
}

.ezbooks-totals-table th {
    text-align: left;
    padding: var(--ezb-space-sm) 0;
    color: var(--ezb-text-secondary);
}

.ezbooks-totals-table td {
    text-align: right;
    padding: var(--ezb-space-sm) 0;
    font-weight: 600;
    color: var(--ezb-text-primary);
}

.ezbooks-totals-table .total th,
.ezbooks-totals-table .total td {
    font-size: 20px;
    font-weight: 800;
    padding-top: var(--ezb-space-md);
    border-top: 1px solid var(--ezb-border);
    color: var(--ezb-primary);
}

.ezbooks-proceed-checkout {
    background: var(--ezb-primary);
    /* Purple proceed button */
    color: white;
    width: 100%;
    justify-content: center;
    height: 54px;
    font-size: 16px;
}

.ezbooks-proceed-checkout:hover {
    background: var(--ezb-primary-dark);
    color: white;
}

/* ========================================
   Checkout Styles
   ======================================== */
.ezbooks-checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--ezb-space-2xl);
}

.ezbooks-checkout-section {
    background: var(--ezb-bg-card);
    border-radius: var(--ezb-radius-xl);
    padding: var(--ezb-space-xl);
    margin-bottom: var(--ezb-space-xl);
    box-shadow: var(--ezb-shadow-sm);
    border: 1px solid var(--ezb-border);
}

.ezbooks-checkout-section h2 {
    font-family: var(--ezb-font-heading);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: var(--ezb-space-lg);
    padding-bottom: var(--ezb-space-md);
    border-bottom: 1px solid var(--ezb-border);
    color: var(--ezb-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ezb-space-md);
    margin-bottom: var(--ezb-space-md);
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--ezb-border);
    border-radius: var(--ezb-radius-sm);
    background: var(--ezb-bg-primary);
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ezb-text-primary);
}

/* Order Summary */
.ezbooks-order-summary {
    background: var(--ezb-bg-card);
    border-radius: var(--ezb-radius-xl);
    padding: var(--ezb-space-xl);
    box-shadow: var(--ezb-shadow-sm);
    border: 1px solid var(--ezb-border);
}

.ezbooks-order-summary h3 {
    font-family: var(--ezb-font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--ezb-primary);
    margin-bottom: var(--ezb-space-lg);
    padding-bottom: var(--ezb-space-md);
    border-bottom: 2px solid var(--ezb-bg-secondary);
}

.ezbooks-order-items {
    display: flex;
    flex-direction: column;
    gap: var(--ezb-space-md);
    margin-bottom: var(--ezb-space-lg);
}

.order-item {
    display: flex;
    gap: var(--ezb-space-md);
    align-items: center;
    padding-bottom: var(--ezb-space-md);
    border-bottom: 1px solid var(--ezb-bg-secondary);
}

.order-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.item-image {
    position: relative;
    width: 50px;
    height: 70px;
    flex-shrink: 0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: var(--ezb-shadow-sm);
}

.item-quantity {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--ezb-primary);
    color: white;
    font-size: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
}

.item-details {
    flex: 1;
}

.item-title {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--ezb-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.item-format {
    font-size: 11px;
    color: var(--ezb-text-light);
    text-transform: uppercase;
    font-weight: 600;
}

.item-price {
    font-weight: 700;
    color: var(--ezb-primary);
    font-size: 14px;
}

.ezbooks-order-totals {
    border-top: 2px solid var(--ezb-bg-secondary);
    padding-top: var(--ezb-space-lg);
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--ezb-space-sm);
    color: var(--ezb-text-secondary);
}

.total-row.total {
    margin-top: var(--ezb-space-md);
    color: var(--ezb-primary);
    font-weight: 800;
    font-size: 18px;
}

.ezbooks-secure-badge {
    margin-top: var(--ezb-space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ezb-space-sm);
    color: #6D8C78;
    font-size: 13px;
    font-weight: 600;
}

.ezbooks-secure-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Responsive */
@media (max-width: 900px) {

    .ezbooks-cart-content,
    .ezbooks-checkout-layout,
    .ezbooks-catalog-layout {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Floating Cart & Notifications
   ======================================== */
body .ezbooks-floating-cart {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    left: auto !important;
    z-index: 999999 !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
}

.ezbooks-floating-cart.has-items {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.floating-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--ezb-primary);
    color: white;
    border-radius: 50%;
    box-shadow: var(--ezb-shadow-xl);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.floating-cart-btn:hover {
    background: var(--ezb-primary-light);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 35px rgba(58, 3, 83, 0.3);
}

.floating-cart-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.floating-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--ezb-accent-gold);
    color: white;
    font-family: var(--ezb-font-heading);
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none;
}

.floating-cart-count.has-items {
    display: block;
    animation: ezb-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.empty-panel-msg {
    padding: 20px;
    text-align: center;
    color: var(--ezb-text-light);
    font-size: 14px;
    font-style: italic;
}

@keyframes ezb-pop {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

/* Mini Cart Panel (Dropdown) */
.ezbooks-cart-panel {
    position: absolute !important;
    bottom: 80px !important;
    right: 0 !important;
    width: 350px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(15px);
    border-radius: var(--ezb-radius-lg);
    box-shadow: var(--ezb-shadow-xl);
    border: 1px solid var(--ezb-border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100000 !important;
}

.ezbooks-cart-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ezbooks-cart-panel .panel-header {
    background: var(--ezb-primary);
    color: white;
    padding: var(--ezb-space-md) var(--ezb-space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ezbooks-cart-panel .panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.ezbooks-cart-panel .panel-header .close-panel {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.panel-items {
    max-height: 300px;
    overflow-y: auto;
    padding: var(--ezb-space-md);
}

.mini-cart-item {
    display: flex;
    gap: var(--ezb-space-md);
    padding: var(--ezb-space-sm) 0;
    border-bottom: 1px solid var(--ezb-border);
}

.mini-cart-item:last-child {
    border-bottom: none;
}

.mini-cart-item img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--ezb-radius-sm);
    box-shadow: var(--ezb-shadow-sm);
}

.mini-item-details {
    flex: 1;
}

.mini-item-details h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--ezb-primary);
}

.mini-item-details .price {
    font-size: 13px;
    color: var(--ezb-text-secondary);
    font-weight: 600;
}

.panel-footer {
    padding: var(--ezb-space-md);
    background: var(--ezb-bg-secondary);
    border-top: 1px solid var(--ezb-border);
}

.panel-footer .total {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--ezb-space-md);
    font-weight: 700;
    color: var(--ezb-primary);
}

.view-cart-btn {
    display: block;
    text-align: center;
    background: var(--ezb-accent-gold);
    color: white !important;
    padding: 12px;
    border-radius: var(--ezb-radius-md);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.view-cart-btn:hover {
    background: var(--ezb-accent-gold-dark);
    transform: scale(1.02);
}

/* Toast Notifications */
.ezbooks-cart-notification {
    position: fixed !important;
    bottom: 110px !important;
    right: 30px !important;
    background: white !important;
    padding: var(--ezb-space-md);
    border-radius: var(--ezb-radius-md);
    box-shadow: var(--ezb-shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--ezb-space-md);
    z-index: 100001 !important;
    transform: translateX(120%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ezbooks-cart-notification.show {
    transform: translateX(0);
}

.ezbooks-cart-notification .notification-content {
    display: flex;
    align-items: center;
    gap: var(--ezb-space-md);
}

.ezbooks-cart-notification img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.notification-text strong {
    display: block;
    font-size: 14px;
    color: var(--ezb-primary);
}

.notification-text span {
    font-size: 12px;
    color: var(--ezb-accent-gold);
    font-weight: 600;
}

.notification-action {
    background: var(--ezb-primary);
    color: white !important;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.notification-action:hover {
    background: var(--ezb-primary-dark);
    transform: translateY(-1px);
}

/* Ensure floating cart is visible on small screens */
@media (max-width: 768px) {
    body .ezbooks-floating-cart {
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        left: auto !important;
        z-index: 999999 !important;
    }

    .ezbooks-cart-panel {
        width: 300px !important;
        bottom: 70px !important;
        right: 0 !important;
    }
}
/* ========================================
   Theme Constraint Overrides
   Break EZBooks pages out of narrow theme
   .entry-content (820px) and .container (1200px) limits
   ======================================== */

/* Remove entry-content width cap on EZBooks pages */
body.ezbooks-is-catalog .entry-content,
body.ezbooks-is-cart .entry-content,
body.ezbooks-is-checkout .entry-content,
body.ezbooks-is-reader .entry-content {
    max-width: none !important;
    width: 100% !important;
}

/* Widen the theme container on EZBooks pages */
body.ezbooks-is-catalog .container,
body.ezbooks-is-cart .container,
body.ezbooks-is-checkout .container {
    max-width: none !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

/* Remove top padding from page container on EZBooks pages — plugin handles spacing */
body.ezbooks-is-catalog .site-main > .container,
body.ezbooks-is-cart .site-main > .container,
body.ezbooks-is-checkout .site-main > .container {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

/* Hide the duplicate page <h1> title — EZBooks renders its own header */
body.ezbooks-is-catalog .entry-header,
body.ezbooks-is-cart .entry-header,
body.ezbooks-is-checkout .entry-header {
    display: none !important;
}

/* Catalog: ensure books grid fills available space with proper columns */
body.ezbooks-is-catalog .ezbooks-books-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
}

/* Book cover: constrain thumbnail height */
body.ezbooks-is-catalog .ezbooks-book-cover {
    height: 280px !important;
    max-height: 280px !important;
}

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

/* Cart & Checkout: full width content */
body.ezbooks-is-cart .ezbooks-page-container,
body.ezbooks-is-checkout .ezbooks-page-container {
    padding-top: var(--ezb-space-xl) !important;
}
