/* ============================================================
   Bright Idea Hub — WooCommerce layer
   Waterfall (masonry) catalogue, Pinterest-style pins, PDP, cart
   ============================================================ */

/* ------------------------------------------------------------
   1. Waterfall container
   ------------------------------------------------------------ */
.bih-masonry {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

/* Progressive enhancement: without JS the grid is still tidy. */
.bih-masonry:not(.is-masonry) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}
.bih-masonry:not(.is-masonry) > .bih-pin {
    position: static;
}

.bih-masonry.is-masonry > .bih-pin {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
}

/* .bih-pin sets display:flex, which would beat the UA [hidden] rule —
   the saved-items page relies on hiding pins. */
.bih-masonry > .bih-pin[hidden],
.bih-pin[hidden] { display: none; }

.bih-section__more { text-align: center; margin-top: 44px; }
.bih-empty {
    text-align: center;
    color: var(--muted);
    padding: 60px 0;
    font-size: 1rem;
}

/* ------------------------------------------------------------
   2. The pin (product card)
   ------------------------------------------------------------ */
.bih-pin {
    background: var(--surface);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-1);
    display: flex;
    flex-direction: column;
    transition: transform .32s var(--ease), box-shadow .32s var(--ease);
}
.bih-pin:hover { transform: translateY(-6px); box-shadow: var(--sh-3); }

.bih-pin__media {
    position: relative;
    aspect-ratio: var(--pin-ratio, 4 / 5);
    overflow: hidden;
    background: var(--sand);
}
.bih-pin__imglink { display: block; width: 100%; height: 100%; }
.bih-pin__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .8s var(--ease);
    display: block;
}
.bih-pin:hover .bih-pin__media img { transform: scale(1.05); }

