/**
 * WooCommerce Styles
 * Custom styling for book collection store
 *
 * @package Stevie_Parks_Books
 */

/* ==========================================================================
   Shop Layout & Sidebar
   ========================================================================== */

/* Page specific: Hide the first .site-content which is empty due to our template structure */
.post-type-archive-product>#page>.site-content:nth-of-type(1),
.tax-product_cat>#page>.site-content:nth-of-type(1) {
    display: none !important;
}

/* Ensure the main content container has no top padding so header margin controls spacing */
.post-type-archive-product .site-content,
.tax-product_cat .site-content {
    padding-top: 0 !important;
}

.shop-layout-container {
    display: grid;
    grid-template-columns: 1fr 280px;
    /* Content Left, Sidebar Right */
    gap: 6rem;
    align-items: start;
    margin-bottom: var(--spacing-xl);
}

@media (max-width: 1024px) {
    .shop-layout-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .shop-sidebar {
        margin-left: 0;
        margin-top: var(--spacing-xl);
        position: static;
        order: 2;
        /* Keep below content on mobile */
    }
}

.shop-sidebar {
    background: transparent;
    padding: 0;
    margin-right: 0;
    /* No right margin needed */
    margin-left: var(--spacing-lg);
    /* Add left margin if sticky needs breathing room, or rely on gap */
    position: -webkit-sticky;
    position: sticky;
    top: 120px;
    align-self: start;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-width: none;
    order: 2;
    /* Ensure it stays right even if HTML order is weird (though we fixed HTML) */
}

.shop-sidebar::-webkit-scrollbar {
    display: none;
}

.shop-sidebar-toggle {
    display: none;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: var(--spacing-md);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.shop-sidebar-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.shop-sidebar-toggle i {
    margin-right: var(--spacing-xs);
}

/* Full Width Editorial Header (Option A) */
.shop-editorial-header {
    width: 100%;
    height: 320px;
    /* Slight increase to maintain visual presence after accounting for menu */
    padding-top: 70px;
    /* Reduced padding to lift the text slightly */
    /* Medium Editorial header - Centered in visible area */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5rem;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    /* Subtle dark overlay */
    backdrop-filter: blur(2px);
    /* Soften the image */
}

.shop-editorial-header .header-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--color-white);
}

.shop-editorial-header .page-title {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 400;
    color: var(--color-white);
    margin: 0 0 1rem 0;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
}

.shop-editorial-header .subtitle {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Hide default shop header as we have the editorial one now */
.woocommerce-products-header {
    display: none;
}

.shop-main-content {
    min-width: 0;
    max-width: 1100px;
    margin: 0 auto;
}

/* Sidebar Widgets */
.shop-sidebar .widget {
    margin-bottom: var(--spacing-xl);
    padding-bottom: 0;
    border-bottom: none;
}

.shop-sidebar .widget:last-child {
    margin-bottom: 0;
}

.shop-sidebar .widget-title {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin: 0 0 var(--spacing-lg);
    padding-bottom: var(--spacing-xs);
    border-bottom: none;
    /* Removed border */
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    opacity: 0.7;
}

/* Search Widget - Editorial Style */
/* Search Widget - Functional & Elegant */
/* Search Widget - Editorial Style (Minimal Underline) */
.shop-sidebar .search-form,
.shop-sidebar .woocommerce-product-search {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    /* Square for underline */
    padding: 4px 0;
    transition: all var(--transition-fast);
}

.shop-sidebar .search-form:focus-within,
.shop-sidebar .woocommerce-product-search:focus-within {
    border-color: var(--color-primary);
    background: transparent;
    box-shadow: none;
}

.shop-sidebar .search-field {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-family: var(--font-primary);
    /* Editorial font */
    font-size: 1rem;
    font-style: italic;
    color: var(--color-text);
    width: 100%;
}

.shop-sidebar .search-field::placeholder {
    color: var(--color-text-muted);
    font-style: italic;
}

.shop-sidebar .search-field:focus {
    outline: none;
    box-shadow: none;
}

.shop-sidebar .search-submit {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Align icon to right */
    background: transparent;
    color: var(--color-text-light);
    /* Subtle icon */
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    margin: 0;
    transition: all var(--transition-fast);
}

.shop-sidebar .search-submit:hover {
    background: transparent;
    color: var(--color-primary);
    transform: none;
    /* No jump */
}

/* Ensure text is hidden if button relies on icon, or use icon */
.shop-sidebar .search-submit {
    font-size: 0;
    /* Hide text "Search" */
}

.shop-sidebar .search-submit::before {
    content: '\f002';
    /* Font Awesome Search Icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    /* Lighter weight if possible */
    font-size: 1rem;
}

/* Category List - Editorial Index (Option A) */
.shop-sidebar .product-categories {
    list-style: none;
    margin: 0;
    padding: 0;
}

.shop-sidebar .product-categories li {
    margin-bottom: var(--spacing-sm);
    position: relative;
    padding-left: 0;
}

/* Hide Uncategorized and Counts explicitly */
.shop-sidebar .product-categories .cat-item-uncategorized,
.shop-sidebar .product-categories .count {
    display: none !important;
}

.shop-sidebar .product-categories a {
    display: block;
    padding: 2px 0;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-family: var(--font-heading);
    /* Playfair Display */
    font-style: italic;
    /* Editorial Italic */
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: 0;
    position: relative;
    border: none;
    margin: 0;
    opacity: 0.6;
}

.shop-sidebar .product-categories a:hover {
    color: var(--color-primary);
    opacity: 1;
    transform: translateX(4px);
}

.shop-sidebar .product-categories .current-cat>a {
    color: var(--color-primary-dark);
    font-weight: 500;
    opacity: 1;
    transform: translateX(4px);
}

/* Removed the dot for a purer text look in "Index" mode */
.shop-sidebar .product-categories .current-cat>a::before {
    display: none;
}

/* Ensure no visual hierarchy even if structured */
.shop-sidebar .product-categories .children {
    margin-left: 0;
    margin-top: 0;
    padding-left: 0;
    border-left: none;
}

.shop-sidebar .product-categories .children a {
    font-size: 1.15rem;
    /* Same size as parent for flat look */
    opacity: 0.6;
}

/* Subcategories indentation removed for flat index */

/* Price Filter - Minimalist */
.shop-sidebar .price_slider_wrapper {
    margin-top: var(--spacing-md);
    padding-left: 4px;
    padding-right: 4px;
}

.shop-sidebar .price_slider {
    margin-bottom: var(--spacing-md);
    background: var(--color-border);
    height: 1px;
    /* Ultra-thin line */
    border-radius: 0;
    border: none;
}

.shop-sidebar .ui-slider-range {
    background: var(--color-primary);
    top: -1px;
    /* Center on the thin line */
    height: 3px;
}

.shop-sidebar .ui-slider-handle {
    background: var(--color-white);
    border: 1px solid var(--color-primary);
    width: 12px;
    height: 12px;
    top: -5px;
    border-radius: 50%;
    /* Circle */
    box-shadow: none;
    outline: none;
}

.shop-sidebar .ui-slider-handle:hover,
.shop-sidebar .ui-slider-handle:focus {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.shop-sidebar .price_label {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.shop-sidebar .button {
    font-size: 0.875rem;
    padding: 6px 12px;
}

/* Filter Checkboxes */
.shop-sidebar input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--color-primary);
    vertical-align: middle;
}

.shop-sidebar label {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--color-text);
    cursor: pointer;
    vertical-align: middle;
}

