/*
 * BetterBred — WooCommerce CSS Overrides
 * File: /wp-content/themes/betterbred/bb-woocommerce.css
 *
 * DEPLOY AT CUTOVER — not before.
 *
 * Loaded conditionally on WooCommerce pages only via functions.php:
 *   if ( function_exists('is_woocommerce') && ( is_woocommerce() || is_cart() || is_checkout() ) )
 *
 * PURPOSE:
 * bb-global.css handles fonts, colors, and theme suppression globally.
 * This file handles WooCommerce's own stylesheet which loads on top of
 * everything and wins on buttons, inputs, tables, and notices unless
 * explicitly overridden here.
 *
 * FUTURE: Throw this file away when WooCommerce is replaced with Stripe.
 * No other file depends on it.
 *
 * SECTIONS:
 * 1.  Page layout / wrapper
 * 2.  Typography within WC content
 * 3.  Buttons
 * 4.  Form inputs and labels
 * 5.  Cart table
 * 6.  Order summary / totals
 * 7.  Checkout sections
 * 8.  Payment section
 * 9.  Notices (info, error, success)
 * 10. Coupon field
 * 11. My Account (WC default endpoints — fallback if snippet not active)
 */


/* ── 1. PAGE LAYOUT ───────────────────────────────────────────────────────── */
.woocommerce-page,
.woocommerce-cart,
.woocommerce-checkout {
    background: var(--cream) !important;
}

/* WooCommerce wraps content in .woocommerce — give it breathing room */
.woocommerce,
.woocommerce-page .woocommerce {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 40px 80px;
}

/* Remove WC's own breadcrumb */
.woocommerce-breadcrumb { display: none !important; }


/* ── 2. TYPOGRAPHY ────────────────────────────────────────────────────────── */
.woocommerce h2,
.woocommerce h3 {
    font-family: 'Cormorant Garamond', serif !important;
    font-weight: 400 !important;
    color: var(--forest) !important;
    margin-bottom: 20px;
}
.woocommerce h2 { font-size: 1.8rem; }
.woocommerce h3 { font-size: 1.35rem; }

/* Section eyebrow style for checkout column headings */
#billing h3,
#shipping h3,
#order_review_heading {
    font-family: 'Jost', sans-serif !important;
    font-size: .75rem !important;
    font-weight: 600 !important;
    letter-spacing: .14em !important;
    text-transform: uppercase !important;
    color: var(--clay-safe) !important;
    margin-bottom: 18px !important;
}


/* ── 3. BUTTONS ───────────────────────────────────────────────────────────── */
/* WooCommerce uses .button, .alt, and various specific classes */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
    font-family: 'Jost', sans-serif !important;
    font-size: .78rem !important;
    font-weight: 600 !important;
    letter-spacing: .1em !important;
    text-transform: uppercase !important;
    padding: 12px 24px !important;
    border-radius: var(--radius) !important;
    border: none !important;
    cursor: pointer !important;
    transition: background .2s !important;
    text-decoration: none !important;
}

/* Primary / .alt buttons — forest green */
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce .checkout-button,
.woocommerce #place_order {
    background: var(--forest) !important;
    color: var(--cream) !important;
}
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce .checkout-button:hover,
.woocommerce #place_order:hover {
    background: var(--forest-md) !important;
    color: var(--cream) !important;
}

/* Secondary buttons — outline style */
.woocommerce a.button:not(.alt),
.woocommerce button.button:not(.alt) {
    background: transparent !important;
    color: var(--forest-md) !important;
    border: 1px solid rgba(27,58,45,.25) !important;
}
.woocommerce a.button:not(.alt):hover,
.woocommerce button.button:not(.alt):hover {
    background: rgba(27,58,45,.05) !important;
    border-color: rgba(27,58,45,.4) !important;
}

/* Proceed to checkout button — full width */
.wc-proceed-to-checkout {
    padding: 0 !important;
    margin-top: 16px;
}
.wc-proceed-to-checkout a.checkout-button {
    display: block !important;
    text-align: center !important;
    padding: 14px 24px !important;
    font-size: .8rem !important;
}

/* Place order button — full width */
#place_order {
    width: 100% !important;
    padding: 14px 24px !important;
    font-size: .8rem !important;
    margin-top: 8px;
}