/* badges */
.bih-pin__badges {
    position: absolute;
    top: 12px; left: 12px;
    display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
    z-index: 3;
}
.bih-badge {
    display: inline-block;
    padding: 5px 11px;
    border-radius: var(--r-pill);
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    line-height: 1.5;
}
.bih-badge--sale { background: var(--red); color: #fff; }
.bih-badge--new { background: var(--ink); color: #fff; }
.bih-badge--out { background: rgba(255, 255, 255, .95); color: var(--ink); }

/* save (Pinterest-style) */
.bih-pin__save {
    position: absolute;
    top: 10px; right: 10px;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border: 0; border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .95);
    color: var(--ink);
    cursor: pointer;
    z-index: 3;
    box-shadow: var(--sh-1);
    opacity: 0;
    transform: scale(.86);
    transition: opacity .25s var(--ease), transform .25s var(--ease),
                background .25s var(--ease), color .25s var(--ease);
}
.bih-pin:hover .bih-pin__save,
.bih-pin__save.is-saved { opacity: 1; transform: scale(1); }
.bih-pin__save:hover { background: var(--red); color: #fff; }
.bih-pin__save.is-saved { background: var(--red); color: #fff; }
.bih-pin__save-ico { display: grid; place-items: center; }
.bih-pin__save-ico--on { display: none; }
.bih-pin__save.is-saved .bih-pin__save-ico--out { display: none; }
.bih-pin__save.is-saved .bih-pin__save-ico--on { display: grid; }

/* quick add */
.bih-pin__hover {
    position: absolute;
    left: 10px; right: 10px; bottom: 10px;
    z-index: 3;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.bih-pin:hover .bih-pin__hover { opacity: 1; transform: translateY(0); }

.bih-pin__add {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--r-pill);
    background: rgba(17, 17, 17, .93);
    color: #fff;
    font-size: .81rem;
    font-weight: 600;
    line-height: 1.2;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background .22s var(--ease), color .22s var(--ease);
}
.bih-pin__add:hover { background: var(--red); color: #fff; }
.bih-pin__add.loading { opacity: .7; pointer-events: none; }
.bih-pin__add.added::after { content: " ✓"; }

/* body */
.bih-pin__body {
    padding: 15px 17px 19px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.bih-pin__cat {
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--muted-2);
}
.bih-pin__title {
    font-family: var(--f-body);
    font-size: .96rem;
    font-weight: 600;
    line-height: 1.38;
    margin: 0;
    letter-spacing: 0;
}
.bih-pin__title a { color: var(--ink); }
.bih-pin__title a:hover { color: var(--red); }

.bih-pin__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
}
.bih-pin__price { font-size: .98rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.bih-pin__price del { color: var(--muted-2); font-weight: 500; font-size: .84em; margin-right: 5px; }
.bih-pin__price ins { text-decoration: none; color: var(--red); }
.bih-pin__rate {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .77rem; color: var(--muted); white-space: nowrap;
}
.bih-pin__rate svg { color: #f2a33c; }

/* touch devices: controls always visible */
@media (hover: none) {
    .bih-pin__save { opacity: 1; transform: none; }
    .bih-pin__hover { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   3. Shop header, chips, toolbar
   ------------------------------------------------------------ */
.bih-shop-wrap { padding-bottom: clamp(50px, 6vw, 90px); }

.bih-shop-head {
    text-align: center;
    padding: clamp(30px, 4vw, 56px) 0 clamp(16px, 2vw, 26px);
}
.bih-shop-title { margin: .18em 0 .12em; }
.bih-shop-count { color: var(--muted-2); font-size: .85rem; margin: 0; }

.bih-crumbs {
    font-size: .8rem;
    color: var(--muted-2);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.bih-crumbs a { color: var(--muted); }
.bih-crumbs a:hover { color: var(--red); }
.bih-crumbs__sep { opacity: .5; }
.bih-crumbs--product { justify-content: flex-start; padding: 22px 0 4px; }

.bih-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: center;
    margin: 4px 0 6px;
}
.bih-chip {
    display: inline-block;
    padding: 9px 21px;
    border-radius: var(--r-pill);
    border: 1.5px solid var(--line-2);
    background: #fff;
    font-size: .85rem;
    font-weight: 500;
    color: var(--ink);
    transition: all .22s var(--ease);
}
.bih-chip:hover { border-color: var(--ink); color: var(--ink); }
.bih-chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.bih-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding: 16px 2px 24px;
    border-top: 1px solid var(--line);
}
.bih-result-count { margin: 0; font-size: .85rem; color: var(--muted); }
.woocommerce-ordering { margin: 0; }
.woocommerce-ordering select {
    width: auto;
    min-width: 210px;
    padding: 11px 44px 11px 20px;
    font-size: .85rem;
    border-radius: var(--r-pill);
    background-color: #fff;
}

/* hide WooCommerce's own duplicated title block */
.woocommerce-products-header .page-title { display: none; }
.woocommerce-products-header { margin: 0; }
.woocommerce-products-header .term-description {
    max-width: 70ch;
    margin: 0 auto 12px;
    text-align: center;
    color: var(--muted);
    font-size: .94rem;
}
.woocommerce-products-header .term-description p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------
   4. Pagination
   ------------------------------------------------------------ */
.woocommerce-pagination { margin: 52px 0 0; text-align: center; }
.woocommerce-pagination ul.page-numbers {
    list-style: none; margin: 0; padding: 0;
    display: flex; justify-content: center; gap: 5px; flex-wrap: wrap;
}
.woocommerce-pagination ul.page-numbers li { border: 0; margin: 0; }
.woocommerce-pagination .page-numbers {
    display: inline-grid; place-items: center;
    min-width: 44px; height: 44px; padding: 0 14px;
    border-radius: var(--r-pill);
    background: var(--sand);
    color: var(--ink);
    font-weight: 600; font-size: .88rem;
    transition: all .22s var(--ease);
}
.woocommerce-pagination .page-numbers:hover,
.woocommerce-pagination .page-numbers.current { background: var(--red); color: #fff; }

/* ------------------------------------------------------------
   5. Single product
   ------------------------------------------------------------ */
.single-product .bih-shop-wrap { padding-bottom: clamp(40px, 5vw, 80px); }

/* The gallery and the summary live inside .bih-pdp-top — see the theme's
   woocommerce/content-single-product.php. Keeping them in their own container
   is what bounds the sticky summary: a sticky grid item is limited by the
   grid *container*, so leaving them as direct children of div.product let the
   summary slide all the way down and print over the tabs and related items. */
.single-product div.product { margin-top: 18px; }

.bih-pdp-top {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: start;
}
.single-product .bih-pdp-top .woocommerce-product-gallery {
    grid-column: 1;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}
.single-product .bih-pdp-top .summary {
    grid-column: 2;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    position: sticky;
    top: calc(var(--header-h) + 22px);
    align-self: start;
}

.single-product .woocommerce-product-gallery__wrapper { border-radius: var(--r-lg); overflow: hidden; }
.single-product .woocommerce-product-gallery img { border-radius: var(--r-lg); }
.single-product .flex-control-thumbs { margin-top: 12px !important; display: flex; gap: 10px; }
.single-product .flex-control-thumbs li { width: 84px !important; margin: 0 !important; float: none !important; }
.single-product .flex-control-thumbs img { border-radius: var(--r-sm); opacity: .62; transition: opacity .2s var(--ease); }
.single-product .flex-control-thumbs img.flex-active,
.single-product .flex-control-thumbs img:hover { opacity: 1; }

.summary .product_title {
    font-size: clamp(1.7rem, 3.2vw, 2.4rem);
    margin-bottom: .35em;
    line-height: 1.18;
}
.summary .woocommerce-product-rating {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px !important;
    font-size: .86rem;
}
.summary .woocommerce-product-rating .star-rating { color: #f2a33c; float: none !important; }
.summary .woocommerce-review-link { color: var(--muted); font-size: .83rem; }

.summary .price {
    font-size: clamp(1.4rem, 2.4vw, 1.85rem) !important;
    font-weight: 700;
    color: var(--ink) !important;
    margin: 6px 0 18px !important;
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.summary .price del { color: var(--muted-2) !important; font-weight: 500; font-size: .72em; opacity: 1 !important; }
.summary .price ins { color: var(--red) !important; text-decoration: none !important; font-weight: 700; }

.summary .woocommerce-product-details__short-description {
    color: var(--muted);
    font-size: .96rem;
    border-top: 1px solid var(--line);
    padding-top: 18px;
    margin-top: 4px;
}

.bih-highlights { list-style: none; padding: 0; margin: 18px 0 0; }
.bih-highlights li {
    display: flex; align-items: flex-start; gap: 9px;
    font-size: .89rem; color: var(--ink-2); padding: 5px 0;
}
.bih-highlights svg { color: var(--red); flex: 0 0 16px; margin-top: 4px; }

/* quantity + add to cart */
.summary form.cart {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 24px 0 6px !important;
    padding: 0 !important;
    border: 0 !important;
}
.summary .quantity {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--line-2);
    border-radius: var(--r-pill);
    overflow: hidden;
    background: #fff;
    margin: 0 !important;
    height: 52px;
}
.single-product .bih-pdp-top .summary .quantity input.qty {
    width: 58px;
    height: 100%;
    border: 0;
    background: transparent;
    text-align: center;
    font-weight: 600;
    font-size: .95rem;
    padding: 0;
    border-radius: 0;
    -moz-appearance: textfield;
}
.summary .quantity input.qty::-webkit-outer-spin-button,
.summary .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* The theme's generic WooCommerce button rules carry !important, so this one
   has to as well — otherwise `.woocommerce button.button.alt` repaints the
   primary call to action near-black instead of brand red. */
.single-product .bih-pdp-top .summary .single_add_to_cart_button,
.single-product .bih-pdp-top .summary button[type="submit"].single_add_to_cart_button {
    flex: 1 1 220px;
    height: 52px;
    border-radius: var(--r-pill);
    background: var(--red) !important;
    color: #fff !important;
    font-size: .95rem;
    font-weight: 600;
    border: 0;
    padding: 0 34px;
    cursor: pointer;
    transition: background .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
}
.single-product .bih-pdp-top .summary .single_add_to_cart_button:hover {
    background: var(--red-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(230, 0, 35, .26);
}
.single-product .bih-pdp-top .summary .single_add_to_cart_button.disabled,
.single-product .bih-pdp-top .summary .single_add_to_cart_button[disabled] { background: var(--line-2) !important; color: var(--muted) !important; box-shadow: none; transform: none; cursor: not-allowed; }

.summary .product_meta {
    border-top: 1px solid var(--line);
    margin-top: 22px;
    padding-top: 16px;
    font-size: .83rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.summary .product_meta a { color: var(--ink); }
.summary .product_meta a:hover { color: var(--red); }

/* trust row */
.bih-trust {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 22px;
    padding: 18px;
    background: var(--sand);
    border-radius: var(--r-md);
}
.bih-trust__item { display: flex; align-items: center; gap: 12px; }
.bih-trust__item svg { color: var(--red); flex: 0 0 20px; }
.bih-trust__item strong { display: block; font-size: .87rem; color: var(--ink); line-height: 1.3; }
.bih-trust__item span { font-size: .78rem; color: var(--muted); }

/* variations */
.summary table.variations { width: 100%; margin: 0 0 6px; border: 0; }
.summary table.variations th,
.summary table.variations td { border: 0; padding: 6px 0; background: none; }
.summary table.variations th.label { font-size: .84rem; font-weight: 600; color: var(--ink); text-align: left; }
.summary .woocommerce-variation-price { margin-bottom: 10px; }

/* tabs */
.woocommerce-tabs { margin-top: clamp(30px, 3.6vw, 54px); }
/* WooCommerce ships `.woocommerce div.product .woocommerce-tabs ul.tabs` and
   `.woocommerce div.product .woocommerce-tabs .panel` — four class selectors —
   so the theme has to carry the same weight to win the cascade. Without it the
   stock rules win and the panel never centres. */
.woocommerce div.product .woocommerce-tabs ul.tabs {
    list-style: none;
    display: flex;
    width: -moz-fit-content;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 26px;
    padding: 6px;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--sand);
    border-radius: var(--r-pill);
    border: 0;
}
.woocommerce-tabs ul.tabs::before { display: none; }
.woocommerce-tabs ul.tabs li {
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    border-radius: var(--r-pill);
}
.woocommerce-tabs ul.tabs li::before,
.woocommerce-tabs ul.tabs li::after { display: none !important; }
.woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 11px 26px !important;
    border-radius: var(--r-pill);
    font-size: .88rem;
    font-weight: 600;
    color: var(--muted);
    transition: all .22s var(--ease);
}
.woocommerce-tabs ul.tabs li.active a,
.woocommerce-tabs ul.tabs li a:hover { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.woocommerce div.product .woocommerce-tabs .panel {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    color: var(--muted);
    line-height: 1.75;
}
.woocommerce-tabs .panel h2 { display: none; }

/* related */
.related.products, .upsells.products { margin-top: clamp(52px, 6vw, 84px); }
.related.products > h2, .upsells.products > h2 {
    text-align: center;
    margin-bottom: .9em;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
}

/* ------------------------------------------------------------
   6. Notices
   ------------------------------------------------------------ */
.woocommerce-notices-wrapper { margin: 18px 0; }
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-noreviews,
p.no-comments {
    list-style: none;
    padding: 16px 22px !important;
    margin: 0 0 12px !important;
    border: 0 !important;
    border-radius: var(--r-md) !important;
    background: var(--sand) !important;
    color: var(--ink) !important;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.woocommerce-message { background: #edf7ee !important; }
.woocommerce-info { background: var(--rose) !important; }
.woocommerce-error { background: #fdecec !important; color: var(--red-dark) !important; }
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before { display: none !important; }
.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
    margin-left: auto;
    padding: 9px 22px;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: #fff !important;
    font-size: .82rem;
    font-weight: 600;
}
.woocommerce-message .button:hover,
.woocommerce-info .button:hover,
.woocommerce-error .button:hover { background: var(--red); }

/* ------------------------------------------------------------
   7. Cart / checkout / account
   ------------------------------------------------------------ */
.woocommerce-cart-form { margin-bottom: 40px; }
.woocommerce table.shop_table {
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--sh-1);
    margin-bottom: 26px;
}
.woocommerce table.shop_table th {
    background: var(--sand);
    color: var(--ink);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: 15px 18px;
    border: 0;
}
.woocommerce table.shop_table td {
    padding: 18px;
    border-top: 1px solid var(--line);
    vertical-align: middle;
    font-size: .92rem;
}
.woocommerce table.shop_table img { width: 74px; border-radius: var(--r-sm); }
.woocommerce table.cart .product-name a { font-weight: 600; color: var(--ink); }
.woocommerce a.remove {
    width: 30px !important; height: 30px !important;
    line-height: 28px !important;
    border-radius: var(--r-pill) !important;
    color: var(--muted) !important;
    background: var(--sand) !important;
    font-size: 1.05rem !important;
}
.woocommerce a.remove:hover { background: var(--red) !important; color: #fff !important; }

.woocommerce .quantity input.qty {
    border: 1.5px solid var(--line-2);
    border-radius: var(--r-pill);
    height: 42px;
    width: 74px;
    text-align: center;
    font-weight: 600;
}
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
    border-radius: var(--r-pill) !important;
    background: var(--red) !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: .88rem !important;
    padding: 14px 30px !important;
    border: 0 !important;
    line-height: 1.2 !important;
    transition: background .22s var(--ease), transform .22s var(--ease) !important;
}
.woocommerce button.button:hover,
.woocommerce a.button:hover,
.woocommerce input.button:hover { background: var(--red-dark) !important; transform: translateY(-2px); }
.woocommerce button.button.alt,
.woocommerce a.button.alt { background: var(--ink) !important; }
.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover { background: #000 !important; }
.woocommerce button.button:disabled,
.woocommerce button.button[disabled] { background: var(--line-2) !important; color: var(--muted) !important; transform: none !important; }

/* Coupon and cart totals sit side by side under the item table. WooCommerce
   prints the coupon inside a full-width row of that table, which leaves half
   the row sitting empty next to it — see the theme's woocommerce/cart/cart.php. */
.bih-cart-lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(22px, 3vw, 40px);
    align-items: start;
}
.bih-cart-actions {
    background: #fff;
    border-radius: var(--r-lg);
    box-shadow: var(--sh-1);
    padding: 24px 26px 26px;
}
.bih-cart-actions__title { font-size: 1.4rem; margin: 0 0 16px; }
.bih-cart-actions .coupon {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    float: none;
}
.bih-cart-actions .coupon .input-text {
    flex: 1 1 170px;
    min-width: 0;
    min-height: 46px;
    margin: 0;
}
/* Trimmed so the field and the button share one line at desktop widths. */
.bih-cart-actions .coupon .button { flex: 0 0 auto; padding: 14px 22px !important; }
/* "Update cart" saves the quantities in the table above it, so it belongs under
   that table rather than inside the coupon card. Secondary styling keeps
   Apply coupon as the primary action of the coupon panel. */
.woocommerce-cart-form table.cart.shop_table { margin-bottom: 12px; }
.bih-cart-update {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}
.bih-cart-update button[name="update_cart"] {
    background: #fff !important;
    color: var(--ink) !important;
    border: 1.5px solid var(--line-2) !important;
    padding: 13px 34px !important;
}
.bih-cart-update button[name="update_cart"]:hover {
    background: var(--ink) !important;
    color: #fff !important;
    border-color: var(--ink) !important;
}
.bih-cart-update button[name="update_cart"]:disabled {
    background: var(--sand) !important;
    color: var(--muted) !important;
    border-color: transparent !important;
    transform: none !important;
}

.cart-collaterals { display: block; }
.cart-collaterals .cart_totals { width: 100%; max-width: none; float: none; }
.cart-collaterals .cart_totals h2 { font-size: 1.4rem; }
.cart_totals table.shop_table td,
.cart_totals table.shop_table th { padding: 14px 18px; }
.cart_totals .order-total .amount { color: var(--red); font-size: 1.15rem; }

.woocommerce-checkout .col2-set { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 { width: 100%; float: none; }
.woocommerce-checkout h3 { font-size: 1.3rem; margin-bottom: .6em; }
#order_review_heading { margin-top: 40px; }
.woocommerce-checkout #payment {
    background: var(--sand);
    border-radius: var(--r-lg);
    padding: 8px 22px 22px;
}
.woocommerce-checkout #payment ul.payment_methods { border: 0; padding: 14px 0; }
.woocommerce-checkout #payment div.form-row { padding: 0; }

.woocommerce-account .woocommerce { display: grid; grid-template-columns: 250px 1fr; gap: 40px; align-items: start; }
.woocommerce-MyAccount-navigation { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 8px; }
.woocommerce-MyAccount-navigation li a {
    display: block;
    padding: 12px 18px;
    border-radius: var(--r-pill);
    font-size: .9rem;
    font-weight: 500;
    color: var(--ink);
}
.woocommerce-MyAccount-navigation li a:hover { background: var(--sand); color: var(--red); }
.woocommerce-MyAccount-navigation li.is-active a { background: var(--ink); color: #fff; }
.woocommerce-Addresses { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.woocommerce-Address { background: #fff; padding: 24px; border-radius: var(--r-lg); box-shadow: var(--sh-1); }

/* forms in checkout */
.woocommerce form .form-row { padding: 4px 0; margin-bottom: 14px; }
.woocommerce form .form-row label { font-size: .84rem; font-weight: 600; }
.woocommerce form .form-row .required { color: var(--red); text-decoration: none; }
.select2-container--default .select2-selection--single {
    border: 1.5px solid var(--line-2);
    border-radius: var(--r-pill);
    height: 48px;
    padding: 8px 14px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px; right: 10px; }

/* ------------------------------------------------------------
   8. Small screens
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
    /* Coupon and totals stack again, in the same order as before. */
    .bih-cart-lower { grid-template-columns: 1fr; }
    .bih-pdp-top { grid-template-columns: 1fr; }
    .single-product .bih-pdp-top .woocommerce-product-gallery,
    .single-product .bih-pdp-top .summary { grid-column: 1; }
    .single-product .bih-pdp-top .summary { position: static; }
    .woocommerce-account .woocommerce { grid-template-columns: 1fr; gap: 26px; }
    .woocommerce-checkout .col2-set { grid-template-columns: 1fr; gap: 0; }
    .woocommerce-Addresses { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .bih-toolbar { flex-direction: column; align-items: stretch; }
    .woocommerce-ordering select { width: 100%; }
    .bih-masonry:not(.is-masonry) { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
    .bih-pin__body { padding: 12px 13px 15px; gap: 4px; }
    .bih-pin__title { font-size: .87rem; }
    .bih-pin__price { font-size: .9rem; }
    .bih-pin__cat { font-size: .6rem; letter-spacing: .12em; }
    .bih-pin__rate { display: none; }
    .bih-badge { font-size: .6rem; padding: 4px 9px; }
    .bih-pin__save { width: 32px; height: 32px; top: 8px; right: 8px; }
    .bih-pin__hover { left: 8px; right: 8px; bottom: 8px; }
    .bih-pin__add { padding: 9px 10px; font-size: .74rem; }

    .woocommerce table.shop_table thead { display: none; }
    .woocommerce table.shop_table tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
    .woocommerce table.shop_table td { display: block; border: 0; padding: 7px 14px; text-align: right; }
    .woocommerce table.shop_table td::before {
        content: attr(data-title) ": ";
        float: left;
        font-weight: 600;
        color: var(--muted);
    }
    .cart-collaterals .cart_totals { max-width: none; }

    /* ---- Cart line items -------------------------------------------------
       Stacking every cell and repeating its column label works for a plain
       data table but not here: it pinned the product name into a ~100px
       right-aligned column, pushed the remove link onto its own line above
       the thumbnail, and printed the totals labels twice. Each line gets a
       card instead, laid out on a grid so the name reads first. */
    .woocommerce-cart-form table.cart.shop_table tbody tr.cart_item {
        position: relative;
        display: grid;
        grid-template-columns: 84px minmax(0, 1fr) auto;
        grid-template-areas:
            "thumb name   remove"
            "thumb price  price"
            "thumb qty    subtotal";
        column-gap: 14px;
        row-gap: 5px;
        align-items: center;
        padding: 18px 0;
        border-bottom: 1px solid var(--line);
    }
    .woocommerce-cart-form table.cart.shop_table tbody tr.cart_item:last-child {
        border-bottom: 0;
    }

    /* Undo the generic stacking inside the card. */
    .woocommerce-cart-form .cart_item td {
        display: block;
        padding: 0 !important;
        border: 0 !important;
        text-align: left !important;
    }
    .woocommerce-cart-form .cart_item td::before { display: none !important; }

    .woocommerce-cart-form .cart_item .product-thumbnail { grid-area: thumb; }
    .woocommerce-cart-form .cart_item .product-thumbnail a { display: block; line-height: 0; }
    .woocommerce-cart-form .cart_item .product-thumbnail img {
        width: 84px;
        height: 84px;
        object-fit: cover;
        border-radius: var(--r-md);
        display: block;
    }

    .woocommerce-cart-form .cart_item .product-name { grid-area: name; }
    .woocommerce-cart-form .cart_item .product-name a {
        font-family: var(--f-display);
        font-size: 1.05rem;
        line-height: 1.3;
        color: var(--ink);
    }

    .woocommerce-cart-form .cart_item .product-remove {
        grid-area: remove;
        justify-self: end;
        align-self: start;
        width: 34px;
        height: 34px;
        display: grid;
        place-items: center;
    }
    .woocommerce-cart-form .cart_item .product-remove a.remove {
        /* The base rule carries !important on every sizing property, so these
           need to match it to take effect. */
        width: 30px !important;
        height: 30px !important;
        line-height: 28px !important;
        position: relative;
        background: #fff !important;
        border: 1px solid var(--line-2);
        color: var(--ink) !important;
        font-size: 1.05rem !important;
        text-align: center;
    }
    /* Stretch the tap target to 44px without inflating the chip. The grid
       column gap is 14px, so the 7px overhang stays clear of the name link. */
    .woocommerce-cart-form .cart_item .product-remove a.remove::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 44px;
        height: 44px;
        transform: translate(-50%, -50%);
    }
    .woocommerce-cart-form .cart_item .product-remove a.remove:hover,
    .woocommerce-cart-form .cart_item .product-remove a.remove:focus {
        background: var(--red) !important;
        border-color: var(--red);
        color: #fff !important;
    }

    .woocommerce-cart-form .cart_item .product-price {
        grid-area: price;
        font-size: .82rem;
        color: var(--muted);
        white-space: nowrap;
    }
    .woocommerce-cart-form .cart_item .product-price .amount { color: var(--muted); }
    .woocommerce-cart-form .cart_item .product-price::after { content: " each"; }

    .woocommerce-cart-form .cart_item .product-quantity { grid-area: qty; }
    .woocommerce-cart-form .cart_item .product-quantity .quantity { display: inline-flex; }
    .woocommerce-cart-form .cart_item .product-quantity .qty { width: 62px; text-align: center; }

    .woocommerce-cart-form .cart_item .product-subtotal {
        grid-area: subtotal;
        justify-self: end;
        font-weight: 600;
        font-size: 1rem;
        white-space: nowrap;
    }

    /* ---- Cart totals -----------------------------------------------------
       Each row was printing its label twice: once as a full-width band and
       again inline. Put the label and the value on one line instead. */
    .cart_totals table.shop_table tr {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 16px;
        padding: 15px 18px;
        border-bottom: 0;
    }
    .cart_totals table.shop_table th,
    .cart_totals table.shop_table td {
        display: block;
        width: auto;
        padding: 0 !important;
        border: 0 !important;
        text-align: left !important;
    }
    .cart_totals table.shop_table td { text-align: right !important; }
    .cart_totals table.shop_table td::before { display: none !important; }
    /* The desktop header cells carry a tinted background; without this the
       label sits on a stray sand-coloured block. */
    .cart_totals table.shop_table th { background: none !important; }
    .cart_totals table.shop_table tr.order-total th,
    .cart_totals table.shop_table tr.order-total td { font-size: 1.06rem; }
    .summary form.cart { gap: 10px; }
    .summary .single_add_to_cart_button { flex: 1 1 100%; }
}

@media (max-width: 480px) {
    .bih-chips { gap: 7px; }
    .bih-chip { padding: 8px 16px; font-size: .8rem; }
}

/* WooCommerce ships an olive-green sale badge and stock line. Both clash with
   the palette and with the red badges the catalogue cards already use. */
.single-product .woocommerce-product-gallery .onsale,
.woocommerce span.onsale {
    background: var(--red);
    color: #fff;
    min-width: 0;
    min-height: 0;
    padding: 7px 15px;
    border-radius: var(--r-pill);
    font-family: var(--f-body);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    line-height: 1.4;
    text-transform: uppercase;
    box-shadow: var(--sh-2);
}

.summary .stock.in-stock {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .87rem;
    font-weight: 600;
}
/* `.woocommerce div.product .stock` scores (0,3,1) and paints this line olive. */
.single-product .bih-pdp-top .summary .stock.in-stock { color: var(--ink); }
.single-product .bih-pdp-top .summary .stock.in-stock::before {
    content: "";
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #17915a;
}
.single-product .bih-pdp-top .summary .stock.out-of-stock { color: var(--red); font-weight: 600; }

/* Quantity stepper — the native spinner is hidden, so these buttons are the
   only visible way to change the number. */
.bih-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .18s var(--ease), color .18s var(--ease);
}
.bih-qty-btn--minus { border-right: 1px solid var(--line); }
.bih-qty-btn--plus { border-left: 1px solid var(--line); }
.bih-qty-btn:hover { background: var(--sand); color: var(--red); }
.bih-qty-btn:disabled { color: var(--line-2); background: transparent; cursor: not-allowed; }

/* Save button on the product page */
.bih-pdp-save {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 52px;
    padding: 0 22px;
    border: 1.5px solid var(--line-2);
    border-radius: var(--r-pill);
    background: #fff;
    color: var(--ink);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.bih-pdp-save:hover { border-color: var(--ink); }
.bih-pdp-save.is-saved { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.bih-pdp-save__ico { display: inline-flex; }
.bih-pdp-save__ico--on,
.bih-pdp-save__txt--on { display: none; }
.bih-pdp-save.is-saved .bih-pdp-save__ico--out,
.bih-pdp-save.is-saved .bih-pdp-save__txt--out { display: none; }
.bih-pdp-save.is-saved .bih-pdp-save__ico--on { display: inline-flex; }
.bih-pdp-save.is-saved .bih-pdp-save__txt--on { display: inline; }
/* ============================================================
   9. Checkout — two columns, sticky summary, trust signals
   ------------------------------------------------------------
   Layout follows the shape Shopify's checkout settled on: details
   and payment on the left, an order summary that stays in view on
   the right, and on phones a summary bar the shopper can open when
   they want to check something.
   ============================================================ */
.bih-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 56px;
    align-items: start;
}
.bih-checkout__main { grid-column: 1; grid-row: 1; min-width: 0; }
.bih-summary {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-1);
    padding: 22px 22px 20px;
}

/* --- Form column -------------------------------------------------------- */
.bih-checkout .col2-set { display: block; }
.bih-checkout .col2-set .col-1,
.bih-checkout .col2-set .col-2 { width: 100%; float: none; }
.bih-checkout h3 {
    font-family: var(--f-display);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -.01em;
    margin: 0 0 14px;
}
.bih-checkout .col-2 h3 { font-size: 1.05rem; color: var(--muted); }
.bih-checkout__payment { margin-top: 38px; }
.bih-checkout__step {
    font-family: var(--f-display);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -.01em;
    margin: 0 0 18px;
}

/* Two fields per row; wide fields span the pair. */
.bih-checkout .woocommerce-billing-fields__field-wrapper,
.bih-checkout .woocommerce-shipping-fields__field-wrapper,
.bih-checkout .woocommerce-additional-fields__field-wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
}
.bih-checkout .form-row { grid-column: span 1; min-width: 0; }
.bih-checkout .form-row-wide { grid-column: 1 / -1; }
.bih-checkout .woocommerce-additional-fields__field-wrapper { margin-top: 22px; }
.bih-checkout .form-row input.input-text,
.bih-checkout .form-row select,
.bih-checkout .form-row textarea {
    background: #fff;
    border: 1.5px solid var(--line-2);
    border-radius: var(--r-sm);
}
.bih-checkout .form-row input.input-text:focus,
.bih-checkout .form-row select:focus,
.bih-checkout .form-row textarea:focus {
    border-color: var(--ink);
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, .06);
}

/* --- Order summary ------------------------------------------------------ */
.bih-summary__heading {
    font-family: var(--f-display);
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 14px;
}
.bih-summary__toggle { display: none; }
.bih-summary__body { display: block; }

/* Line items */
.bih-checkout .woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: none;
    border: 0;
}
.bih-checkout .woocommerce-checkout-review-order-table thead { display: none; }
.bih-checkout .woocommerce-checkout-review-order-table tr.cart_item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.bih-checkout .woocommerce-checkout-review-order-table tr.cart_item > td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
}
.bih-checkout .woocommerce-checkout-review-order-table tr.cart_item > td::before { display: none; }
.bih-checkout .woocommerce-checkout-review-order-table td.product-name {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}
.bih-line__thumb img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--r-sm);
    display: block;
    background: var(--sand);
}
.bih-line__text { display: grid; gap: 3px; min-width: 0; }
.bih-line__name {
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ink);
}
.bih-line__qty { font-size: .78rem; color: var(--muted); }
.bih-checkout .woocommerce-checkout-review-order-table td.product-total {
    font-size: .92rem;
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

/* Totals */
.bih-checkout .woocommerce-checkout-review-order-table tfoot tr {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border: 0;
}
.bih-checkout .woocommerce-checkout-review-order-table tfoot th {
    font-weight: 400;
    font-size: .88rem;
    color: var(--muted);
    padding: 0;
    border: 0;
    text-align: left;
    /* The cart table paints every <th> sand; the summary reads as a list, not
       a table, so the label column must stay plain. */
    background: none;
}
.bih-checkout .woocommerce-checkout-review-order-table tfoot td {
    padding: 0;
    border: 0;
    text-align: right;
    font-size: .92rem;
    font-weight: 500;
    white-space: nowrap;
    background: none;
}
.bih-checkout .woocommerce-checkout-review-order-table tfoot tr.order-total {
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.bih-checkout .woocommerce-checkout-review-order-table tfoot tr.order-total th {
    font-family: var(--f-display);
    font-size: 1.15rem;
    color: var(--ink);
}
.bih-checkout .woocommerce-checkout-review-order-table tfoot tr.order-total .amount {
    color: var(--red);
    font-size: 1.28rem;
    font-weight: 600;
}
.bih-checkout .woocommerce-checkout-review-order-table .cart-discount th,
.bih-checkout .woocommerce-checkout-review-order-table .cart-discount td { color: #1a7f47; }
.bih-checkout .woocommerce-checkout-review-order-table .woocommerce-remove-coupon {
    color: var(--muted);
    font-size: .74rem;
    text-decoration: underline;
}

/* Shipping method picker stays inside the summary table on purpose: it is
   replaced wholesale by WooCommerce's AJAX refresh, and moving it out means
   it can vanish mid-update. Instead the bar below opens automatically on
   phones when there is a choice to make. */
.bih-checkout .woocommerce-shipping-totals td ul#shipping_method {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: grid;
    gap: 7px;
}
.bih-checkout .woocommerce-shipping-totals td li { font-size: .86rem; }
.bih-checkout .woocommerce-shipping-totals td label { display: inline; }

/* --- Discount code ------------------------------------------------------ */
.bih-discount {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.bih-discount__toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .86rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line-2);
    padding-bottom: 2px;
}
.bih-discount__toggle:hover { color: var(--red); border-color: var(--red); }
.bih-discount__toggle svg { color: var(--muted); }
.bih-discount__panel { display: flex; gap: 8px; margin-top: 14px; }
.bih-discount__panel[hidden] { display: none; }
.bih-discount__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    border: 1.5px solid var(--line-2);
    border-radius: var(--r-sm);
    background: #fff;
    padding: 0 13px;
    font-size: .88rem;
}
.bih-discount__input:focus {
    border-color: var(--ink);
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, .06);
}
.bih-discount__apply {
    flex: 0 0 auto;
    height: 46px;
    padding: 0 20px;
    border-radius: var(--r-sm);
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}
.bih-discount__apply[disabled] { opacity: .6; cursor: progress; }
.bih-discount__note { margin: 10px 0 0; font-size: .78rem; line-height: 1.45; }
.bih-discount__note:empty { display: none; }
.bih-discount__note.is-ok { color: #1a7f47; }
.bih-discount__note.is-error { color: var(--red); }

/* --- Payment ------------------------------------------------------------ */
.bih-checkout #payment.woocommerce-checkout-payment {
    background: none !important;
    border-radius: 0;
    padding: 0 !important;
}
.bih-checkout #payment ul.wc_payment_methods {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    border: 1.5px solid var(--line-2) !important;
    border-radius: var(--r-md);
    overflow: hidden;
    background: #fff;
}
.bih-checkout #payment ul.wc_payment_methods li.wc_payment_method {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    padding: 16px 18px !important;
    border-bottom: 1px solid var(--line);
    list-style: none;
    transition: box-shadow .2s var(--ease), background .2s var(--ease);
}
.bih-checkout #payment ul.wc_payment_methods li.wc_payment_method:last-child { border-bottom: 0; }
.bih-checkout #payment ul.wc_payment_methods li.wc_payment_method:has(input:checked) {
    background: var(--sand);
    box-shadow: inset 3px 0 0 var(--red);
}
.bih-checkout #payment ul.wc_payment_methods li.wc_payment_method > input.input-radio {
    grid-column: 1;
    grid-row: 1;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--red);
}
.bih-checkout #payment ul.wc_payment_methods li.wc_payment_method > label {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: .95rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}
.bih-checkout #payment ul.wc_payment_methods li.wc_payment_method > label img { max-height: 26px; width: auto; }
.bih-checkout #payment ul.wc_payment_methods li.wc_payment_method > div.payment_box {
    grid-column: 1 / -1;
    grid-row: 2;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 8px 0 0 !important;
    font-size: .84rem;
    line-height: 1.55;
    color: var(--muted);
}
.bih-checkout #payment ul.wc_payment_methods li.wc_payment_method > div.payment_box::before {
    content: none !important;
    display: none !important;
    border: 0 !important;
}
.bih-checkout #payment div.form-row.place-order { padding: 0 !important; margin: 0; }