/* ==========================================================================
   Pagination - Elegant Design
   ========================================================================== */

.woocommerce-pagination {
    margin-top: var(--spacing-xxl);
    text-align: center;
    border: none !important;
}

.woocommerce-pagination ul {
    border: none !important;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-pagination ul li {
    float: none !important;
    border: none !important;
    overflow: visible !important;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px;
    height: 44px;
    line-height: 1 !important;
    padding: 0 !important;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin: 0 2px;
}

.woocommerce-pagination ul li a:hover,
.woocommerce-pagination ul li a:focus {
    background: var(--color-background-alt);
    color: var(--color-primary);
    border-color: var(--color-border);
}

.woocommerce-pagination ul li span.current {
    background: var(--color-text, #111) !important;
    color: var(--color-white, #fff) !important;
    border-color: var(--color-text, #111) !important;
}

.woocommerce-pagination ul li .next,
.woocommerce-pagination ul li .prev {
    width: auto;
    padding: 0 16px !important;
    border-radius: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.woocommerce-pagination ul li .next:hover,
.woocommerce-pagination ul li .prev:hover {
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 4px;
    border-color: transparent;
}

/* ==========================================================================
   Product Grid
   ========================================================================== */

.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem 2rem;
    list-style: none !important;
    margin: 0;
    padding: 0;
}

/* Disable pseudo-elements that occupy grid cells */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
    content: none !important;
}

/* Override legacy WooCommerce styles */
.woocommerce ul.products li.product {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}

/* Remove WooCommerce's .first and .last class styles */
.woocommerce ul.products li.product.first,
.woocommerce ul.products li.product.last {
    clear: none !important;
    margin-right: 0 !important;
}

.woocommerce ul.products li.product {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    display: flex;
    flex-direction: column;
    /* min-height removed — let content define card height naturally */
    background: var(--color-white, #fff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.product-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* ==========================================================================
   Product Images
   ========================================================================== */

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--color-background-soft, #EFECE6);
    aspect-ratio: 3 / 4;
    flex-shrink: 0;
    margin-bottom: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    line-height: 0 !important;
    font-size: 0 !important;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
    box-sizing: border-box;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.woocommerce ul.products li.product:hover .product-image-wrapper img {
    transform: scale(1.04);
}

/* Ensure title sits tight against image */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Quick View Overlay - Removed for cleaner product images */
.product-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.woocommerce ul.products li.product:hover .product-image-wrapper::after {
    opacity: 0;
}

/* Sale Badge */
.woocommerce span.onsale {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    color: var(--color-primary-dark);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.875rem;
    font-family: var(--font-body);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

/* Condition Badge */
/* Condition Badge - Globally Absolute */
.condition-badge {
    position: absolute !important;
    bottom: var(--spacing-sm) !important;
    left: var(--spacing-sm) !important;
    top: auto !important;
    z-index: 20 !important;
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-primary-dark);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem !important;
    line-height: normal !important;
    font-weight: 600;
    font-family: var(--font-body);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    margin: 0 !important;
    transform: none !important;
}

.condition-badge i {
    color: var(--color-accent);
    margin-right: 4px;
}

.condition-mint .condition-badge {
    background: rgba(90, 125, 90, 0.95);
    color: var(--color-white);
}

.condition-excellent .condition-badge i {
    color: #5a7d5a;
}

/* ==========================================================================
   Product Details
   ========================================================================== */

.product-details {
    padding: 1.1rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text, #111);
    margin: 0 0 0.2rem;
    line-height: 1.35;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.woocommerce ul.products li.product a {
    color: inherit;
    text-decoration: none;
}

.woocommerce ul.products li.product a:hover .woocommerce-loop-product__title {
    color: var(--color-primary);
}

.product-author {
    font-family: var(--font-primary);
    font-size: 0.78rem;
    font-weight: 400;
    font-style: normal;
    color: var(--color-text-muted, #888);
    margin: 0 0 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
    letter-spacing: 0;
}

.product-year {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: var(--spacing-xs) 0;
}

.product-year i {
    margin-right: 4px;
    color: var(--color-accent);
}

/* Price */
.woocommerce ul.products li.product .price {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text, #111);
    margin: auto 0 0.5rem 0;
    /* No text-gradient — plain and strong */
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    display: block;
    letter-spacing: -0.01em;
}

/* Add to Cart Button — editorial minimal style */
.woocommerce ul.products li.product .button {
    margin: 0.75rem 1.25rem 1.1rem;
    margin-top: auto;
    display: block;
    text-align: center;
    background: transparent;
    color: var(--color-text, #111);
    border: none;
    border-top: 1px solid var(--color-border, #E5E5E5);
    padding: 0.7rem 0 0;
    border-radius: 0;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: color 0.2s ease, letter-spacing 0.2s ease;
    width: calc(100% - 2.5rem);
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    height: auto;
    line-height: 1.4;
    min-height: unset;
    box-shadow: none;
}

.woocommerce ul.products li.product .button:hover {
    background: transparent;
    color: var(--color-secondary, #3A4B40);
    transform: none;
    box-shadow: none;
    letter-spacing: 0.18em;
    text-decoration: none;
}

/* Hide Quantity Input globally for a cleaner look */
.quantity {
    display: none !important;
}

/* Ensure single add to cart button looks good without quantity */
.single_add_to_cart_button {
    width: 100%;
    margin-left: 0 !important;
}

.woocommerce ul.products li.product .button.added {
    display: none;
}

/* .added_to_cart style moved to main.css for global consistency */

.woocommerce ul.products li.product .price del {
    opacity: 0.5;
    font-size: 1rem;
    margin-right: var(--spacing-xs);
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none;
    color: var(--color-accent-dark);
}

/* ==========================================================================
   Single Product Page
   ========================================================================== */

/* Constrain overall single product, cart, and checkout widths to match deep-margin aesthetic */
.single-product #content .container,
.woocommerce-cart #content .container,
.woocommerce-checkout #content .container {
    max-width: 1100px;
}

.single-product-wrapper {
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.product-main-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--spacing-xxl);
    margin-bottom: var(--spacing-xl);
}

/* Product Gallery */
.product-gallery-wrapper {
    position: sticky;
    top: 100px;
    align-self: start;
}

.woocommerce div.product div.images {
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.woocommerce div.product div.images img {
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    border: none;
}

/* ==========================================================================
   WooCommerce Messages & Notifications
   ========================================================================== */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    background: var(--color-background-alt);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--spacing-lg);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.5;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

/* Ensure lists inside notifications stack properly */
ul.woocommerce-error,
ul.woocommerce-message,
ul.woocommerce-info {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

ul.woocommerce-error li,
ul.woocommerce-message li,
ul.woocommerce-info li {
    margin: 0 !important;
    padding: 0 !important;
    display: block;
}

.woocommerce-message {
    border-left-color: var(--color-success);
    background: rgba(90, 125, 90, 0.05);
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.1rem;
    flex-shrink: 0;
    display: inline-block;
    position: relative !important;
    left: auto !important;
    top: 0.2rem !important; /* Align with first line of text */
    margin-right: 0;
    width: auto;
    line-height: 1;
}

.woocommerce-message::before {
    content: '\f00c';
    color: var(--color-success);
}

.woocommerce-info::before {
    content: '\f05a';
    color: var(--color-primary);
}

.woocommerce-error::before {
    content: '\f071';
    color: #d32f2f;
}

.woocommerce-info {
    border-left-color: var(--color-primary);
    background: rgba(139, 69, 19, 0.05);
}

.woocommerce-error {
    border-left-color: #d32f2f;
    background: rgba(211, 47, 47, 0.04);
    color: #8b3a3a;
}

/* Checkout Field Validation */
.woocommerce-checkout .form-row.woocommerce-invalid label {
    color: #d32f2f;
}

.woocommerce-checkout .form-row.woocommerce-invalid .input-text {
    border-color: #d32f2f !important;
    background: rgba(211, 47, 47, 0.01);
}

.woocommerce-checkout .form-row.woocommerce-invalid .input-text:focus {
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.1);
}

/* Individual error messages below fields */
.woocommerce-checkout .form-row .woocommerce-error {
    margin: 0.5rem 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    color: #d32f2f !important;
    font-size: 0.75rem !important;
    display: block !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.woocommerce-checkout .form-row .woocommerce-error::before {
    display: none !important;
}

/* View Cart button in notification message — inherited from main.css */
.woocommerce-message .button,
.woocommerce-info .button {
    margin-left: auto;
    flex-shrink: 0;
}


/* Product Summary */
.summary.entry-summary {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-width: 0;
}

.woocommerce div.product .product_title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-primary-dark);
    margin: 0;
    line-height: 1.2;
}

.woocommerce div.product p.price {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.woocommerce div.product p.price del {
    opacity: 0.5;
    font-size: 1.5rem;
}

.woocommerce div.product p.price ins {
    text-decoration: none;
    color: var(--color-accent-dark);
}

/* Product Meta */
.woocommerce div.product .product_meta {
    padding: var(--spacing-md);
    background: var(--color-background-alt);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
}

.woocommerce div.product .product_meta>span {
    display: block;
    margin-bottom: var(--spacing-xs);
}

.woocommerce div.product .product_meta>span:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Book Details Section (ACF Fields)
   ========================================================================== */

.book-details-section {
    background: linear-gradient(135deg, var(--color-background) 0%, var(--color-background-alt) 100%);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-border);
    margin: var(--spacing-md) 0;
}

.book-details-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-primary-dark);
    margin: 0 0 var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-accent);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.book-details-title::before {
    content: '\f02d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--color-accent);
}

.book-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
}

.book-detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: var(--color-white);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-accent);
}

.book-detail-label {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.book-detail-label i {
    color: var(--color-accent);
    margin-right: 6px;
}

.book-detail-value {
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--color-text);
    font-weight: 500;
}

/* Book Extras */
.book-extras-item {
    grid-column: 1 / -1;
}

.book-extras-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

.book-extra-badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: var(--color-white);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
}

/* Condition Highlighting */
.book-condition-mint .book-detail-value {
    color: var(--color-success);
    font-weight: 700;
}

.book-condition-excellent .book-detail-value {
    color: #5a7d5a;
    font-weight: 700;
}

/* ==========================================================================
   Product Tabs
   ========================================================================== */

/* ==========================================================================
   Product Tabs
   ========================================================================== */

.woocommerce div.product .woocommerce-tabs {
    margin-top: var(--spacing-xl);
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    display: flex;
    gap: var(--spacing-sm);
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid var(--color-border);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--color-text-light);
    border-bottom: 3px solid transparent;
    transition: all var(--transition-fast);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-accent);
}

