/* =======================================================
   CART PAGE – Match ThrillCompetitionsMockup/cart.html
   Layout: 2fr 1fr grid, dark theme, styled coupon & buttons

   CSS CONNECTED TO CART (load order when is_cart()):
   1. Astra parent + WooCommerce plugin CSS (theme/plugin)
   2. astra-child style.css
   3. thrill-comps-global  → global_styles.css (no .cart_totals rules)
   4. thrill-comps-header → header_styles.css (no .cart_totals rules)
   5. thrill-comps-cards  → live_competitions_product_card_fix.css (no .cart_totals rules)
   6. thrill-comps-woo    → woocommerce_raffle_styles.css (no .cart_totals rules)
   7. thrill-comps-cart   → THIS FILE (cart_styles.css) – ONLY theme file that styles .cart_totals, .wc-proceed-to-checkout, Cart Totals card, buttons, trust badges.

   JS: cart-quantity.js. Snippet: CART_TRUST_BADGES.php (no hook).
   Do not rely on :not() to hide trust-badges – use .wc-proceed-to-checkout + .trust-badges to show.
   ======================================================= */

/* Font import – Montserrat + Anton (match additional css) */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Montserrat:wght@400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

/* Body + all text – Montserrat (override Astra/theme) */
body.woocommerce-cart,
body.woocommerce-cart .cart-section,
body.woocommerce-cart .cart-summary,
body.woocommerce-cart .cart_totals,
body.woocommerce-cart .cart_totals th,
body.woocommerce-cart .cart_totals td,
body.woocommerce-cart .wc-proceed-to-checkout,
body.woocommerce-cart table.cart,
body.woocommerce-cart table.cart td {
    font-family: 'Montserrat', 'Poppins', sans-serif !important;
}

body.woocommerce-cart h1,
body.woocommerce-cart h2,
body.woocommerce-cart h3,
body.woocommerce-cart .page-title,
body.woocommerce-cart .entry-title {
    font-family: 'Anton', impact, sans-serif !important;
}

/* Hide cursor-follower on cart – prevents white circle in CART TOTALS */
body.woocommerce-cart .cursor-follower {
    display: none !important;
}

/* Remove unknown white box – notices wrapper, Astra wrappers, default white backgrounds */
body.woocommerce-cart .woocommerce-notices-wrapper {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    min-height: 0 !important;
}

body.woocommerce-cart .woocommerce-info,
body.woocommerce-cart .woocommerce-message {
    background: rgba(21, 26, 33, 0.9) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: #fff !important;
}

/* Hide empty notice wrapper (no content) */
body.woocommerce-cart .woocommerce-notices-wrapper:empty {
    display: none !important;
}

body.woocommerce-cart .ast-container,
body.woocommerce-cart .woocommerce-cart-form,
body.woocommerce-cart table.cart,
body.woocommerce-cart table.cart thead,
body.woocommerce-cart table.cart tbody,
body.woocommerce-cart table.cart th,
body.woocommerce-cart table.cart td,
body.woocommerce-cart table.cart td.actions,
body.woocommerce-cart .cart_totals .shop_table {
    background: transparent !important;
}

/* Page header – a little top space, normal title size */
body.woocommerce-cart .page-header,
body.woocommerce-cart .entry-header {
    padding: 48px 0 20px !important;
    text-align: center !important;
    background: transparent !important;
    margin-bottom: 0 !important;
}

body.woocommerce-cart .page-title,
body.woocommerce-cart .entry-title {
    font-family: 'Anton', sans-serif !important;
    font-size: 28px !important;
    line-height: 1.2 !important;
    color: white !important;
    text-transform: uppercase !important;
}

/* Main content area – clear spacing below header */
body.woocommerce-cart .site-main,
body.woocommerce-cart .woocommerce {
    padding-top: 0 !important;
}

/* Main cart section – dark background */
body.woocommerce-cart .site-main,
body.woocommerce-cart .woocommerce,
body.woocommerce-cart .ast-container,
body.woocommerce-cart #primary {
    background: var(--bg-obsidian) !important;
}

/* Grid: 2fr 1fr – cart.html layout (cart-section with cart-grid) */
body.woocommerce-cart .woocommerce:has(.cart-section) {
    display: block !important;
    padding: 0 !important;
}