.bih-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0 0 12px;
    font-size: .8rem;
    color: var(--muted);
}
.bih-secure-note svg { color: #1a7f47; flex: 0 0 auto; }
.bih-checkout #payment #place_order {
    width: 100%;
    padding: 18px 24px;
    font-size: 1rem;
    letter-spacing: .01em;
    border-radius: var(--r-pill);
}
.bih-checkout .woocommerce-privacy-policy-text {
    margin: 0 0 14px;
    font-size: .78rem;
    line-height: 1.55;
    color: var(--muted);
}
.bih-checkout .woocommerce-privacy-policy-text a { color: var(--ink); text-decoration: underline; }
.bih-paylogos {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
}
.bih-paylogos li {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 5px 9px;
    background: #fff;
}
.bih-checkout-guarantee {
    margin: 12px 0 0;
    font-size: .78rem;
    line-height: 1.55;
    color: var(--muted);
    text-align: center;
}

/* --- Trust list in the summary ------------------------------------------ */
.bih-checkout-trust {
    list-style: none;
    margin: 20px 0 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 13px;
}
.bih-checkout-trust li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
}
.bih-checkout-trust__ico {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sand);
    display: grid;
    place-items: center;
    color: var(--ink);
}
.bih-checkout-trust__txt { display: grid; gap: 1px; }
.bih-checkout-trust__txt strong { font-size: .84rem; font-weight: 600; color: var(--ink); }
.bih-checkout-trust__txt span { font-size: .78rem; line-height: 1.45; color: var(--muted); }
.bih-checkout-help {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: .78rem;
    color: var(--muted);
}
.bih-checkout-help svg { color: var(--muted); flex: 0 0 auto; }
.bih-checkout-help a { color: var(--ink); text-decoration: underline; }