.woocommerce div.product .woocommerce-tabs .panel {
    padding: var(--spacing-lg);
    background: var(--color-white);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
}

/* ==========================================================================
   Shop Toolbar
   ========================================================================== */

.woocommerce-products-header {
    background: linear-gradient(135deg, rgba(15, 15, 25, 0.92) 0%, rgba(101, 67, 33, 0.85) 50%, rgba(139, 69, 19, 0.78) 100%),
        url('../images/hero-bg.png');
    background-size: cover;
    background-position: center;
    color: var(--color-white);
    padding: var(--spacing-xxl) var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    text-align: center;
    box-shadow: var(--shadow-md);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.woocommerce-products-header__title {
    color: var(--color-white);
    margin: 0;
}

.woocommerce-result-count,
.woocommerce-ordering {
    font-family: var(--font-body);
    font-size: 0.9375rem;
}

.woocommerce-ordering select {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    background: var(--color-white);
}

/* ==========================================================================
   Cart & Checkout
   ========================================================================== */

/* Cart Page - Full Width Layout Override */
.woocommerce-cart #content {
    display: block !important;
    /* Override the default grid layout that constrains cart width */
}

.woocommerce table.shop_table {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Cart Page Title Spacing */
.woocommerce-cart .entry-header {
    margin-bottom: var(--spacing-xl);
}

.woocommerce-cart .entry-title {
    font-size: 3rem;
    /* Elegant large title */
    color: var(--color-primary-dark);
}

.woocommerce table.shop_table th {
    background: transparent;
    /* Remove dark background for cleaner look */
    color: var(--color-text-light);
    /* Softer text color */
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.825rem;
    padding: var(--spacing-md) 0;
    /* Vertical padding only */
    border-bottom: 2px solid var(--color-primary);
    /* Elegant separator */
}

.woocommerce table.shop_table td {
    padding: var(--spacing-lg) 0;
    /* More breathing room */
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.woocommerce-cart table.cart .product-name a {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-primary-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.woocommerce-cart table.cart .product-name a:hover {
    color: var(--color-primary);
}

.cart-item-author {
    display: block;
    /* Force new line, prevent awkward mid-text wrapping */
    color: var(--color-text-light);
    font-style: italic;
    font-size: 0.9375rem;
    /* Ensure readable size */
    margin-top: 4px;
    /* Slight separation from title */
    line-height: 1.4;
}

/* Cart Page Polish */
.woocommerce-cart .coupon {
    display: flex;
    align-items: stretch;
    /* Stretch to match heights */
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
}

.woocommerce-cart .coupon .input-text {
    width: 240px !important;
    padding: 0 16px !important;
    /* Use line-height for vertical centering */
    line-height: 48px !important;
    min-height: 48px;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.9375rem;
    background: var(--color-background-alt);
    transition: all 0.2s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.woocommerce-cart .coupon .input-text:focus {
    background: var(--color-white);
    border-color: var(--color-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Coupon Button — inherited from main.css */
.woocommerce-cart .coupon .button {
    min-height: 48px;
}

/* Row Animation */
/* Row Animation - Removed due to visibility issues */
.woocommerce-cart table.cart tr.cart_item {
    opacity: 1;
    /* Ensure visible */
}

/* Stagger Animations */
.woocommerce-cart table.cart tr.cart_item:nth-child(1) {
    animation-delay: 0.05s;
}

.woocommerce-cart table.cart tr.cart_item:nth-child(2) {
    animation-delay: 0.1s;
}

.woocommerce-cart table.cart tr.cart_item:nth-child(3) {
    animation-delay: 0.15s;
}

.woocommerce-cart table.cart tr.cart_item:nth-child(4) {
    animation-delay: 0.2s;
}


/* ==========================================================================
   Desktop Cart Layout (Grid System)
   ========================================================================== */
@media (min-width: 769px) {
    .woocommerce-cart table.shop_table.cart {
        display: block;
        width: 100%;
        border-collapse: collapse;
    }

    .woocommerce-cart table.shop_table.cart thead,
    .woocommerce-cart table.shop_table.cart tbody {
        display: block;
        width: 100%;
    }

    .woocommerce-cart table.shop_table.cart tr {
        display: grid;
        /* Columns: Remove | Thumbnail | Name (flex) | Price */
        grid-template-columns: 60px 140px 1fr 180px;
        align-items: center;
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }

    /* Reset Cell Display */
    .woocommerce-cart table.shop_table.cart th,
    .woocommerce-cart table.shop_table.cart td {
        display: flex !important;
        /* Flex to align content internally */
        align-items: center;
        height: 100%;
        padding: var(--spacing-md) var(--spacing-xs) !important;
        border: none !important;
        width: auto !important;
        /* Reset width interactions */
    }

    /* Column Specifics */
    .woocommerce-cart table.shop_table.cart .product-remove {
        justify-content: center;
    }

    .woocommerce-cart table.shop_table.cart .product-thumbnail {
        justify-content: center;
    }

    .woocommerce-cart table.shop_table.cart .product-name {
        flex-direction: column;
        /* Stack Title and Author */
        justify-content: center;
        /* Vertical center */
        align-items: flex-start;
        /* Left align text */
        padding-left: var(--spacing-lg) !important;
    }

    .woocommerce-cart table.shop_table.cart .product-name br {
        display: none;
        /* Hide BR as Flex handles stacking */
    }

    .woocommerce-cart table.shop_table.cart .product-price {
        justify-content: flex-end;
        /* Right align flex content */
        text-align: right;
        font-weight: 700;
        color: var(--color-primary-dark);
        font-size: 1.125rem;
    }

    /* Header Specifics */
    .woocommerce-cart table.shop_table.cart th {
        font-family: var(--font-body);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        font-size: 0.825rem;
        color: var(--color-text-light);
        background: transparent;
    }

    /* Ensure Price Header is Right Aligned */
    .woocommerce-cart table.shop_table.cart th.product-price {
        justify-content: flex-end;
    }

    /* Completely Hide Unused Columns */
    .woocommerce-cart table.shop_table.cart .product-quantity,
    .woocommerce-cart table.shop_table.cart .product-subtotal {
        display: none !important;
    }
}

/* Remove Update Cart Button */
.woocommerce-cart .actions .button[name="update_cart"] {
    display: none !important;
}

/* Removed Cart Width override as it is now shared with Checkout/Single Product at 1100px */

.woocommerce-cart .woocommerce {
    width: 100%;
    /* Max-width handled by #primary parent now */
}

.woocommerce-cart table.shop_table {
    width: 100%;
    table-layout: fixed;
    /* Ensures stable width distribution */
    border-collapse: separate;
    border-spacing: 0;
}

/* Cart Column Widths */
.woocommerce-cart table.cart .product-remove {
    width: 48px !important;
    /* Compact remove column */
    padding: var(--spacing-sm) 0 !important;
    text-align: center;
}

.woocommerce a.remove {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--color-text-light) !important;
    border: 1px solid var(--color-border);
    font-size: 1.25rem;
    /* Larger X */
    line-height: 1;
    font-weight: 300;
    text-decoration: none;
    transition: all 0.2s ease;
    margin: 0 auto;
}

.woocommerce a.remove:hover {
    background: var(--color-error);
    /* Red for destructive action */
    color: var(--color-white) !important;
    border-color: var(--color-error);
}

.woocommerce-cart table.cart .product-thumbnail {
    width: 120px !important;
    /* Wider thumbnail column */
}

.woocommerce-cart table.cart .product-name {
    width: auto;
}

.woocommerce-cart table.cart .product-price,
.woocommerce-cart table.cart .product-subtotal {
    width: 150px;
    text-align: right;
}

/* Cart Images */
.woocommerce-cart table.cart .product-thumbnail img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

/* Cart Totals Section */
/* Cart Totals Section - Redesigned */
.cart-collaterals .cart_totals {
    float: none !important;
    width: 100% !important;
    max-width: 600px;
    /* Narrower for better focus */
    margin: var(--spacing-xxl) auto 0;
    padding: 32px;
    background: var(--color-background-alt);
    /* Light beige card */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.cart-collaterals .cart_totals h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    border-bottom: none;
    /* Cleaner without underline */
    padding-bottom: 0;
    text-align: center;
    /* Center the title */
    color: var(--color-primary-dark);
}

.cart-collaterals .cart_totals table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-lg);
    background: transparent !important;
    /* Ensure no nested backgrounds */
    border: none !important;
    box-shadow: none !important;
}

.cart-collaterals .cart_totals table tr {
    background: transparent !important;
    /* Remove row backgrounds */
    border: none !important;
}

.cart-collaterals .cart_totals table th {
    width: 40%;
    text-align: left;
    padding: 16px 0;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    font-size: 0.825rem;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--color-border);
    /* Full width thin border */
    background: transparent !important;
}

.cart-collaterals .cart_totals table td {
    width: 60%;
    text-align: right;
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    background: transparent !important;
}

.cart-collaterals .cart_totals table tr.order-total th,
.cart-collaterals .cart_totals table tr.order-total td {
    border-bottom: none;
    /* No border for last item */
    border-top: 1px solid var(--color-text);
    /* Darker separator for total */
    padding-top: 24px;
    padding-bottom: 8px;
    color: var(--color-primary-dark);
    font-size: 1.25rem;
}

.cart-collaterals .cart_totals table tr.order-total td strong {
    font-weight: 800;
}

/* Checkout Button — inherited from main.css with specific sizing */
.wc-proceed-to-checkout .checkout-button {
    display: flex !important;
    width: 100%;
    font-size: 1.125rem;
    font-weight: 700;
    padding: 20px 32px;
    margin-top: var(--spacing-md);
}

.wc-proceed-to-checkout .checkout-button:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

/* Fix Return to Shop Button Hover */
.return-to-shop .button,
.wc-backward {
    transition: all 0.3s ease;
}

.return-to-shop .button:hover,
.wc-backward:hover {
    background: var(--color-primary-dark) !important;
    color: var(--color-white) !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.woocommerce-breadcrumb {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border-radius: var(--radius-md);
    border-left: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.woocommerce-breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    position: relative;
}

.woocommerce-breadcrumb a:hover {
    color: var(--color-primary-dark);
    background: rgba(212, 175, 55, 0.1);
}

.woocommerce-breadcrumb a::before {
    content: '\f015';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 4px;
    opacity: 0.7;
}

.woocommerce-breadcrumb a:not(:first-child)::before {
    content: '';
    margin-right: 0;
}

.breadcrumb-separator {
    margin: 0 var(--spacing-xs);
    color: var(--color-accent);
    font-weight: 600;
}

.breadcrumb-separator::before {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
}

/* Current page in breadcrumb */
.woocommerce-breadcrumb span:last-child {
    color: var(--color-text);
    font-weight: 600;
}

/* ==========================================================================
   Related Products
   ========================================================================== */

.related.products {
    margin-top: var(--spacing-xxl);
}

.related.products>h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-primary-dark);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

/* Match New Arrivals Grid Styles */
.related.products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: var(--spacing-lg) !important;
    margin: 0 !important;
    padding: 0 !important;
}

.related.products ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 400px !important;
    margin-bottom: 0 !important;
}