/* ── 4. FORM INPUTS AND LABELS ────────────────────────────────────────────── */
.woocommerce form .form-row label,
.woocommerce-page form .form-row label,
.woocommerce form .form-row label.checkbox {
    font-family: 'Jost', sans-serif !important;
    font-size: .75rem !important;
    font-weight: 600 !important;
    letter-spacing: .07em !important;
    text-transform: uppercase !important;
    color: var(--slate) !important;
    margin-bottom: 6px !important;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-page form .form-row input.input-text {
    font-family: 'Jost', sans-serif !important;
    font-size: .9rem !important;
    font-weight: 300 !important;
    color: var(--charcoal) !important;
    background: #fff !important;
    border: 1px solid rgba(27,58,45,.2) !important;
    border-radius: var(--radius) !important;
    padding: 11px 14px !important;
    width: 100% !important;
    outline: none !important;
    transition: border-color .2s, box-shadow .2s !important;
    box-shadow: none !important;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row select:focus {
    border-color: var(--forest) !important;
    box-shadow: 0 0 0 3px rgba(27,58,45,.08) !important;
}

/* Required asterisk */
.woocommerce form .form-row .required { color: var(--gold) !important; }

/* Inline validation */
.woocommerce form .form-row.woocommerce-invalid input.input-text {
    border-color: #c0392b !important;
}
.woocommerce form .form-row.woocommerce-validated input.input-text {
    border-color: var(--forest-lt) !important;
}


/* ── 5. CART TABLE ────────────────────────────────────────────────────────── */
.woocommerce table.shop_table {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
    width: 100% !important;
}
.woocommerce table.shop_table th {
    font-family: 'Jost', sans-serif !important;
    font-size: .72rem !important;
    font-weight: 600 !important;
    letter-spacing: .1em !important;
    text-transform: uppercase !important;
    color: var(--clay-safe) !important;
    background: var(--cream-dk) !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--border) !important;
}
.woocommerce table.shop_table td {
    font-size: .9rem !important;
    color: var(--charcoal) !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid var(--border) !important;
    vertical-align: middle !important;
}
.woocommerce table.shop_table tr:last-child td { border-bottom: none !important; }
.woocommerce table.shop_table .product-name a {
    color: var(--forest) !important;
    font-weight: 500 !important;
}
.woocommerce table.shop_table .product-name a:hover {
    color: var(--forest-md) !important;
    text-decoration: underline !important;
}

/* Cart quantity input */
.woocommerce .quantity .qty {
    font-family: 'Jost', sans-serif !important;
    font-size: .9rem !important;
    border: 1px solid rgba(27,58,45,.2) !important;
    border-radius: var(--radius) !important;
    padding: 6px 10px !important;
    width: 60px !important;
    text-align: center !important;
    color: var(--charcoal) !important;
}

/* Remove item link */
.woocommerce table.cart td.product-remove a.remove {
    color: var(--clay-safe) !important;
    font-size: 1.2rem !important;
    line-height: 1 !important;
    transition: color .2s !important;
}
.woocommerce table.cart td.product-remove a.remove:hover {
    color: #c0392b !important;
    background: none !important;
}


/* ── 6. ORDER TOTALS ──────────────────────────────────────────────────────── */
.woocommerce .cart-collaterals,
.woocommerce-page .cart-collaterals {
    margin-top: 32px;
}
.woocommerce .cart_totals,
.woocommerce-page .cart_totals {
    float: none !important;
    width: 100% !important;
    max-width: 380px !important;
    margin-left: auto !important;
}
.woocommerce .cart_totals h2 {
    font-family: 'Jost', sans-serif !important;
    font-size: .75rem !important;
    font-weight: 600 !important;
    letter-spacing: .14em !important;
    text-transform: uppercase !important;
    color: var(--clay-safe) !important;
    margin-bottom: 12px !important;
}
.woocommerce table.shop_table.shop_table_responsive tfoot tr th,
.woocommerce table.shop_table.shop_table_responsive tfoot tr td {
    font-family: 'Jost', sans-serif !important;
    font-size: .87rem !important;
    color: var(--charcoal) !important;
}
/* Order total row — emphasise */
.woocommerce table.shop_table tfoot .order-total th,
.woocommerce table.shop_table tfoot .order-total td {
    font-weight: 600 !important;
    font-size: .95rem !important;
    border-top: 1px solid var(--border) !important;
}
.woocommerce table.shop_table tfoot .order-total td .amount {
    font-family: 'Cormorant Garamond', serif !important;
    font-size: 1.3rem !important;
    font-weight: 400 !important;
    color: var(--forest) !important;
}


/* ── 7. CHECKOUT SECTIONS ─────────────────────────────────────────────────── */
.woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
}