/* --- Small screens ------------------------------------------------------ */
@media (max-width: 1024px) {
    .bih-checkout { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .bih-checkout__main { grid-column: 1; grid-row: 2; }
    .bih-summary {
        grid-column: 1;
        grid-row: 1;
        position: static;
        margin-bottom: 26px;
        padding: 0;
        overflow: hidden;
    }
    .bih-summary__heading { display: none; }
    .bih-summary__toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 17px 18px;
        background: none;
        border: 0;
        font: inherit;
        color: inherit;
        cursor: pointer;
        text-align: left;
    }
    .bih-summary__toggle-text {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: .88rem;
        font-weight: 600;
        color: var(--ink);
    }
    .bih-summary__chev {
        width: 7px;
        height: 7px;
        border-right: 1.6px solid var(--muted);
        border-bottom: 1.6px solid var(--muted);
        transform: rotate(45deg) translate(-1px, -1px);
        transition: transform .25s var(--ease);
    }
    .bih-summary.is-open .bih-summary__chev { transform: rotate(-135deg) translate(-1px, -1px); }
    .bih-summary__toggle-total { font-size: 1.02rem; font-weight: 600; color: var(--ink); }
    .bih-summary__body {
        display: none;
        padding: 4px 18px 20px;
        border-top: 1px solid var(--line);
    }
    .bih-summary.is-open .bih-summary__body { display: block; }
    .bih-checkout-trust { margin-top: 18px; }
}