.related.products .product-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.related.products .product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related.products .button {
    margin-top: auto !important;
}

.related.products .product-image-wrapper {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin-bottom: 0 !important;
    display: block !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

.related.products .product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0 !important;
    display: block !important;
}

@media (max-width: 1024px) {
    .related.products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .related.products ul.products {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   Spectacular Single Product Page - Hero Layout
   ========================================================================== */

/* Hero Section - Compact & Elegant */
/* Hero Section - Compact & Elegant */
.product-hero-section {
    display: grid;
    grid-template-columns: 3fr 7fr;
    /* Reverted to strict 30/70 split */
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    /* Softer shadow */
    position: relative;
    /* Ensure height matches content */
    align-items: flex-start;
    min-height: auto;
    /* Slightly reduced min-height */
    overflow: visible;
}

.product-hero-section::before {
    display: none;
    /* Remove shimmer for cleaner look */
}

/* Hero Gallery - Clean, No Frame */
.product-hero-gallery {
    position: relative;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    margin: 0;
    width: 100%;
    height: auto;
    background: transparent;
    padding: 0;
}

.product-hero-summary {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Mobile: full-width layout without extra padding */
@media (max-width: 768px) {
    .product-hero-summary {
        width: 100%;
        max-width: 100%;
        padding: var(--spacing-md);
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .product-hero-gallery {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
}

.product-hero-gallery .woocommerce-product-gallery {
    margin: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    padding: 0;
}

.product-hero-gallery img {
    border-radius: 0;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: top left;
    display: block;
    box-shadow: none;
    background: transparent;
    padding: 0;
    margin: 0;
}

.product-hero-gallery:hover img {
    transform: scale(1.02);
}

/* Condition Badge on Hero - Keep for legacy or specialized overlays */
.product-condition-badge-hero {
    display: none;
    /* We are using inline badges now in summary */
}

/* Special Features Badges */
.product-special-features {
    position: absolute;
    bottom: var(--spacing-md);
    left: var(--spacing-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    z-index: 10;
}

.special-badge {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-primary-dark);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

.special-badge i {
    color: var(--color-accent);
}

/* Hero Summary - Editorial Flow */
.product-hero-summary {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    /* Tighter spacing */
    justify-content: center;
    /* Center vertical flow */
}

.product-hero-header {
    border-bottom: none;
    /* Remove divider */
    padding-bottom: 0;
}

.product-author-hero {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-accent-dark);
    font-size: 1.125rem;
    font-style: italic;
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-primary);
}

.product-author-hero i {
    color: var(--color-accent);
    font-size: 1rem;
}

.product-hero-header .product_title {
    font-size: 3rem;
    /* Larger, more elegant */
    line-height: 1.1;
    margin: 0 0 4px;
    color: var(--color-primary-dark);
    background: none;
    -webkit-text-fill-color: initial;
}

.product-year-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin-top: 0;
    margin-bottom: 12px;
}

.product-year-hero i {
    color: var(--color-accent);
}

/* Editorial Excerpt - Main Focus */
.product-excerpt-section {
    color: var(--color-text);
    font-size: 1.125rem;
    /* Larger reading size */
    line-height: 1.6;
    /* Tighter, magazine-like leading */
    font-family: var(--font-primary);
    margin-bottom: 12px;
}

/* Inline Badges */
.product-badges-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--color-background-alt);
    color: var(--color-text-light);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inline-badge i {
    color: var(--color-accent);
}

.inline-badge.condition-mint {
    background: rgba(90, 125, 90, 0.1);
    color: #466946;
}

/* Subtle Price Section - Moved Down */
.product-price-section {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    margin-top: 0;
    margin-bottom: 12px;
}

.product-price-section .price {
    font-size: 1.5rem;
    /* Smaller, discreet */
    font-weight: 600;
    color: var(--color-primary);
    /* Muted primary color */
    margin: 0;
}

.product-purchase-section {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.product-purchase-section .cart {
    margin-bottom: 0;
}

.product-purchase-section .button {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--color-white);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

.product-purchase-section .button:hover {
    background: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(139, 69, 19, 0.25);
}

/* Condition Section */
.book-condition-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 250, 250, 0.95) 100%);
}

