/*
 * g86 — cart, side cart, checkout (client deck 07-10-2026, slides 4, 5, 6, 7, 10).
 * "Extend, do not redesign": only the elements the deck names are restyled. Loaded on every page
 * by layouts/cart_modal_scripts.blade.php (the side cart lives in the header).
 */

/* ── shared: stock note + save state (slide 4 / 5) ─────────────────────────── */
.g86-stock { display: block; margin: 6px 0 0; font-size: 12px; line-height: 1.35; color: #4b5563; text-align: left; }
.g86-stock[hidden] { display: none !important; }
.g86-stock::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin: 0 6px 1px 0; background: var(--ob-success, #1f8b3a); vertical-align: middle; }
.g86-stock--low { color: #9a4a00; }
.g86-stock--low::before { background: #e8770c; }
.g86-stock--max { color: #9a4a00; background: var(--ob-primary-soft, #fff6e8); border: 1px solid #f6c77a; border-radius: 6px; padding: 5px 8px; }
.g86-stock--max::before { display: none; }
.g86-stock--none { color: var(--ob-danger, #b71c1c); }
.g86-stock--none::before { background: #c62828; }
.g86-save-state { min-height: 0; font-size: 12px; line-height: 1.3; color: #6b7280; margin-top: 4px; text-align: left; }
.g86-save-state.is-saved { color: var(--ob-success, #1f8b3a); }
.g86-busy { opacity: .55; transition: opacity .15s; }
.g86-off, button.g86-off, .quantity-plus:disabled, .quantity-minus:disabled { opacity: .35; cursor: not-allowed; }

/* ── cart page (slide 5): no "Update" button once the page saves by itself ─── */
#cart-items-table.g86-live .update-btn { display: none !important; }
#cart-items-table .update-wrapper { display: flex; flex-direction: column; align-items: flex-start; }
#cart-items-table .g86-stock { max-width: 220px; }
#cart-items-table .g86-stock--ok, #cart-items-table .g86-stock--low { white-space: nowrap; max-width: none; }
#cart-items-table .product-subtotal .amount,
#cart-items-table .product-price .amount { white-space: nowrap; }

/* slide 10 #2 — "Select at least one product" only when NOTHING is ticked: the element carries
   both .d-block and .d-none and the theme's .d-block won, so it showed with all lines ticked. */
#cart-nothing-selected.d-none { display: none !important; }

/* slide 10 #3 — amounts and their currency never split over two lines. */
#cart-subtotal, #cart-total, #cart-shipping-amount, #g86-cart-discount span,
#checkout-grand-total, #checkout-shipping-cost, .order-table .product-total,
.order-table tr.cart-subtotal td b, #g40-us-amount, #g40-local-amount,
.modal-cart-subtotal, .modal-cart-total, .modal-shipping-amount, .modal-cart-item .product-item-subtotal { white-space: nowrap; }
.cart-summary .order-total, .cart-summary .cart-subtotal { gap: 12px; }
.order-table tfoot .order-total th, .order-table tfoot .order-total td { vertical-align: middle; }

/* ── delivery radios (slide 10 #1): radio left, name + price on one line, details below ── */
.shipping-methods .custom-radio, #shipping-method .custom-radio, .usw-block .custom-radio { position: relative; }
.shipping-methods .custom-radio .odb-ship-radio ~ .custom-control-label,
#shipping-method .custom-radio .odb-ship-radio ~ .custom-control-label,
.usw-block .custom-radio .odb-ship-radio ~ .custom-control-label { display: block; padding-left: 28px; line-height: 20px; text-align: left; }
.shipping-methods .custom-radio .odb-ship-radio ~ .custom-control-label::after,
#shipping-method .custom-radio .odb-ship-radio ~ .custom-control-label::after,
.usw-block .custom-radio .odb-ship-radio ~ .custom-control-label::after { top: 1px !important; transform: none !important; }
.g86-ship-main { display: block; }
.g86-ship-price, .odb-ship-price { white-space: nowrap; font-weight: 600; }
.g86-ship-sub { display: block; font-size: 1.2rem; color: #6b7280; margin-top: 2px; line-height: 1.35; }

/* ── side cart (slide 6) ─────────────────────────────────────────────────── */
.cart-dropdown.cart-offcanvas .dropdown-box { max-width: min(40rem, 92vw); right: -42rem; }
.cart-dropdown.cart-offcanvas.opened .dropdown-box { right: 0; }
.dropdown.cart-dropdown.cart-offcanvas.opened .dropdown-box { overflow: hidden !important; padding-bottom: 0; }
.dropdown.cart-dropdown.cart-offcanvas.opened .products,
.cart-dropdown.cart-offcanvas .products { flex: 1 1 auto; min-height: 0 !important; overflow-y: auto; overscroll-behavior: contain; margin-right: -8px; padding-right: 8px !important; }
.dropdown.cart-dropdown.cart-offcanvas.opened .bottom-cart- { position: static !important; flex: 0 0 auto; margin-top: 0; box-shadow: 0 -6px 12px -10px rgba(0,0,0,.25); }
.cart-dropdown.cart-offcanvas .cart-modal-actions { padding: 10px 0; }
.cart-dropdown.cart-offcanvas .cart-modal-actions .btn { padding: 9px 10px; font-size: 11.5px; }
/* the compact footer: Subtotal · Shipping · Total + the two buttons */
.cart-dropdown.cart-offcanvas .modal-cart-summary { padding: 10px 0 14px; }
.cart-dropdown.cart-offcanvas .modal-cart-summary > .cart-title,
.cart-dropdown.cart-offcanvas .modal-cart-summary > .divider,
.cart-dropdown.cart-offcanvas .modal-cart-summary > .modal-us-weight-price,
.cart-dropdown.cart-offcanvas .modal-cart-summary > .modal-shipping-methods { display: none !important; }
.cart-dropdown.cart-offcanvas .modal-cart-summary .cart-subtotal,
.cart-dropdown.cart-offcanvas .modal-cart-summary .order-total { margin: 0 0 4px !important; font-size: 13.5px; line-height: 1.45; }
.cart-dropdown.cart-offcanvas .modal-cart-summary .cart-subtotal label,
.cart-dropdown.cart-offcanvas .modal-cart-summary .order-total label { margin: 0; font-weight: 400; color: #374151; }
.cart-dropdown.cart-offcanvas .modal-cart-summary .order-total { font-size: 16px; font-weight: 700; padding-top: 4px; border-top: 1px solid #eee; margin-top: 4px !important; }
.cart-dropdown.cart-offcanvas .modal-cart-summary .order-total label { font-weight: 700; color: #111; }
.cart-dropdown.cart-offcanvas .modal-cart-total { font-weight: 700; }
.cart-dropdown.cart-offcanvas .g86-mc-hint { color: #6b7280; font-size: 12px; margin-left: 4px; }
.cart-dropdown.cart-offcanvas .cart-modal-footer-actions { margin-top: 10px; flex-direction: row !important; }
.cart-dropdown.cart-offcanvas .cart-modal-footer-actions .btn { width: auto !important; font-size: 12px; padding: 11px 8px; }
.cart-dropdown.cart-offcanvas .modal-btn-checkout:disabled { opacity: .6; cursor: progress; }
/* one row: [✓] [thumb] name / seller · origin / stepper ……… price */
.cart-dropdown.cart-offcanvas .product.product-cart.modal-cart-item { grid-template-columns: 16px 64px minmax(0, 1fr); gap: 10px; padding: 12px 26px 12px 0 !important; }
.modal-cart-item .product-media img { width: 64px; height: 64px; }
.modal-cart-item .product-name { font-size: 13px; -webkit-line-clamp: 2; display: -webkit-box !important; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 2px !important; }
.modal-cart-item .modal-cart-variant { margin-bottom: 2px; }
.modal-cart-item .modal-cart-vendor { margin: 0 0 4px !important; color: #6b7280; }
.modal-cart-item .product-detail { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 0; align-items: start; }
.modal-cart-item .product-detail > * { grid-column: 1 / -1; }
.modal-cart-item .product-detail > .modal-cart-qty { grid-column: 1; grid-row: 20; margin-top: 4px; }
.modal-cart-item .product-detail > .modal-cart-price-row { grid-column: 2; grid-row: 20; margin: 4px 0 0; height: 32px; align-items: center; justify-content: flex-end; }
.modal-cart-item .product-detail > .usw-item, .modal-cart-item .product-detail > [data-us-weight-item] { grid-row: 21; }
.modal-cart-item .modal-cart-price-row .product-price { display: none; }
.modal-cart-item .modal-cart-price-row .product-item-subtotal { font-weight: 700; font-size: 13px; white-space: nowrap; }
.modal-cart-item .modal-cart-qty .btn-update-qty { display: none !important; }
.modal-cart-item .modal-cart-qty .g86-stock { flex-basis: 100%; margin-top: 4px; font-size: 11.5px; white-space: nowrap; }
.modal-cart-item .modal-cart-qty .g86-stock--max { white-space: normal; }
/* seller (and origin, when printed as text) on one line: the row stays compact */
.modal-cart-item .modal-cart-vendor { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.modal-cart-item .modal-cart-vendor br { display: none; }
.modal-cart-item .modal-cart-vendor br + b { margin-left: 6px; }
.modal-cart-item .modal-qty-control { height: 32px; }
.modal-cart-item .modal-qty-btn { width: 30px; height: 32px; }
.modal-cart-item .modal-qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.modal-cart-item .modal-qty-control .quantity-input { height: 32px; width: 38px; }
@media (max-width: 480px) {
    .cart-dropdown.cart-offcanvas .dropdown-box { padding-left: 16px !important; padding-right: 16px !important; }
    .dropdown.cart-dropdown.cart-offcanvas.opened .bottom-cart- { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
    .cart-dropdown.cart-offcanvas .cart-modal-actions { flex-direction: row !important; }
    .cart-dropdown.cart-offcanvas .cart-modal-actions .btn { width: auto !important; }
    .modal-cart-item .modal-qty-btn { width: 36px; height: 40px; }
    .modal-cart-item .modal-qty-control, .modal-cart-item .modal-qty-control .quantity-input { height: 40px; }
    .modal-cart-item .product-detail > .modal-cart-price-row { height: 40px; }
}

/* ── checkout addresses (slide 7) ────────────────────────────────────────── */
.g86-addr { margin: 0 0 8px; }
.g86-addr-hint { color: var(--ob-muted, #6b7280); font-size: 13px; margin: -4px 0 12px; }
.g86-addr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.g86-addr-card { position: relative; display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 14px 16px 12px; border: 1px solid var(--ob-border, #d9dde3); border-radius: var(--ob-radius, 10px); background: var(--ob-card, #fff); cursor: pointer; font-size: 13.5px; line-height: 1.45; color: var(--ob-ink, #1f2937); font-style: normal; transition: border-color .15s, background-color .15s; }
.g86-addr-card:hover { border-color: #b8bec8; }
.g86-addr-card.is-selected { border: 2px solid var(--ob-primary, #F99E1C); background: var(--ob-primary-soft, #fff8ee); padding: 13px 15px 11px; }
.g86-addr-card:focus-within { outline: 2px solid var(--ob-primary, #F99E1C); outline-offset: 2px; }
.g86-addr-top { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.g86-addr-top input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--ob-primary, #F99E1C); flex: none; }
.g86-addr-name { font-weight: 700; font-size: 14.5px; min-width: 0; overflow-wrap: anywhere; }
.g86-addr-tag { margin-left: auto; flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; background: #eef0f3; color: #4b5563; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g86-addr-tag--default { background: var(--ob-black, #1f2937); color: #fff; }
.g86-addr-line { display: block; padding-left: 26px; overflow-wrap: anywhere; }
.g86-addr-muted { color: var(--ob-muted, #6b7280); font-size: 12.5px; }
.g86-cap { text-transform: capitalize; }
.g86-addr-actions { display: block; padding-left: 26px; margin-top: 6px; font-size: 12.5px; color: #9ca3af; }
.g86-addr-actions a { color: #2563eb; text-decoration: none; display: inline-block; padding: 2px 0; }
.g86-addr-actions a.g86-addr-remove { color: #6b7280; }
.g86-addr-actions a:hover { text-decoration: underline; }
.g86-addr-new { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: center; min-height: 52px; border: 2px dashed #cfd4db; color: #374151; font-weight: 600; background: #fff; }
.g86-addr-new input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.g86-addr-new.is-selected { border-style: solid; }
.g86-addr-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 18px; padding: 10px 14px; border-radius: var(--ob-radius-sm, 8px); background: var(--ob-bg, #f3f4f6); font-size: 13px; }
.g86-addr-summary a { color: #2563eb; white-space: nowrap; }
@media (max-width: 575px) {
    .g86-addr-grid { grid-template-columns: 1fr; }
    .g86-addr-actions a { padding: 8px 0; }
}

/* ── product page (slide 4) ─────────────────────────────────────────────── */
.g86-pd-stock { margin: 8px 0 4px; font-size: 13px; }

/* ── S1 (deck 08-10-2026): ticked lines only ─────────────────────────────── */
#cart-items-table tr.g86-unticked td:not(:first-child) { opacity: .5; transition: opacity .15s; }
.g86-sel-count { margin: 8px 0 0; font-size: 13px; color: var(--ob-muted, #6b7280); }
.g86-ship-state { margin: 6px 0 0; font-size: 12.5px; color: var(--ob-success, #1f8b3a); }
.g86-ship-state::before { content: "⟳ "; }
.g86-ship-state[hidden] { display: none !important; }