@media (max-width: 760px) {
    .bih-checkout .woocommerce-billing-fields__field-wrapper,
    .bih-checkout .woocommerce-shipping-fields__field-wrapper,
    .bih-checkout .woocommerce-additional-fields__field-wrapper { grid-template-columns: minmax(0, 1fr); }
    .bih-checkout h3 { font-size: 1.2rem; }
    .bih-checkout__payment { margin-top: 30px; }
    .bih-discount__panel { flex-direction: column; }
    .bih-discount__apply { width: 100%; }
    .bih-checkout #payment #place_order { padding: 17px 20px; }
}

/* ============================================================
   10. Checkout — the order summary is a list, not a table
   ------------------------------------------------------------
   `.woocommerce table.shop_table` paints every <th> sand and uppercase
   and gives every <td> a top border — right for the cart, wrong for the
   summary, where the rows should read as a quiet list of lines. Reset
   it explicitly rather than leaning on selector order.
   ============================================================ */
.bih-checkout .woocommerce-checkout-review-order-table th,
.bih-checkout .woocommerce-checkout-review-order-table td {
    border: 0 !important;
    background: none !important;
    padding: 0 !important;
    vertical-align: middle !important;
}
.bih-checkout .woocommerce-checkout-review-order-table tfoot th {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: .88rem !important;
    font-weight: 400 !important;
    color: var(--muted) !important;
    text-align: left !important;
}
.bih-checkout .woocommerce-checkout-review-order-table tfoot td {
    font-size: .92rem !important;
    font-weight: 500 !important;
    text-align: right !important;
    white-space: nowrap;
}
.bih-checkout .woocommerce-checkout-review-order-table tr.cart_item td.product-name {
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: center !important;
    text-align: left !important;
}
.bih-checkout .woocommerce-checkout-review-order-table tr.cart_item td.product-total {
    display: block !important;
    text-align: right !important;
    white-space: nowrap;
}