.book-condition-section.condition-mint {
    background: linear-gradient(135deg, rgba(90, 125, 90, 0.1) 0%, rgba(70, 105, 70, 0.15) 100%);
    border-color: #5a7d5a;
}

.book-condition-section.condition-excellent {
    background: linear-gradient(135deg, rgba(90, 125, 90, 0.08) 0%, rgba(80, 115, 80, 0.12) 100%);
    border-color: #6a8d6a;
}

.book-condition-section.condition-very_good {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0.12) 100%);
    border-color: var(--color-accent);
}

.book-condition-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 2px solid var(--color-border);
}

.condition-rating {
    display: flex;
    gap: 6px;
    font-size: 1.5rem;
}

.condition-rating .fa-star {
    color: var(--color-accent);
    animation: starPulse 2s ease-in-out infinite;
}

.condition-rating .fa-star:nth-child(1) {
    animation-delay: 0s;
}

.condition-rating .fa-star:nth-child(2) {
    animation-delay: 0.1s;
}

.condition-rating .fa-star:nth-child(3) {
    animation-delay: 0.2s;
}

.condition-rating .fa-star:nth-child(4) {
    animation-delay: 0.3s;
}

.condition-rating .fa-star:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes starPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.condition-rating .far.fa-star {
    color: var(--color-border);
}

.condition-info {
    flex: 1;
}