body.woocommerce-cart .cart-section .cart-grid {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important;
    gap: 40px !important;
    align-items: start !important;
    width: 100% !important;
}

/* Right-hand card – content brought in left within container */
body.woocommerce-cart .cart-summary {
    background: #151a21 !important;
    border-radius: 8px !important;
    padding: 24px 24px 24px 20px !important;
    height: fit-content;
}

/* Reset Woo wrapper inside card so card background shows */
body.woocommerce-cart .cart-summary .cart_totals {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Astra container – full width so our grid controls layout */
body.woocommerce-cart .ast-container,
body.woocommerce-cart .site-content .ast-container {
    max-width: 100% !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Container – ensure consistent width for alignment */
body.woocommerce-cart .cart-section .container {
    max-width: var(--container-width, 1200px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 40px !important;
    padding-right: 40px !important;
}

/* Right column – fix alignment, stick to top */
body.woocommerce-cart .cart-summary {
    align-self: start !important;
    position: sticky !important;
    top: 120px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

/* Prevent grid overflow causing misalignment */
body.woocommerce-cart .cart-items {
    min-width: 0 !important;
}

/* Fallback for non-cart-section layout (legacy) */
body.woocommerce-cart .woocommerce:not(:has(.cart-section)) {
    display: grid !important;
    grid-template-columns: 1.5fr minmax(340px, 1fr) !important;
    gap: 40px !important;
    align-items: start !important;
    padding: 60px 0 !important;
}

/* Notices span full width */
body.woocommerce-cart .woocommerce-notices-wrapper {
    grid-column: 1 / -1;
}

body.woocommerce-cart .woocommerce:not(:has(.cart-section)) .woocommerce-cart-form {
    grid-column: 1;
}

body.woocommerce-cart .woocommerce:not(:has(.cart-section)) .cart-collaterals {
    grid-column: 2;
}

body.woocommerce-cart .cart-summary .cart-collaterals,
body.woocommerce-cart .cart-collaterals {
    margin-top: 0 !important;
    min-width: 0 !important; /* Allow shrink on small screens */
}

body.woocommerce-cart .cart_totals {
    margin-top: 0 !important;
}

@media (max-width: 900px) {
    body.woocommerce-cart .cart-section .cart-grid {
        grid-template-columns: 1fr !important;
    }
    body.woocommerce-cart .woocommerce:not(:has(.cart-section)) {
        grid-template-columns: 1fr !important;
    }
    body.woocommerce-cart .woocommerce-cart-form,
    body.woocommerce-cart .cart-collaterals {
        grid-column: 1;
    }
}

/* Cart table – dark theme, fix indenting
   EDIT INDENT HERE: th/td padding below. If your changes don’t show, check
   Appearance → Customize → Additional CSS (it overrides this file) and clear cache.
   See thrill-comps/CART_CSS_WHERE_TO_EDIT.md for full explanation. */
body.woocommerce-cart table.cart {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
}

body.woocommerce-cart table.cart thead th {
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    padding: 15px 0 !important;
    color: #fff !important;
    font-weight: 600 !important;
}

body.woocommerce-cart table.cart thead th:first-child {
    padding-left: 0 !important;
}

body.woocommerce-cart table.cart tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

body.woocommerce-cart table.cart td {
    padding: 20px 16px 20px 0 !important;
    color: #fff !important;
    border: none !important;
}

body.woocommerce-cart table.cart td:first-child {
    padding-left: 0 !important;
}

body.woocommerce-cart table.cart .product-name a {
    color: white !important;
}

/* Tickets column – monospaced, match mockup */
body.woocommerce-cart table.cart .product-tickets .ticket-numbers,
body.woocommerce-cart .cart-items .product-tickets .ticket-numbers {
    font-family: 'Courier New', monospace !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    color: #ccc !important;
}
body.woocommerce-cart table.cart .product-tickets .ticket-placeholder {
    color: #999;
}

body.woocommerce-cart table.cart .product-price .amount,
body.woocommerce-cart table.cart .product-subtotal .amount {
    color: var(--neon-amber) !important;
    font-weight: 600 !important;
}

/* Product thumbnail – compact like mockup */
body.woocommerce-cart table.cart .product-thumbnail img,
body.woocommerce-cart .cart-items .product-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    display: block !important;
}
body.woocommerce-cart .cart-items .product-thumbnail a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

/* Remove link – single aligned circle behind trash, no double outline */
body.woocommerce-cart table.cart td.product-remove {
    vertical-align: middle !important;
    text-align: center !important;
}
body.woocommerce-cart .cart-remove-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: inherit;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}
body.woocommerce-cart .cart-remove-link:focus {
    outline: none !important;
}
body.woocommerce-cart .cart-remove-link:focus-visible .cart-remove-circle {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}
body.woocommerce-cart .cart-remove-circle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #888 !important;
    font-size: 14px;
    box-sizing: border-box;
    outline: none !important;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}
body.woocommerce-cart .cart-remove-link:hover .cart-remove-circle {
    background: rgba(160, 34, 35, 0.35);
    border-color: var(--primary-red);
    color: #fff !important;
    box-shadow: 0 0 14px rgba(160, 34, 35, 0.4);
}
body.woocommerce-cart .cart-remove-link:active .cart-remove-circle {
    transform: scale(0.96);
}
body.woocommerce-cart table.cart .product-remove a.cart-remove-link,
body.woocommerce-cart table.cart .product-remove a {
    background: none !important;
    border: none !important;
}

/* Quantity input + +/- buttons – dark theme */
body.woocommerce-cart table.cart .quantity input.qty,
body.woocommerce-cart .cart-items .quantity input.qty {
    background: #151a21 !important;
    border: none !important;
    border-left: 1px solid rgba(255,255,255,0.2) !important;
    border-right: 1px solid rgba(255,255,255,0.2) !important;
    color: #fff !important;
    width: 44px !important;
    height: 36px !important;
    text-align: center !important;
    font-size: 14px !important;
    -moz-appearance: textfield !important;
}
body.woocommerce-cart .quantity input.qty::-webkit-outer-spin-button,
body.woocommerce-cart .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Tickets column: number input – fits dark vibe, native spinner, focus glow */
body.woocommerce-cart .product-tickets input.cart-ticket-qty,
body.woocommerce-cart .cart-items .product-tickets input.qty {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #1a1a1a !important;
    width: 60px !important;
    height: 38px !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    -moz-appearance: unset !important;
    appearance: auto !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
body.woocommerce-cart .product-tickets input.cart-ticket-qty:focus,
body.woocommerce-cart .cart-items .product-tickets input.qty:focus {
    outline: none !important;
    border-color: var(--volt-cyan, #00F5FF) !important;
    box-shadow: 0 0 0 2px rgba(0, 245, 255, 0.2) !important;
}
body.woocommerce-cart .product-tickets input.cart-ticket-qty::-webkit-outer-spin-button,
body.woocommerce-cart .product-tickets input.cart-ticket-qty::-webkit-inner-spin-button,
body.woocommerce-cart .cart-items .product-tickets input.qty::-webkit-outer-spin-button,
body.woocommerce-cart .cart-items .product-tickets input.qty::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button;
    opacity: 1;
}
body.woocommerce-cart .qty-buttons .qty-minus,
body.woocommerce-cart .qty-buttons .qty-plus {
    background: var(--hero-gradient) !important;
    color: #fff !important;
}
body.woocommerce-cart .qty-buttons .qty-minus:hover,
body.woocommerce-cart .qty-buttons .qty-plus:hover {
    filter: brightness(1.15) !important;
    color: #fff !important;
}
body.woocommerce-cart .qty-buttons .qty-minus:disabled,
body.woocommerce-cart .qty-buttons .qty-plus:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== COUPON – dark theme, match mockup style ===== */
body.woocommerce-cart .coupon {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
    margin-bottom: 20px !important;
}

body.woocommerce-cart .coupon label {
    display: none !important;
}

body.woocommerce-cart .coupon input#coupon_code {
    background: #151a21 !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: #fff !important;
    padding: 12px 18px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    min-width: 200px !important;
}

body.woocommerce-cart .coupon input#coupon_code::placeholder {
    color: #777 !important;
}