/* On phones the summary is a single narrow column: keep the row as two
   tracks (item, price) and let the item cell hold thumbnail plus text. */
@media (max-width: 1024px) {
    .bih-checkout .woocommerce-checkout-review-order-table tr.cart_item {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
    }
    .bih-checkout .woocommerce-checkout-review-order-table tfoot tr {
        display: flex !important;
        align-items: baseline !important;
        justify-content: space-between !important;
    }
    .bih-checkout .woocommerce-checkout-review-order-table tfoot th,
    .bih-checkout .woocommerce-checkout-review-order-table tfoot td {
        display: block !important;
    }
    .bih-checkout .woocommerce-checkout-review-order-table td::before,
    .bih-checkout .woocommerce-checkout-review-order-table th::before {
        display: none !important;
        content: none !important;
    }
}

/* ------------------------------------------------------------
   No payment gateway is enabled yet: keep the page honest.
   ------------------------------------------------------------ */
.bih-no-gateway .bih-secure-note,
.bih-no-gateway .bih-paylogos,
.bih-no-gateway .bih-checkout-guarantee { display: none; }
.bih-no-gateway #payment .woocommerce-info {
    background: var(--sand) !important;
    color: var(--ink) !important;
    border: 0 !important;
    border-radius: var(--r-md);
    padding: 18px 20px;
    margin: 0 0 18px;
    font-size: .88rem;
    line-height: 1.6;
}
.bih-no-gateway #payment .woocommerce-info::before { display: none; }
/* ============================================================
   11. Waterfall cards — image fill + mobile button placement
   ============================================================ */

/* --- 11a. The card image must fill its box -------------------------------
   WooCommerce.css ships:
       .woocommerce ul.products li.product a img { width:100%; height:auto; ... }
   That selector (0,3,4) outranks `.bih-pin__media img` (0,1,1), so every card
   image fell back to its natural ratio instead of the ratio the waterfall
   asked for. The picture then overflowed the box and `overflow:hidden` sliced
   the bottom off — which is exactly why short cards looked cropped and the
   add-to-cart pill sat on top of the product. Restate the rule with matching
   (but higher) weight. */
.woocommerce ul.products li.product .bih-pin__media a img,
.woocommerce ul.products li.product .bih-pin__media img,
.bih-pin .bih-pin__media a img {
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center;
}

/* --- 11b. Phones: never lay the button over the product ------------------
   There is no hover on a phone, so the quick-add pill used to sit permanently
   on the bottom of the photo. On a square or landscape card that covered the
   bag itself. Below 760px the pill moves out of the overlay and into the flow,
   right under the image, so the picture stays whole. */
@media (max-width: 760px) {
    .bih-pin__media {
        display: flex;
        flex-direction: column;
        aspect-ratio: auto;
        background: var(--surface);
    }
    .bih-pin__imglink {
        aspect-ratio: var(--pin-ratio, 4 / 5);
        height: auto;
    }
    .bih-pin__hover {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        padding: 11px 11px 12px;
        opacity: 1;
        transform: none;
    }
    .bih-pin__add {
        padding: 11px 12px;
        font-size: .78rem;
    }
}/* ============================================================
   12. Pagination — bring it into the theme
   ------------------------------------------------------------
   WooCommerce ships its own look for `nav.woocommerce-pagination`
   (grey bordered box, small square links). It was the one element on
   the catalogue pages still wearing the plugin default, which made a
   finished page look unfinished. Restyle it as the same pill row the
   category chips use.
   ============================================================ */
.woocommerce nav.woocommerce-pagination {
    margin: 38px 0 12px;
}
.woocommerce nav.woocommerce-pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    list-style: none;
}
.woocommerce nav.woocommerce-pagination ul li {
    margin: 0;
    padding: 0;
    border: 0;
    overflow: visible;
}
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink);
    font-size: .9rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li a:focus-visible {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.woocommerce nav.woocommerce-pagination ul li span.current {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.woocommerce nav.woocommerce-pagination ul li a.next,
.woocommerce nav.woocommerce-pagination ul li a.prev {
    font-size: 1rem;
    letter-spacing: .04em;
}

@media (max-width: 760px) {
    .woocommerce nav.woocommerce-pagination { margin: 30px 0 6px; }
    .woocommerce nav.woocommerce-pagination ul { gap: 6px; }
    .woocommerce nav.woocommerce-pagination ul li a,
    .woocommerce nav.woocommerce-pagination ul li span {
        min-width: 42px;
        height: 42px;
        padding: 0 11px;
        font-size: .84rem;
    }
}
/* ================================================================
   商品详情页画廊兜底修复（2026-10-15）
   ----------------------------------------------------------------
   现象：所有商品详情页手机端首屏被一大块空白撑开。
   原因：WooCommerce 画廊脚本（flexslider）未初始化时——
         1) 画廊容器始终保持 style="opacity:0"，内容全部不可见；
         2) 8 张图直接堆在 __wrapper 里没有做成轮播，却仍占布局高度。
   对策：不再依赖画廊脚本，用 CSS 保证可见 + 只显示首图 + 限制高度。
   ================================================================ */

/* 1) 画廊容器永远可见 */
.single-product .woocommerce-product-gallery,
.woocommerce div.product div.images.woocommerce-product-gallery {
  opacity: 1 !important;
  transition: none !important;
}

/* 2) 脚本未初始化时只显示第一张。
      flexslider 初始化后其余图片会被移入 .flex-viewport，
      不再是 __wrapper 的直接子元素，因此不受此规则影响。 */
/*
 * 只在「轮播脚本没跑起来」时才隐藏其余图，避免留下空白块。
 * 一旦 flexslider 初始化完成（出现 .flex-viewport），本规则自动失效，
 * 否则用户左右滑动时第 2 张之后的图会被藏掉 —— 这正是之前的 bug。
 */
.single-product .woocommerce-product-gallery:not(:has(.flex-viewport)) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child),
.woocommerce div.product div.images:not(:has(.flex-viewport)) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:nth-child(n+2) {
  display: none !important;
}

/* 3) 按原比例完整显示，避免 object-fit:fill 把非正方形主图拉变形 */
.single-product .woocommerce-product-gallery__image img,
.single-product .woocommerce-product-gallery img.wp-post-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* 4) 手机端限制主图高度，竖图不再把首屏撑满 */
@media (max-width: 767px) {
  .single-product .woocommerce-product-gallery__wrapper {
    max-height: 56vh;
    overflow: hidden;
  }
  .single-product .woocommerce-product-gallery__image {
    width: 100%;
  }
  .single-product .woocommerce-product-gallery__image img {
    max-height: 56vh;
    object-fit: contain;
  }
  .single-product .flex-control-thumbs {
    margin-top: 8px !important;
    gap: 8px;
  }
  .single-product .flex-control-thumbs li {
    width: 62px !important;
  }
}

/* ================================================================
   移动端布局视口被撑大 —— 根本修复（2026-10-15 第二轮）
   ----------------------------------------------------------------
   现象：真机上整个页面内容挤在左侧，右边留一条白边，
         页面像被缩小了一样（实测 iPhone 上 innerWidth 变成 583 而非 375）。
   原因：两个元素横向溢出，把移动端的布局视口撑大，
         浏览器为容纳它们而缩小渲染，于是内容整体左移。
         1) img.zoomImg —— WooCommerce 的缩放图，以原图尺寸渲染（实测 1242px）；
         2) .woocommerce-product-gallery__wrapper —— 8 张图横向排开（实测 8832px）。
   对策：禁用缩放图 + 裁切画廊 + 全局防溢出。
   ================================================================ */

/* 1) 画廊脚本异常时，缩放图会以原图尺寸溢出，直接禁用 */
.single-product .woocommerce-product-gallery .zoomImg,
.woocommerce div.product div.images .zoomImg {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
}

/* 2) 画廊自身裁切，绝不允许内容溢出容器 */
.single-product .woocommerce-product-gallery,
.woocommerce div.product div.images.woocommerce-product-gallery {
  overflow: hidden !important;
  max-width: 100% !important;
}
/*
 * 注意：绝不能给 __wrapper 加 width/max-width: 100% ——
 * flexslider 把 __wrapper 当作滑动轨道，宽度是「单张宽 × 张数」，
 * 强制 100% 会把轨道压扁，导致滑动时后面的图显示不出来。
 */
.single-product .woocommerce-product-gallery__wrapper,
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper {
  margin: 0 !important;
  padding: 0 !important;
}

/* 3) 未初始化轮播时只保留首图，其余不参与布局 */
/*
 * 只在「轮播脚本没跑起来」时才隐藏其余图，避免留下空白块。
 * 一旦 flexslider 初始化完成（出现 .flex-viewport），本规则自动失效，
 * 否则用户左右滑动时第 2 张之后的图会被藏掉 —— 这正是之前的 bug。
 */