.condition-label {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 4px;
}

.condition-description {
    font-size: 0.9375rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

/* Extras Section */
.book-extras-section {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(212, 175, 55, 0.1) 100%);
    border-color: var(--color-accent);
}

/* Bibliographic Details Table */
.book-details-bibliographic {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

table.book-info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

table.book-info-table th,
table.book-info-table td {
    padding: 6px 0;
    text-align: left;
    border: none;
    font-size: 0.9375rem;
    vertical-align: top;
}

table.book-info-table th {
    width: 30%;
    color: var(--color-text-light);
    font-weight: 400;
    font-family: var(--font-body);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding-top: 8px;
    /* Visual alignment */
}

table.book-info-table td {
    color: var(--color-text);
    font-weight: 500;
    font-family: var(--font-primary);
}

.book-extras-list-simple {
    margin-top: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

.extras-label {
    font-weight: 600;
    color: var(--color-text);
    margin-right: 4px;
}

/* Subtle Price Section - Moved Down */
.product-price-section {
    background: transparent;
    padding: 0;
    border: none;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
}

.product-price-section .price {
    font-size: 1.25rem;
    /* Smaller, discreet */
    font-weight: 500;
    color: var(--color-text-muted);
    /* Muted color */
    margin: 0;
    letter-spacing: -0.5px;
}

.book-extra-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--color-accent);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.2);
}

.book-extra-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
}

.book-extra-card:hover .book-extra-icon {
    transform: rotate(360deg) scale(1.1);
}

.book-extra-icon i {
    color: var(--color-white);
    font-size: 1.5rem;
}

.book-extra-label {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    text-align: center;
}


/* ==========================================================================
   Responsive
   ========================================================================== */

/* Desktop Large — 3 columns (breathable, editorial) */
@media (min-width: 1200px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet/Desktop Small — 2 columns */
@media (min-width: 768px) and (max-width: 1199px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1.5rem;
    }

    .shop-layout-container {
        grid-template-columns: 240px 1fr;
        gap: var(--spacing-lg);
    }

    .shop-sidebar {
        padding: var(--spacing-md);
    }
}