body.woocommerce-cart .coupon input#coupon_code:focus {
    outline: none !important;
    border-color: var(--volt-cyan) !important;
}

body.woocommerce-cart .coupon button[name="apply_coupon"] {
    background: var(--hero-gradient) !important;
    color: white !important;
    padding: 12px 24px !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

body.woocommerce-cart .coupon button[name="apply_coupon"]:hover {
    filter: brightness(1.1) !important;
}

/* Update Cart button */
body.woocommerce-cart button[name="update_cart"] {
    background: var(--hero-gradient) !important;
    color: white !important;
    padding: 14px 28px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    border: none !important;
    border-radius: 6px !important;
}

body.woocommerce-cart button[name="update_cart"]:hover:not(:disabled) {
    filter: brightness(1.1) !important;
}

/* ===== CART TOTALS – content left, brought in within container ===== */
body.woocommerce-cart .cart_totals {
    background: #151a21 !important;
    padding: 36px 40px 40px 24px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    min-width: 0 !important;
    text-align: left !important;
}
body.woocommerce-cart .cart_totals h2,
body.woocommerce-cart .cart_totals h3 {
    text-align: left !important;
}
/* When inside cart-summary, inherit card from parent – no double background */
body.woocommerce-cart .cart-summary .cart_totals {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
}

/* Hide white box, photo, shipping elements – not needed for raffles (trust-badges use <i>, not img) */
body.woocommerce-cart .cart_totals > *:first-child:empty,
body.woocommerce-cart .cart_totals .woocommerce-shipping-destination,
body.woocommerce-cart .cart_totals .woocommerce-shipping-calculator,
body.woocommerce-cart .cart_totals .shipping-calculator-form,
body.woocommerce-cart .cart_totals a.shipping-calculator-button,
body.woocommerce-cart .cart_totals img,
body.woocommerce-cart .cart-collaterals img {
    display: none !important;
}


body.woocommerce-cart .cart-collaterals {
    position: relative !important;
}

body.woocommerce-cart .cart_totals h2,
body.woocommerce-cart .cart_totals h3 {
    font-family: 'Anton', sans-serif !important;
    color: white !important;
    margin-bottom: 24px !important;
    font-size: 24px !important;
    padding: 0 !important;
}

/* Cart totals – flex layout, alignment matches screenshot */
body.woocommerce-cart .cart_totals .cart-totals-rows,
body.woocommerce-cart .cart_totals .wc-proceed-to-checkout {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Avoid overflow: hidden – it clips the last digit and can make "£4.00" look like "£4.0C" */
body.woocommerce-cart .cart_totals .cart-subtotal-row,
body.woocommerce-cart .cart_totals .order-total-row {
    overflow: visible !important;
}

body.woocommerce-cart .cart_totals .cart-subtotal-row span:last-child,
body.woocommerce-cart .cart_totals .order-total-row span:last-child {
    flex-shrink: 0 !important;
    margin-left: 12px !important;
    font-variant-numeric: tabular-nums !important;
    font-family: 'Montserrat', 'Poppins', sans-serif !important;
}

/* Subtotal – label and value white, aligned */
body.woocommerce-cart .cart_totals .cart-subtotal-row,
body.woocommerce-cart .cart_totals .cart-subtotal-row span {
    color: #ffffff !important;
    font-weight: 600 !important;
}
body.woocommerce-cart .cart_totals .cart-subtotal-row span:last-child {
    font-weight: 600 !important;
}
/* Coupons, fees, tax – grey */
body.woocommerce-cart .cart_totals .cart-discount,
body.woocommerce-cart .cart_totals .fee,
body.woocommerce-cart .cart_totals .tax-total,
body.woocommerce-cart .cart_totals .tax-rate {
    font-weight: 600 !important;
}

body.woocommerce-cart .cart_totals .order-total-row {
    font-weight: 700 !important;
}

/* Total amount – bold white (match screenshot) */
body.woocommerce-cart .cart_totals .order-total-row span:last-child,
body.woocommerce-cart .cart_totals .order-total-row .amount {
    color: #fff !important;
}

/* Shipping table (when shown) – style to match */
body.woocommerce-cart .cart_totals .shop_table {
    background: transparent !important;
    border: none !important;
}

body.woocommerce-cart .cart_totals tr.shipping {
    display: none !important;
}

/* Proceed to Checkout button – prevent text wrap */
body.woocommerce-cart .wc-proceed-to-checkout {
    margin-top: 24px !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    width: 100% !important;
    min-width: 200px !important;
    padding: 16px 24px !important;
    background: var(--hero-gradient) !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover {
    filter: brightness(1.1) !important;
    color: white !important;
}

/* Trust badges – always show the block right after Proceed to Checkout (single row) */
body.woocommerce-cart .cart_totals .wc-proceed-to-checkout + .trust-badges {
    margin-top: 24px;
    padding-top: 20px;
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 16px;
    opacity: 0.5;
    color: rgba(255, 255, 255, 0.7);
}
body.woocommerce-cart .cart_totals .wc-proceed-to-checkout + .trust-badges i {
    font-size: 24px;
}
/* Hide duplicates only: badges inside button block, or any second row */
body.woocommerce-cart .cart_totals .wc-proceed-to-checkout .trust-badges {
    display: none !important;
}
body.woocommerce-cart .cart_totals .trust-badges ~ .trust-badges {
    display: none !important;
}

/* Mobile – full width, comfortable padding */
@media (max-width: 900px) {
    body.woocommerce-cart .cart-section .cart-grid {
        grid-template-columns: 1fr !important;
    }
    body.woocommerce-cart .cart_totals {
        padding: 32px 24px 36px !important;
    }
    body.woocommerce-cart .cart_totals .shop_table th,
    body.woocommerce-cart .cart_totals .shop_table td {
        padding: 10px 0 !important;
    }
}

/* ===== MOBILE CART TABLE – aligned rows, no misalignment ===== */
@media (max-width: 768px) {
    body.woocommerce-cart table.cart .product-thumbnail,
    body.woocommerce-cart .cart-items .product-thumbnail {
        display: block !important;
    }
    body.woocommerce-cart table.cart.shop_table_responsive tbody tr {
        display: block !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
        padding: 16px 0 !important;
    }
    body.woocommerce-cart table.cart.shop_table_responsive tbody td {
        display: block !important;
        padding: 10px 0 !important;
        border: none !important;
        text-align: left !important;
    }
    body.woocommerce-cart table.cart.shop_table_responsive tbody td::before {
        content: attr(data-title) !important;
        font-weight: 600 !important;
        color: #aaa !important;
        display: inline-block !important;
        min-width: 80px !important;
        margin-right: 12px !important;
        vertical-align: middle !important;
    }
    body.woocommerce-cart table.cart.shop_table_responsive tbody td.product-remove::before,
    body.woocommerce-cart table.cart.shop_table_responsive tbody td.actions::before {
        display: none !important;
    }
    body.woocommerce-cart table.cart tbody td.product-info {
        padding-bottom: 12px !important;
    }
    body.woocommerce-cart table.cart tbody td.product-info::before {
        display: none !important;
    }
    body.woocommerce-cart table.cart tbody td.product-info > div {
        display: flex !important;
        align-items: center !important;
        gap: 16px !important;
    }
    body.woocommerce-cart table.cart tbody td.product-tickets {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }
    body.woocommerce-cart table.cart tbody td.product-quantity {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }
    body.woocommerce-cart table.cart tbody td.product-subtotal {
        font-weight: 600 !important;
        color: var(--neon-amber) !important;
    }
    body.woocommerce-cart table.cart tbody td.product-remove {
        display: flex !important;
        align-items: center !important;
        padding-top: 12px !important;
        border-top: 1px solid rgba(255,255,255,0.05) !important;
    }
    body.woocommerce-cart table.cart tbody td.product-remove .cart-remove-link {
        margin-left: 0 !important;
    }
    body.woocommerce-cart table.cart td.actions .coupon {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    body.woocommerce-cart table.cart td.actions .coupon input#coupon_code {
        min-width: 100% !important;
    }
    body.woocommerce-cart .page-title,
    body.woocommerce-cart .entry-title {
        font-size: 24px !important;
    }
    body.woocommerce-cart .page-header,
    body.woocommerce-cart .entry-header {
        padding: 36px 0 16px !important;
    }
}