.single-product .woocommerce-product-gallery:not(:has(.flex-viewport)) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child),
.woocommerce div.product div.images:not(:has(.flex-viewport)) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:nth-child(n+2) {
  display: none !important;
}
/*
 * 绝不要给单张 slide 加 width/max-width: 100% ——
 * flexslider 会给每张图设内联宽度（如 358px），
 * 强制 100% 会变成「轨道全宽」（如 5728px），
 * 结果每张图都撑满整条轨道，滑动时自然看不到第二张。
 */
/* 图片尺寸交给 flexslider 控制，不要强制 max-width，否则会干扰轨道计算 */
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
  display: block;
}

/* 4) 全局防溢出：用 clip 而不是 hidden，避免破坏页头的 position: sticky */
html,
body {
  overflow-x: clip;
  max-width: 100%;
}
@supports not (overflow: clip) {
  html, body { overflow-x: hidden; }
}
body img,
body video,
body iframe,
body table,
body pre {
  max-width: 100%;
}
/* 长英文串（商品名、SKU）允许断行，避免撑宽容器 */
.single-product .product_title,
.single-product .woocommerce-product-details__short-description,
.bih-pin__title,
.woocommerce-loop-product__title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Luxy Gaga variation selectors: real plugin-managed buttons, not dropdowns. */
.single-product .summary table.variations,
.single-product .summary table.variations tbody,
.single-product .summary table.variations tr,
.single-product .summary table.variations th.label,
.single-product .summary table.variations td.value {
    display: block; width: 100%; max-width: 100%; box-sizing: border-box;
}
.single-product .summary table.variations tr { margin-bottom: 20px; }
.single-product .summary table.variations th.label { padding: 0 0 8px; text-align: left; }
.single-product .summary table.variations td.value { padding: 0; }
.single-product .summary .variable-items-wrapper.button-variable-items-wrapper {
    display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px; width: 100% !important; max-width: 100% !important; margin: 0; padding: 0;
}
.single-product .summary .variable-items-wrapper[data-attribute_name="attribute_size"],
.single-product .summary .variable-items-wrapper[data-attribute_name="attribute_pa_size"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.single-product .summary .variable-items-wrapper .variable-item.button-variable-item {
    display: flex !important; align-items: center; justify-content: center !important;
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    height: auto !important; min-height: 44px; box-sizing: border-box;
    float: none; margin: 0 !important; padding: 10px 12px !important;
    border: 1px solid var(--line-2) !important; border-radius: 8px !important;
    color: var(--ink); background: #fff !important; box-shadow: none !important;
    font-size: .875rem; line-height: 1.35; text-align: center !important;
    cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.single-product .summary .variable-item.button-variable-item .variable-item-contents {
    width: 100%; min-width: 0; height: auto; display: flex; align-items: center; justify-content: center;
}
.single-product .summary .variable-item.button-variable-item .variable-item-span,
.single-product .summary .variable-item.button-variable-item .variable-item-span-button {
    display: block; width: 100%; height: auto; min-width: 0;
    white-space: normal !important; overflow-wrap: anywhere; word-break: normal;
    line-height: 1.35 !important; text-align: center !important; color: inherit;
}
.single-product .summary .variable-item.button-variable-item:hover,
.single-product .summary .variable-item.button-variable-item:focus-visible {
    border-color: var(--red) !important; outline: 2px solid var(--red-soft); outline-offset: 2px;
}
.single-product .summary .variable-item.button-variable-item.selected {
    color: #fff !important; background: var(--red) !important; border-color: var(--red) !important;
    font-weight: 600;
}
.single-product .summary .variable-item.button-variable-item.disabled {
    color: #918e85 !important; background: #f3f2ec !important;
    border-color: var(--line) !important; text-decoration: line-through; cursor: not-allowed;
}
.single-product .summary .woo-selected-variation-item-name { font-size: .8rem; color: var(--ink-3); }
.single-product .summary .reset_variations { margin-top: 8px; font-size: .8rem; color: var(--ink-3); text-decoration: underline; }
@media(min-width:1100px) {
    .single-product .summary .variable-items-wrapper[data-attribute_name="attribute_size"],
    .single-product .summary .variable-items-wrapper[data-attribute_name="attribute_pa_size"] {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* ============================================================================
   购物车：数量加减 + 按需出现的「更新购物车」按钮
   ----------------------------------------------------------------------------
   需求：
     1. 数量框左右各加 − / +，点一下改一个
     2. 改过数量后，左侧才出现「更新购物车」按钮（没改就不该出现）
     3. 提交后按钮变灰，避免重复点
   注意：整个控件宽度必须收在数量列内，不能把表格撑开。
   ========================================================================== */

/* --- 1. 数量框做成胶囊，− 输入 + 三段等宽 --- */
.woocommerce-cart-form .cart_item .product-quantity .quantity,
.woocommerce-cart-form td.product-quantity .quantity {
  display: inline-flex !important;
  align-items: stretch;
  height: 42px;
  width: auto;
  max-width: 100%;
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-pill);
  overflow: hidden;                 /* 圆角裁切，防止按钮方角溢出 */
  vertical-align: middle;
}

/* 输入框去掉自己的边框，融入胶囊 */
.woocommerce-cart-form .quantity input.qty {
  width: 52px !important;
  min-width: 0;
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center;
  font-weight: 600;
  -moz-appearance: textfield;
  appearance: textfield;
}
.woocommerce-cart-form .quantity input.qty::-webkit-outer-spin-button,
.woocommerce-cart-form .quantity input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 加减按钮：等宽、够点、不换行 */
.woocommerce-cart-form .quantity .bih-qty-btn {
  width: 34px;
  min-width: 34px;
  flex: 0 0 34px;
  height: 100%;
  font-size: 1rem;
}

/* 手机端把点击区域放大到 40px，仍保证总宽 < 列宽 */
@media (max-width: 640px) {
  .woocommerce-cart-form .quantity .bih-qty-btn {
    width: 40px;
    min-width: 40px;
    flex-basis: 40px;
  }
  .woocommerce-cart-form .quantity input.qty { width: 46px !important; }
}

/* --- 2. 更新按钮：默认隐藏，改过数量才出现 --- */
.bih-cart-update[hidden] { display: none !important; }

.bih-cart-update {
  display: flex;
  justify-content: flex-start;      /* 靠左，和优惠券区对齐 */
  margin-bottom: 18px;
}

/* 出现时轻微上浮，提示「这里有变化」 */
.bih-cart-update:not([hidden]) {
  animation: bih-cart-update-in .22s var(--ease, ease) both;
}
@keyframes bih-cart-update-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* --- 3. 提交后变灰 --- */
.bih-cart-update button[name="update_cart"][disabled],
.bih-cart-update.is-saving button[name="update_cart"] {
  background: var(--sand) !important;
  color: var(--muted) !important;
  border-color: transparent !important;
  opacity: .75;
  cursor: wait;
  transform: none !important;
}

/* 数量框获得焦点时描边，和站点其它输入框一致 */
.woocommerce-cart-form .quantity:focus-within {
  border-color: var(--ink);
}

/* ============================================================================
   购物车数量控件 · 第二轮调整
   ----------------------------------------------------------------------------
   1. 手机端控件偏大，整体收小（高度 42 → 36，按钮 40 → 32）
   2. 数量为 1 时减号置灰，要一眼看出「点不了」，而不只是颜色浅一点
   ========================================================================== */

/* --- 手机端：整体收小 --- */
@media (max-width: 640px) {
  .woocommerce-cart-form .cart_item .product-quantity .quantity,
  .woocommerce-cart-form td.product-quantity .quantity {
    height: 36px;
    border-width: 1.25px;
  }
  .woocommerce-cart-form .quantity .bih-qty-btn {
    width: 32px;
    min-width: 32px;
    flex-basis: 32px;
    font-size: .95rem;
  }
  .woocommerce-cart-form .quantity input.qty {
    width: 40px !important;
    font-size: .95rem;
    padding: 0 !important;
  }
}

/* 更窄的机型（≤380px）再收一点，保证不撑破数量列 */
@media (max-width: 380px) {
  .woocommerce-cart-form .quantity .bih-qty-btn {
    width: 30px;
    min-width: 30px;
    flex-basis: 30px;
  }
  .woocommerce-cart-form .quantity input.qty { width: 36px !important; }
}

/* --- 减号禁用态：明显「不可点」 --- */
.woocommerce-cart-form .quantity .bih-qty-btn:disabled,
.woocommerce-cart-form .quantity .bih-qty-btn[disabled] {
  color: #c9c1b8 !important;
  background: #f7f4f0 !important;
  cursor: not-allowed !important;
  opacity: .85;
}
.woocommerce-cart-form .quantity .bih-qty-btn:disabled:hover,
.woocommerce-cart-form .quantity .bih-qty-btn[disabled]:hover {
  color: #c9c1b8 !important;
  background: #f7f4f0 !important;
}

/* 数量为 1 时，整框左侧也淡一点，强化「到下限了」的暗示 */
.woocommerce-cart-form .quantity.is-at-min {
  border-color: var(--line) !important;
}

/* ============================================================================
   购物车 · 第三轮调整
   ----------------------------------------------------------------------------
   1. 商品标题不再被截断（原来被压成一行只露几个字）
   2. 变体属性（尺码/颜色等）用小字号 + 弱化色，让用户看清买的是哪一款
   3. 行内小「update」按钮：出现在 + 号右边，只作用于本行，尺寸自适应
   ========================================================================== */

/* --- 1. 标题：允许换行，别把字藏起来 --- */
.woocommerce-cart-form .cart_item .product-name,
.woocommerce-cart-form .cart_item .product-name a {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.woocommerce-cart-form .cart_item .product-name a {
  display: block;
  max-width: 100%;
}

/* --- 2. 变体属性：小字号 + 弱化色 --- */
.woocommerce-cart-form .cart_item .product-name .variation,
.woocommerce-cart-form .cart_item dl.variation {
  display: block;
  margin: 5px 0 0;
  padding: 0;
  font-size: .78rem;
  line-height: 1.45;
  color: #8a8079;                 /* 弱化的暖灰，和主标题拉开层级 */
  font-family: var(--f-body, inherit);
  font-weight: 400;
  letter-spacing: .01em;
}
.woocommerce-cart-form .cart_item .variation dt,
.woocommerce-cart-form .cart_item .variation dd,
.woocommerce-cart-form .cart_item dl.variation dt,
.woocommerce-cart-form .cart_item dl.variation dd {
  display: inline;
  float: none;
  margin: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
  font-weight: 400;
}
/* 「Size:」这类标签用更浅一点的色，值稍深 */
.woocommerce-cart-form .cart_item .variation dt {
  color: #a89e96;
  text-transform: capitalize;
}
.woocommerce-cart-form .cart_item .variation dd {
  color: #6f665f;
  font-weight: 500;
}
/* 每个属性占一行，长值能折行 */
.woocommerce-cart-form .cart_item .variation p {
  margin: 0 0 2px;
  font-size: inherit;
  color: inherit;
}

/* --- 3. 行内小 update 按钮 --- */
.bih-row-update {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  padding: 0 10px;
  height: 30px;
  min-width: 0;
  border: 1.25px solid var(--line-2);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink);
  font-family: var(--f-body, inherit);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  text-transform: lowercase;
  white-space: nowrap;
  cursor: pointer;
  vertical-align: middle;
  transition: background .18s var(--ease, ease), color .18s var(--ease),
              border-color .18s var(--ease);
}
.bih-row-update:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.bih-row-update[hidden] { display: none !important; }
.bih-row-update:disabled {
  background: var(--sand);
  color: var(--muted);
  border-color: transparent;
  cursor: wait;
}

/* 桌面端数量列窄，按钮再收一点，保证不挤走小计 */
.woocommerce-cart-form .cart_item .product-quantity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.woocommerce-cart-form .cart_item .product-quantity .bih-row-update {
  margin-left: 0;
}

@media (max-width: 640px) {
  .bih-row-update {
    height: 28px;
    padding: 0 9px;
    font-size: .7rem;
  }
  .woocommerce-cart-form .cart_item .product-quantity { gap: 6px; }
}

/* 说明：曾把这里隐藏、改用行内小按钮，但实测行内按钮被其它元素遮挡，
   点击落不到它身上，导致「点 update 后数量回退」。已恢复原生按钮，
   保证购物车更新功能可用。 */
.bih-cart-update[data-js-active] { display: block !important; }
}

/* 桌面端数量列只有 189px：122px 的胶囊 + 63px 的按钮会超宽而换行，
   把两者都收一点，让 update 稳稳待在 + 号右边同一行 */
@media (min-width: 641px) {
  .woocommerce-cart-form .quantity .bih-qty-btn {
    width: 32px;
    min-width: 32px;
    flex-basis: 32px;
  }
  .woocommerce-cart-form .quantity input.qty { width: 48px !important; }
  .bih-row-update {
    height: 28px;
    padding: 0 8px;
    font-size: .7rem;
  }
  .woocommerce-cart-form .cart_item .product-quantity { gap: 6px; }
}

/* 桌面端数量列的可用宽度 = 列宽 − 单元格左右内边距，
   实测只剩约 150px，所以把内边距也一起收，胶囊和按钮各让一点，
   保证 update 和 + 号在同一行 */
@media (min-width: 641px) {
  .woocommerce-cart-form .cart_item .product-quantity {
    padding-left: 6px !important;
    padding-right: 6px !important;
    gap: 6px;
  }
  .woocommerce-cart-form .quantity .bih-qty-btn {
    width: 30px;
    min-width: 30px;
    flex-basis: 30px;
    font-size: .95rem;
  }
  .woocommerce-cart-form .quantity input.qty { width: 42px !important; }
  .bih-row-update {
    height: 26px;
    padding: 0 7px;
    font-size: .68rem;
  }
}

/* 桌面端：table 是 auto layout，列宽会跟着内容走。如果允许 flex 换行，
   按钮一换行列就变窄，列一窄按钮又换行，互相锁死。
   这里强制不换行，列宽自然会撑到刚好容纳「胶囊 + update」。 */
@media (min-width: 641px) {
  .woocommerce-cart-form .cart_item .product-quantity {
    flex-wrap: nowrap !important;
    white-space: nowrap;
    padding-left: 8px !important;
    padding-right: 8px !important;
    gap: 8px;
  }
  .woocommerce-cart-form .cart_item .product-quantity .quantity {
    flex: 0 0 auto;
  }
  .bih-row-update {
    flex: 0 0 auto;
    height: 28px;
    padding: 0 9px;
    font-size: .7rem;
  }
}

/* 最终覆盖：确保原生 Update cart 按钮可见可用。
   行内小按钮方案已废弃（点击会被遮挡，提交不生效）。 */
.woocommerce-cart-form ~ .bih-cart-update,
.bih-cart-update,
.bih-cart-update[data-js-active] {
  display: block !important;
  position: static !important;
  left: auto !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  margin-top: 20px !important;
  padding: 0 !important;
  pointer-events: auto !important;
}
.bih-cart-update[data-js-active] button[name="update_cart"] {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 原生按钮容器即使带 hidden 属性也要显示（行内方案已废弃） */
.bih-cart-update[hidden] { display: block !important; }
.bih-cart-update[hidden] button[name="update_cart"] { display: inline-block !important; }

/* 数量数字被上下裁掉：输入框高度只够到字形的一部分。
   这里给足行高并放开裁剪，让数字完整显示（胶囊整体高度不变）。 */
.woocommerce-cart-form .quantity input.qty {
  height: 100% !important;
  min-height: 40px;
  line-height: 40px !important;
  padding: 0 !important;
  overflow: visible !important;
  font-size: 1rem;
  box-sizing: border-box;
}
.woocommerce-cart-form .quantity input.qty::-webkit-outer-spin-button,
.woocommerce-cart-form .quantity input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.woocommerce-cart-form .quantity .bih-qty-btn {
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 行内按钮已移除，数量框恢复原本宽度（此前为腾空间被压到 42px） */
@media (min-width: 641px) {
  .woocommerce-cart-form .quantity input.qty { width: 56px !important; }
  .woocommerce-cart-form .quantity .bih-qty-btn {
    width: 36px; min-width: 36px; flex-basis: 36px;
  }
  .woocommerce-cart-form .cart_item .product-quantity {
    padding-left: 10px !important; padding-right: 10px !important;
  }
}

/* 连点 +/- 时输入框里的数字会被选中，出现粉红高亮且看着像被裁掉。
   数字类只读式交互不需要选中文本，这里直接禁掉，并让选中色透明兜底。 */
.woocommerce-cart-form .quantity input.qty,
.single-product .quantity input.qty {
  -webkit-user-select: none;
  user-select: none;
}
.woocommerce-cart-form .quantity input.qty::selection,
.single-product .quantity input.qty::selection {
  background: transparent;
  color: inherit;
}
.woocommerce-cart-form .quantity input.qty::-moz-selection,
.single-product .quantity input.qty::-moz-selection {
  background: transparent;
  color: inherit;
}

/* POD imagery: retain the existing waterfall heights, show the complete garment. */
.bih-pin .bih-pin__imglink img { object-fit: contain !important; background: #fff; }
.bih-pod-ready-note { background: var(--red-soft); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 16px 18px; color: var(--ink-2); font-size: .9rem; }
.woocommerce-error { color: #8f2626 !important; }