/* Single Product Layout */
@media (max-width: 1024px) {
    .product-main-content {
        grid-template-columns: 1fr;
    }

    .product-gallery-wrapper {
        position: static;
    }

    .product-hero-section {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .product-hero-header .product_title {
        font-size: 2.25rem;
    }

    .book-details-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* Tablet - 2 columns */
@media (min-width: 480px) and (max-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .related.products ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile and Tablet - Collapsible Sidebar */
@media (max-width: 768px) {

    /* FIX: Editorial header mobile (typographic version) */
    .shop-editorial-header {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* FIX: Breadcrumb alignment and padding */
    .woocommerce-breadcrumb {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        margin-bottom: var(--spacing-md);
    }

    .shop-layout-container {
        display: block;
        padding: 0 20px;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* FIX: Ensure product grid doesn't overflow on mobile */
    .woocommerce ul.products {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        /* Removed overflow-x: hidden to prevent clipping box-shadow of full-width cards */
    }

    /* Ensure product items respect container width */
    .woocommerce ul.products li.product {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
        min-height: 0 !important; /* Remove huge 500px min-height on mobile */
    }

    /* Reduce vertical padding inside cards on mobile */
    .product-details {
        padding: var(--spacing-sm) !important;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 0.9rem !important;
        margin-bottom: 0.2rem !important;
    }

    /* Ensure shop main content doesn't add extra constraints */
    .shop-main-content {
        width: 100%;
        max-width: 100%;
        padding: 0;
        box-sizing: border-box;
    }

    /* WooCommerce Checkout fields on mobile */
    .woocommerce-checkout .form-row-first,
    .woocommerce-checkout .form-row-last,
    .woocommerce-page .form-row-first,
    .woocommerce-page .form-row-last,
    .woocommerce .form-row-first,
    .woocommerce .form-row-last {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
    }

    /* Fix coupon notice layout if needed */
    .woocommerce-form-coupon-toggle .woocommerce-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    .woocommerce-form-coupon-toggle .woocommerce-info a.showcoupon {
        margin-left: 0;
        margin-top: var(--spacing-xs);
        display: inline-block;
        white-space: normal;
    }

    /* Checkout page spacing fixes */
    .woocommerce-checkout .checkout_coupon {
        padding: var(--spacing-lg) !important;
    }

    .shop-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        border-radius: 0;
        overflow-y: auto;
    }

    .shop-sidebar.active {
        left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .shop-sidebar-toggle {
        display: block;
        position: sticky;
        top: 0;
        z-index: 10;
        margin-bottom: var(--spacing-md);
    }

    /* Overlay for mobile sidebar */
    .shop-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .shop-sidebar-overlay.active {
        display: block;
    }

    .book-details-grid {
        grid-template-columns: 1fr;
    }

    /* WooCommerce Cart Table on Mobile */
    .woocommerce-cart table.shop_table.cart {
        border: none;
        box-shadow: none;
        background: transparent;
    }
    .woocommerce-cart table.shop_table.cart thead {
        display: none;
    }
    .woocommerce-cart table.shop_table.cart tbody tr.woocommerce-cart-form__cart-item {
        display: grid;
        grid-template-columns: 80px 1fr 120px 40px;
        grid-template-areas: 
            "image name name remove"
            "image price qt remove";
        gap: 10px;
        padding: 15px;
        margin-bottom: 15px;
        background: var(--color-white) !important;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        position: relative;
    }
    .woocommerce-cart table.shop_table.cart tbody tr.woocommerce-cart-form__cart-item td {
        border: none !important;
        padding: 0 !important;
        text-align: left !important;
        display: flex !important;
        align-items: center;
    }
    .woocommerce-cart table.shop_table.cart td.product-thumbnail {
        grid-area: image;
        width: 100% !important;
        justify-content: center;
    }
    .woocommerce-cart table.shop_table.cart td.product-thumbnail img {
        width: 100% !important;
        height: auto !important;
    }
    .woocommerce-cart table.shop_table.cart tbody tr.woocommerce-cart-form__cart-item td.product-name {
        grid-area: name;
        grid-column: 2 / 4;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        width: 100% !important;
        min-width: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .woocommerce-cart table.shop_table.cart tbody tr.woocommerce-cart-form__cart-item td.product-name a {
        font-size: 1.15rem;
        font-family: var(--font-heading);
        line-height: 1.2;
        margin-bottom: 5px;
        display: block;
        width: 100%;
    }
    .woocommerce-cart table.shop_table.cart tbody tr.woocommerce-cart-form__cart-item td.product-name p {
        font-size: 0.9rem;
        color: var(--color-text-light);
        margin: 0;
        width: 100%;
    }
    .woocommerce-cart table.shop_table.cart tbody tr.woocommerce-cart-form__cart-item td.product-price {
        grid-area: price;
        font-weight: bold;
        align-items: flex-start;
    }
    .woocommerce-cart table.shop_table.cart tbody tr.woocommerce-cart-form__cart-item td.product-quantity {
        grid-area: qt;
        justify-content: center;
        width: 100% !important;
    }
    .woocommerce-cart table.shop_table.cart tbody tr.woocommerce-cart-form__cart-item td.product-subtotal {
        display: none !important;
    }

    .woocommerce-cart table.shop_table.cart tbody tr.woocommerce-cart-form__cart-item td.product-remove {
        grid-area: remove;
        justify-content: flex-end;
    }
    .woocommerce-cart table.shop_table.cart td::before {
        display: none !important;
    }
    
    .woocommerce-cart .coupon {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-bottom: 20px;
    }
    .woocommerce-cart .coupon .input-text,
    .woocommerce-cart .coupon .button {
        width: 100% !important;
        margin: 0 !important;
        float: none !important;
    }
    
    .woocommerce-cart table.shop_table.cart td.actions {
        padding: 20px 0 !important;
        display: block !important;
        border: none !important;
    }
    
    .woocommerce-cart table.shop_table.cart td.actions .button[name="update_cart"] {
        width: 100% !important;
        display: block !important;
        margin-top: 10px;
    }

    /* Better PhotoSwipe close button on mobile */
    .pswp__button--close {
        transform: scale(1.5);
        transform-origin: top right;
        margin-top: 10px !important;
        margin-right: 10px !important;
        background-color: rgba(0,0,0,0.5) !important;
        border-radius: 50%;
    }
    
    .woocommerce div.product .product_title {
        font-size: 2rem;
    }

    .single-product-wrapper {
        padding: var(--spacing-md) 20px;
    }

    .related.products ul.products {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-hero-section {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
        padding: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .product-hero-section > * {
        min-width: 0;
        max-width: 100%;
    }

    .product-hero-header .product_title {
        font-size: 1.875rem;
    }

    .product-price-section .price {
        font-size: 2rem;
    }

    .book-details-section {
        padding: var(--spacing-md) 20px;
    }

    .book-details-title {
        font-size: 1.5rem;
    }

    .book-extras-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .condition-display {
        flex-direction: column;
        text-align: center;
    }

    /* Gallery width is handled by product-polish.css */
}

/* Very Small Mobile - 1 column strictly enforced to avoid overflow */
@media (max-width: 575px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }
}

/* Mobile - 1 column */
@media (max-width: 480px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr;
    }

    .woocommerce div.product .product_title {
        font-size: 1.75rem;
    }

    .related.products ul.products {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        width: 90%;
    }
}

/* ==========================================================================
   Refined Product Page Styles
   ========================================================================== */

/* Fix for Hero Gallery Layout (Alex Cross Issue) */
.product-hero-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    /* Remove gray background */
    /* Remove fixed min-height to allow content to dictate size */
}

.product-hero-gallery img {
    max-height: 700px;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: none;
    box-shadow: none;
    margin: 0 auto;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* Moved Badges - Inline Styles */
.product-badges-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 16px;
}

.inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: var(--color-primary);
    /* Default fallback */
}

.inline-badge i {
    font-size: 0.9rem;
}

/* Condition Specific Colors for Inline Badges */
.inline-badge.condition-mint {
    background: linear-gradient(135deg, #5a7d5a 0%, #466946 100%);
}

.inline-badge.condition-excellent {
    background: linear-gradient(135deg, #5a7d5a 0%, #507350 100%);
}

.inline-badge.condition-very_good {
    background: linear-gradient(135deg, #d4af37 0%, #c09b23 100%);
}

.inline-badge.condition-good {
    background: #f9f9f9;
    color: var(--color-text);
    border: 1px solid #ddd;
}

.inline-badge.condition-good i {
    color: var(--color-text-light);
}

/* Feature Specific Colors */
.inline-badge.feature-signed {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.inline-badge.feature-first_edition {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    color: #fff;
}

.inline-badge.feature-limited_ed {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.inline-badge.feature-leather_bound {
    background: linear-gradient(135deg, #8d6e63 0%, #795548 100%);
}

/* Refined Description */
.product-excerpt-section {
    margin: 20px 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

/* ==========================================================================
   404 Page - Editorial & Consistent
   ========================================================================== */

/* ==========================================================================
   404 Page - Editorial & Consistent
   ========================================================================== */

.error-404-wrapper {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Vertical center in container */
    padding: var(--spacing-xxl) 0;
    width: 100%;
    min-height: 60vh;
    /* Ensure height for better vertical centering */
}

/* Override Shop Grid for 404 Page to fix centering */
.error404 .shop-layout-container {
    display: block;
    grid-template-columns: none;
    gap: 0;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Inner Container - Holds Visual & Text */
.error-404-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xxl);
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.error-visual {
    flex: 0 0 350px;
    /* Fixed width for illustration */
    display: flex;
    justify-content: center;
    opacity: 0.85;
    /* Soften the image slightly */
}

.error-illustration {
    max-width: 100%;
    height: auto;
    filter: sepia(0.2) contrast(0.95);
    mix-blend-mode: multiply;
    /* Blend the white background into the page */
}

.error-text {
    flex: 1;
    max-width: 480px;
    text-align: left;
}

.error-404 .page-header {
    margin-bottom: var(--spacing-lg);
    border: none;
    padding: 0;
    text-align: left;
}

.error-404 .page-title {
    font-size: 3rem;
    font-weight: 400;
    color: var(--color-primary-dark);
    margin: 0;
    font-family: var(--font-heading);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.error-404 .error-message {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-text-light);
    margin: 0 0 var(--spacing-xl) 0;
    font-family: var(--font-primary);
    text-align: left;
}

/* Editorial Search Form */
.error-404 .editorial-search {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 8px;
    margin: 0 0 var(--spacing-xl) 0;
    width: 100%;
    /* Full width of text column */
    position: relative;
}

.editorial-search .search-field {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.125rem;
    color: var(--color-text);
    padding: 8px 32px 8px 0;
    /* Space for icon */
    width: 100%;
    outline: none;
    font-family: var(--font-primary);
}

.editorial-search .search-submit {
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.editorial-search .search-submit:hover {
    transform: translateY(-50%) scale(1.1);
    color: var(--color-primary-dark);
}

/* Actions */
.error-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-start;
    /* Left align buttons */
}

/* Responsive */
@media (max-width: 768px) {
    .error-404-container {
        flex-direction: column;
        gap: var(--spacing-lg);
        text-align: center;
    }

    .error-visual {
        flex: 0 0 auto;
        max-width: 200px;
        /* Smaller on mobile */
        order: -1;
        /* Image top */
    }

    .error-text {
        padding: 0 var(--spacing-md);
        text-align: center;
    }

    .error-404 .page-header,
    .error-404 .error-message,
    .error-actions {
        text-align: center;
        justify-content: center;
    }

    .error-404 .editorial-search {
        margin-left: auto;
        margin-right: auto;
    }
}

.product-description-fallback,
.product-excerpt-section p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--color-text);
    margin-bottom: 20px;
}

.product-description-fallback p {
    margin-bottom: 1em;
}

/* Adjust Header Spacing */
.product-hero-header {
    border-bottom: none;
    /* Remove separator line as we have badges now */
    padding-bottom: 0;
}

.product-meta-top {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Responsive Cart Styles
   ========================================================================== */

@media (max-width: 768px) {

    /* Adjust Container Padding */
    .woocommerce-cart #primary {
        padding-left: var(--spacing-sm) !important;
        padding-right: var(--spacing-sm) !important;
        margin-top: var(--spacing-lg);
    }

    /* Cart Table Adjustments */
    .woocommerce-cart table.cart .product-thumbnail {
        width: 80px !important;
        /* Smaller images */
    }

    .woocommerce-cart table.cart .product-thumbnail img {
        aspect-ratio: 1;
        /* Square on mobile for compactness? Or keep 2/3 */
        aspect-ratio: 2/3;
    }

    /* Hide Price Column (redundant with Subtotal since Qty=1) */
    .woocommerce-cart table.cart .product-price {
        display: none;
    }

    .woocommerce-cart table.cart .product-subtotal {
        width: 100px;
        /* Compact subtotal */
        font-size: 0.9rem;
    }

    /* Totals Section */
    .cart-collaterals .cart_totals {
        margin-top: var(--spacing-xl);
        padding: var(--spacing-md);
        /* Less padding */
    }

    .cart-collaterals .cart_totals h2 {
        font-size: 1.5rem;
    }

    /* Keep cart totals table rows side-by-side on mobile */
    .cart-collaterals .cart_totals table tr {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }
    .cart-collaterals .cart_totals table tr.order-total {
        border-bottom: none;
    }
    .cart-collaterals .cart_totals table th,
    .cart-collaterals .cart_totals table td {
        display: block !important;
        width: auto !important;
        border: none !important;
        padding: 15px 0 !important;
    }
    .cart-collaterals .cart_totals table td::before {
        display: none !important;
    }
    .cart-collaterals .cart_totals table th {
        text-align: left;
    }
    .cart-collaterals .cart_totals table td {
        text-align: right;
    }

    /* Coupon Section */
    .woocommerce-cart .coupon {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }

    .woocommerce-cart .coupon .input-text {
        width: 100% !important;
        margin: 0 !important;
    }

    .woocommerce-cart .coupon .button {
        width: 100%;
    }
}

@media (max-width: 480px) {

    /* Ultra Compact for Phones */
    .woocommerce-cart table.cart .product-remove {
        padding: 0 !important;
        width: 30px !important;
    }

    .woocommerce-cart table.cart .product-thumbnail {
        width: 60px !important;
    }

    .woocommerce-cart table.cart .product-name {
        font-size: 0.9rem;
        padding: var(--spacing-sm) !important;
    }

    .woocommerce-cart table.cart .product-subtotal {
        width: 80px;
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   UNIFIED BUTTON STYLES (Featured, New Arrivals, Related)
   Strictly enforced to match Featured Books (Outline Style)
   ========================================================================== */

/* Main Button State */
.featured-books-section .product .button,
.new-arrivals-section .product .button,
.related.products .product .button {
    background: var(--color-white) !important;
    color: var(--color-primary) !important;
    border: 2px solid var(--color-primary) !important;
    box-shadow: none !important;
    font-weight: 600 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: none !important;
    font-family: var(--font-body) !important;
    padding: 12px 24px !important;
    line-height: normal !important;
    border-radius: var(--radius-md) !important;
    opacity: 1 !important;
    margin-top: auto !important;
    /* Enforce Width and Margin */
    width: calc(100% - (var(--spacing-md) * 2)) !important;
    margin-left: var(--spacing-md) !important;
    margin-right: var(--spacing-md) !important;
    margin-bottom: var(--spacing-md) !important;
}

/* Remove Shine/Gradient Effects */
.featured-books-section .product .button::before,
.new-arrivals-section .product .button::before,
.related.products .product .button::before {
    display: none !important;
}

/* Hover State */
.featured-books-section .product .button:hover,
.new-arrivals-section .product .button:hover,
.related.products .product .button:hover {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(139, 69, 19, 0.25) !important;
    border-color: var(--color-primary) !important;
}

/* Ensure View Cart button (if present) matches or is hidden/standardized */
.featured-books-section .added_to_cart,
.new-arrivals-section .added_to_cart,
.related.products .added_to_cart {
    margin: 10px auto 16px !important;
    color: var(--color-text) !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   Checkout Styling Redesign
   ========================================================================== */

/* Coupon Link Spacing Fix */
.woocommerce-form-coupon-toggle .showcoupon {
    margin-left: 4px;
    display: inline-block;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.woocommerce-form-coupon-toggle .showcoupon:hover {
    color: var(--color-primary-dark);
}

/* Structure to match cart grid */
.woocommerce-checkout table.shop_table {
    border: none;
    width: 100%;
    margin-bottom: var(--spacing-xl);
    border-collapse: collapse;
    background: transparent;
}

.woocommerce-checkout table.shop_table th,
.woocommerce-checkout table.shop_table td {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border);
    background: transparent;
}

.woocommerce-checkout table.shop_table th:first-child,
.woocommerce-checkout table.shop_table td:first-child {
    padding-left: var(--spacing-lg);
}

.woocommerce-checkout table.shop_table th:last-child,
.woocommerce-checkout table.shop_table td:last-child {
    padding-right: var(--spacing-lg);
}

.woocommerce-checkout table.shop_table thead th {
    text-transform: uppercase;
    font-family: var(--font-body);
    font-size: 0.825rem;
    color: var(--color-text-light);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: var(--spacing-sm);
}

/* Layout for checkout items */
.checkout-product-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.checkout-product-thumbnail {
    width: 65px;
    flex-shrink: 0;
}

.checkout-product-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    object-fit: cover;
    aspect-ratio: 2/3;
    display: block;
}

.checkout-product-info {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-primary-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.checkout-product-info .cart-item-author {
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    color: var(--color-text-light);
    font-weight: 400;
    margin-top: 4px;
}

.checkout-product-info br {
    display: none;
}

/* Align values correctly */
.woocommerce-checkout-review-order-table .product-name {
    text-align: left;
}

.woocommerce-checkout-review-order-table .product-total {
    text-align: right;
    font-weight: 700;
    color: var(--color-primary-dark);
    font-size: 1.125rem;
}

.woocommerce-checkout table.shop_table tfoot th {
    text-align: left;
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

.woocommerce-checkout table.shop_table tfoot td {
    text-align: right;
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

.woocommerce-checkout table.shop_table tfoot tr:last-child th,
.woocommerce-checkout table.shop_table tfoot tr:last-child td {
    border-bottom: none;
}

/* Redesign for total numbers */
.woocommerce-checkout table.shop_table tfoot tr.order-total th,
.woocommerce-checkout table.shop_table tfoot tr.order-total td {
    border-top: 1px solid var(--color-text);
    color: var(--color-primary-dark);
    font-size: 1.25rem;
}