/*
 * Jubix Studios — style.css
 * 
 * KEY RULE: Footer display styles are scoped to body:not(.single-product)
 * so they never fight with the product page template's hiding rules.
 */


/* ============================================================
   PRODUCT PAGE GRID — canonical definition (one place only)
   ============================================================ */
.single-product .product-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 60px !important;
    max-width: 1400px !important;
    margin: 50px auto !important;
    clear: both !important;
}

.single-product .product-visual {
    display: block !important;
    width: 100% !important;
}

.single-product .product-info {
    display: block !important;
    width: 100% !important;
}


/* ============================================================
   FOOTER — scoped to NON-product pages only
   This prevents display:flex from overriding the product page's
   display:none on the native WordPress <footer> element.
   ============================================================ */

/* Center the whole footer section — NOT on product pages */
body:not(.single-product) .jubix-footer-section,
body:not(.single-product) footer,
body:not(.single-product) #colophon {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 60px 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    border-top: 1px solid #eeeeee !important;
    clear: both !important;
}

/* Logo row */
.jubix-footer-section .logo-brand,
body:not(.single-product) footer .logo-brand {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 25px !important;
    text-decoration: none !important;
}

.jubix-footer-section .logo-icon,
body:not(.single-product) footer .logo-icon {
    height: 45px !important;
    width: auto !important;
    margin-right: 12px !important;
}

/* Force footer nav links horizontal */
.footer-links ul,
.footer-menu ul,
.jubix-footer-section ul {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 40px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 20px 0 !important;
}

/* Style the footer links */
.footer-links ul li a,
.footer-menu ul li a,
.jubix-footer-section ul li a {
    font-family: 'Lato', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    color: #666666 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.footer-links ul li a:hover,
.footer-menu ul li a:hover,
.jubix-footer-section ul li a:hover {
    color: #D4AF37 !important;
}

/* Copyright text */
.copyright-text,
body:not(.single-product) footer p {
    color: #999999 !important;
    font-size: 0.85rem !important;
    margin-top: 20px !important;
}


/* ============================================================
   WOOCOMMERCE — Add to Cart: Quantity + Button Spacing
   
   WHY THE SELECTOR IS BROAD:
   functions.php loads a fully custom single-product.php template
   that does NOT use WooCommerce's standard <div class="product">
   wrapper. The previous selector (.single-product div.product form.cart)
   never matched. We now target form.cart directly under .single-product,
   with !important to win over any WooCommerce or plugin-level defaults.
   Both selectors are kept so it works whether or not div.product exists.
   ============================================================ */
.single-product form.cart,
.single-product div.product form.cart {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    align-items: stretch !important;
}

.single-product form.cart .quantity,
.single-product div.product form.cart .quantity {
    margin-bottom: 0 !important; /* gap handles rhythm — no double-spacing */
    width: auto !important;      /* prevent quantity stretching full width */
}

.single-product form.cart button.single_add_to_cart_button,
.single-product div.product form.cart button.single_add_to_cart_button {
    margin-top: 0 !important;    /* no stacking on top of gap */
    width: 100% !important;      /* full-width CTA */
}


/* ============================================================
   WOOCOMMERCE — Shop Page: Book Number Label
   
   Injected by functions.php hook #9 (woocommerce_after_shop_loop_item_title,
   priority 6). Sits between the product title and the price in each card.
   ============================================================ */
.woocommerce ul.products li.product .jubix-book-num {
    display: block !important;
    font-family: 'Lato', sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #aaa !important;
    margin: -2px 0 8px !important;
}


/* ============================================================
   WOOCOMMERCE — Product Page: Quantity Input Size
   
   WHY: WooCommerce's default qty input is very small (~45px wide, ~30px tall).
   We size it to match the visual scale of the rest of the product info column.
   ============================================================ */
.single-product .quantity input.qty,
.single-product .quantity input[type="number"] {
    width: 80px !important;
    height: 52px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    padding: 0 10px !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    -moz-appearance: textfield !important; /* hide Firefox number spinner */
}
/* Hide Chrome/Safari number spinner arrows */
.single-product .quantity input.qty::-webkit-outer-spin-button,
.single-product .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}


/* ============================================================
   WOOCOMMERCE — Cart Page: Body Text + Checkout Button
   
   ROOT CAUSE OF PREVIOUS FAILURES:
   The cart page uses WooCommerce Blocks (not the legacy shortcode cart).
   Blocks renders with divs and completely different class names — there is
   no table.shop_table, no .cart_totals, and no .wc-proceed-to-checkout.
   All previous cart CSS was targeting the wrong elements.
   
   Additionally, 'woocommerce-general' (our previous dependency) is NOT
   registered on Block-based pages, so style.css was silently not loading
   on the cart page at all. Fixed in functions.php (priority 100, no dep).
   ============================================================ */

/* --- BLOCKS CART: Product item text --- */
body.woocommerce-cart .wc-block-components-product-name,
body.woocommerce-cart .wc-block-components-product-name a,
body.woocommerce-cart .wc-block-cart-item__product,
body.woocommerce-cart .wc-block-components-product-metadata,
body.woocommerce-cart .wc-block-components-product-metadata p,
body.woocommerce-cart .wc-block-cart-items__header,
body.woocommerce-cart .wc-block-cart-item__total {
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

/* --- BLOCKS CART: Totals sidebar text --- */
body.woocommerce-cart .wc-block-cart__sidebar,
body.woocommerce-cart .wc-block-components-totals-wrapper,
body.woocommerce-cart .wc-block-components-totals-item,
body.woocommerce-cart .wc-block-components-order-summary {
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

/* --- LEGACY FALLBACK: Shortcode cart (in case Blocks is not active) --- */
body.woocommerce-cart table.shop_table td,
body.woocommerce-cart table.shop_table th,
body.woocommerce-cart .cart_item .product-name,
body.woocommerce-cart .cart_item .product-name a,
body.woocommerce-cart .cart_totals,
body.woocommerce-cart .cart_totals table td,
body.woocommerce-cart .cart_totals table th {
    font-size: 1rem !important;
    line-height: 1.6 !important;
}


/* --- BLOCKS CART: Checkout Button ---
   The Blocks submit button has class wc-block-cart__submit-button and
   wp-element-button. The parent theme's .wp-element-button style is what
   applies the pill shape. We override both the button and its container.
   Two-layer approach: container clips + button direct radius. */
body.woocommerce-cart .wc-block-cart__submit-container {
    border-radius: 8px !important;
    overflow: hidden !important;
}

body.woocommerce-cart .wc-block-cart__submit-button,
body.woocommerce-cart .wc-block-cart__submit-button.wp-element-button,
body.woocommerce-cart .wc-block-cart__submit-container a,
body.woocommerce-cart .wc-block-cart__submit-container button,
body.woocommerce-cart .wc-block-cart__submit-container .wp-element-button {
    border-radius: 8px !important;
    -webkit-border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.07em !important;
    padding: 14px 24px !important;
    line-height: 1.4 !important;
    min-height: auto !important;
    height: auto !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
}

/* --- LEGACY FALLBACK: Shortcode cart checkout button --- */
body.woocommerce-cart .wc-proceed-to-checkout {
    border-radius: 8px !important;
    overflow: hidden !important;
}
body.woocommerce-cart .wc-proceed-to-checkout a,
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
body.woocommerce-cart .wc-proceed-to-checkout a.button.alt,
body.woocommerce-cart .wc-proceed-to-checkout a.wc-forward {
    border-radius: 8px !important;
    -webkit-border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    padding: 14px 24px !important;
    min-height: auto !important;
    width: 100% !important;
    display: block !important;
}