/* Two-column checkout layout */
.woocommerce-checkout .col2-set {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 {
    float: none !important;
    width: 100% !important;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}
@media (max-width: 640px) {
    .woocommerce-checkout .col2-set { grid-template-columns: 1fr; }
}


/* ── 8. PAYMENT SECTION ───────────────────────────────────────────────────── */
#payment {
    background: #fff !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 24px 28px !important;
    margin-bottom: 24px;
}
#payment ul.payment_methods {
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 16px !important;
    margin-bottom: 16px !important;
    list-style: none !important;
}
#payment ul.payment_methods li {
    padding: 8px 0 !important;
    font-size: .9rem !important;
    color: var(--charcoal) !important;
}
#payment ul.payment_methods li label {
    font-weight: 500 !important;
    color: var(--charcoal) !important;
    font-size: .9rem !important;
    cursor: pointer !important;
}
#payment .payment_box {
    background: var(--cream-dk) !important;
    border-radius: var(--radius) !important;
    padding: 14px 16px !important;
    margin-top: 8px !important;
    font-size: .84rem !important;
    color: var(--slate) !important;
}
/* Stripe card element wrapper */
#payment .stripe-card-element,
#payment #stripe-card-element {
    border: 1px solid rgba(27,58,45,.2) !important;
    border-radius: var(--radius) !important;
    padding: 12px 14px !important;
    background: #fff !important;
}


/* ── 9. NOTICES ───────────────────────────────────────────────────────────── */
.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
    font-family: 'Jost', sans-serif !important;
    font-size: .87rem !important;
    border-radius: var(--radius) !important;
    border-top: none !important;
    padding: 14px 18px !important;
    margin-bottom: 20px !important;
    list-style: none !important;
}
.woocommerce-info {
    background: rgba(27,58,45,.06) !important;
    border-left: 3px solid var(--forest) !important;
    color: var(--charcoal) !important;
}
.woocommerce-message {
    background: rgba(27,58,45,.06) !important;
    border-left: 3px solid var(--gold) !important;
    color: var(--charcoal) !important;
}
.woocommerce-error {
    background: rgba(192,57,43,.06) !important;
    border-left: 3px solid #c0392b !important;
    color: #c0392b !important;
}
/* WC notice links */
.woocommerce-info a,
.woocommerce-message a {
    color: var(--forest) !important;
    font-weight: 500 !important;
    text-decoration: underline !important;
}


/* ── 10. COUPON FIELD ─────────────────────────────────────────────────────── */
.woocommerce .checkout_coupon,
.woocommerce .coupon {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    padding: 16px 18px !important;
    background: #fff !important;
    margin-bottom: 20px !important;
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
}
.woocommerce .coupon label {
    font-size: .75rem !important;
    font-weight: 600 !important;
    letter-spacing: .07em !important;
    text-transform: uppercase !important;
    color: var(--slate) !important;
    margin-bottom: 6px !important;
    display: block !important;
}
.woocommerce .coupon input.input-text {
    flex: 1 !important;
    min-width: 160px !important;
}


/* ── 11. MY ACCOUNT (WC DEFAULT FALLBACK) ─────────────────────────────────── */
/*
 * These only apply if the custom my-account.php snippet is not active.
 * Once the snippet is live these are irrelevant but harmless.
 */
.woocommerce-account .woocommerce-MyAccount-navigation {
    font-family: 'Jost', sans-serif !important;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    overflow: hidden !important;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block !important;
    padding: 11px 18px !important;
    font-size: .87rem !important;
    color: var(--slate) !important;
    border-bottom: 1px solid var(--border) !important;
    transition: color .2s, background .2s !important;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    color: var(--forest) !important;
    background: rgba(27,58,45,.02) !important;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    color: var(--forest) !important;
    font-weight: 600 !important;
    background: rgba(27,58,45,.04) !important;
    border-left: 2px solid var(--gold) !important;
}