/*
 * Brandshox 1.4.2 — responsive layout and cart action accessibility.
 * This file is intentionally isolated from WooCommerce cart/checkout templates.
 * All discount, cart and payment calculations remain with WooCommerce.
 */
:root {
  --bs-width: 1560px;
  --bs-cart-width: 1680px;
  --bs-checkout-width: 1600px;
  --bs-gutter: clamp(24px, 3.2vw, 64px);
}

/* Wider storefront without distorting long-form article and policy text. */
.bs-container,
.bs-shop-hero .bs-container {
  width: min(calc(100% - var(--bs-gutter)), var(--bs-width));
  margin-inline: auto;
}
.bs-site-header .bs-header-row { gap: clamp(14px, 2vw, 34px); }
.bs-desktop-nav { min-width: 0; }
.bs-product-card, .bs-product-meta, .bs-card-photo { min-width: 0; }
.bs-product-meta h3, .bs-product-cat { overflow-wrap: anywhere; }
.bs-pdp-gallery, .bs-pdp-summary { min-width: 0; }

/* Cart and checkout pages receive their own independent desktop widths. */
body.woocommerce-cart main.bs-default-page.bs-container {
  width: min(calc(100% - var(--bs-gutter)), var(--bs-cart-width));
  max-width: none;
}
body.woocommerce-checkout main.bs-default-page.bs-container {
  width: min(calc(100% - var(--bs-gutter)), var(--bs-checkout-width));
  max-width: none;
}
.woocommerce-cart .bs-page-content,
.woocommerce-checkout .bs-page-content,
.woocommerce-cart .bs-page-content > .woocommerce,
.woocommerce-checkout .bs-page-content > .woocommerce,
.woocommerce-cart .bs-cart-main,
.woocommerce-checkout .bs-checkout-main {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.woocommerce-cart .bs-cart-page {
  grid-template-columns: minmax(0, 1fr) minmax(370px, 430px);
  gap: clamp(24px, 3vw, 50px);
  align-items: start;
}
.woocommerce-checkout .bs-checkout-layout {
  grid-template-columns: minmax(0, 1fr) minmax(390px, 460px);
  gap: clamp(24px, 3vw, 54px);
  align-items: start;
}
.woocommerce-cart .bs-cart-sidebar,
.woocommerce-checkout .bs-checkout-sidebar { min-width: 0; }
.woocommerce-cart .cart-collaterals,
.woocommerce-cart .cart-collaterals .cart_totals,
.woocommerce-checkout .woocommerce-checkout-review-order { width: 100%; max-width: none; }
.woocommerce-checkout .bs-checkout-main #customer_details .col-1,
.woocommerce-checkout .bs-checkout-main #customer_details .col-2,
.woocommerce-checkout .bs-checkout-main #customer_details .woocommerce-billing-fields,
.woocommerce-checkout .bs-checkout-main #customer_details .woocommerce-shipping-fields {
  float: none;
  width: 100%;
  max-width: none;
  min-width: 0;
}
.woocommerce-checkout .bs-checkout-main #customer_details .col-2 { margin-top: 18px; }
.woocommerce-checkout .bs-checkout-main .form-row { min-width: 0; }
.woocommerce-checkout .bs-checkout-main input.input-text,
.woocommerce-checkout .bs-checkout-main select,
.woocommerce-checkout .bs-checkout-main textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* WooCommerce block variants: widen the outer shell, avoid altering checkout internals. */
body.woocommerce-cart .wc-block-cart,
body.woocommerce-checkout .wc-block-checkout,
body.woocommerce-cart .wp-block-woocommerce-cart,
body.woocommerce-checkout .wp-block-woocommerce-checkout {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

/* Update cart: readable disabled and enabled states, with WooCommerce behavior intact. */
body.woocommerce-cart .woocommerce-cart-form button[name="update_cart"],
body.woocommerce-cart .woocommerce-cart-form button.button[name="update_cart"]:not(:disabled) {
  background: #121212;
  border: 1px solid #121212;
  color: #fff;
  opacity: 1;
  font-weight: 750;
  text-shadow: none;
  transition: background-color .18s, border-color .18s, color .18s;
}
body.woocommerce-cart .woocommerce-cart-form button[name="update_cart"]:not(:disabled):hover,
body.woocommerce-cart .woocommerce-cart-form button[name="update_cart"]:not([disabled]):focus-visible {
  background: #303030;
  border-color: #303030;
  color: #fff;
}
body.woocommerce-cart .woocommerce-cart-form button[name="update_cart"]:disabled,
body.woocommerce-cart .woocommerce-cart-form button[name="update_cart"][disabled],
body.woocommerce-cart .woocommerce-cart-form button.button[name="update_cart"]:disabled,
body.woocommerce-cart .woocommerce-cart-form button.button[name="update_cart"][disabled] {
  background: #e8e8e8 !important;
  border: 1px solid #d5d5d5 !important;
  color: #414141 !important;
  opacity: 1 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  text-shadow: none !important;
  -webkit-text-fill-color: #414141;
}
body.woocommerce-cart .woocommerce-cart-form button[name="update_cart"]:disabled:hover,
body.woocommerce-cart .woocommerce-cart-form button[name="update_cart"][disabled]:hover {
  background: #e8e8e8 !important;
  color: #414141 !important;
}
body.woocommerce-cart .woocommerce-cart-form td.actions {
  vertical-align: middle;
}
body.woocommerce-cart .woocommerce-cart-form td.actions .coupon {
  min-width: 0;
  max-width: 100%;
}
body.woocommerce-cart .woocommerce-cart-form td.actions .coupon input#coupon_code {
  box-sizing: border-box;
  max-width: 100%;
}
body.woocommerce-cart .woocommerce-cart-form td.actions button.button {
  min-height: 46px;
  line-height: 1.2;
  white-space: normal;
}

/* Allow checkout form and totals to breathe on wider desktop screens. */
.woocommerce-cart .bs-cart-sidebar > .bs-offer-box,
.woocommerce-cart .bs-cart-sidebar > .bs-cart-support-box,
.woocommerce-checkout .bs-checkout-sidebar > .bs-offer-box {
  margin-inline: 0;
}
.woocommerce-checkout .bs-checkout-main .woocommerce-billing-fields,
.woocommerce-checkout .bs-checkout-main .woocommerce-shipping-fields {
  padding: clamp(22px, 2.1vw, 34px);
}
.woocommerce-checkout .bs-checkout-sidebar #order_review,
.woocommerce-checkout .bs-checkout-coupon-box form.checkout_coupon { padding: clamp(18px, 2vw, 30px); }
.woocommerce-checkout #order_review .shop_table { table-layout: auto; }
.woocommerce-checkout #order_review .shop_table td,
.woocommerce-checkout #order_review .shop_table th { overflow-wrap: anywhere; }

/* Tablet landscape: stacked checkout/sidebar rather than two cramped columns. */
@media (max-width: 1180px) {
  :root { --bs-gutter: 44px; }
  body.woocommerce-cart .bs-cart-page { display: flex; flex-direction: column; gap: 24px; }
  body.woocommerce-cart .bs-cart-main { display: contents; }
  body.woocommerce-cart .bs-cart-main > .woocommerce-cart-form { order: 1; width: 100%; }
  body.woocommerce-cart .bs-cart-sidebar { order: 2; width: 100%; position: static; }
  body.woocommerce-cart .bs-cart-main > .bs-cart-recommend { order: 3; width: 100%; }
  body.woocommerce-checkout .bs-checkout-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  body.woocommerce-checkout .bs-checkout-sidebar { position: static; }
  body.woocommerce-checkout .bs-checkout-confidence { margin-bottom: 0; }
  body.woocommerce-cart .bs-cart-sidebar .bs-trust-badges { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

/* Mobile design: larger touch targets, fluid cards and clean stacked commerce UI. */
@media (max-width: 767px) {
  :root { --bs-gutter: 32px; }
  html, body { max-width: 100%; }
  .bs-container,
  .bs-shop-hero .bs-container,
  body.woocommerce-cart main.bs-default-page.bs-container,
  body.woocommerce-checkout main.bs-default-page.bs-container { width: calc(100% - var(--bs-gutter)); }
  .bs-site-header .bs-header-row { gap: 9px; min-height: 60px; height: auto; padding-block: 8px; }
  .bs-logo-link { min-width: 0; max-width: calc(100% - 112px); }
  .bs-logo-link .bs-custom-logo,
  .bs-logo-link img { width: auto; height: auto; max-height: 36px; max-width: min(43vw, 200px); object-fit: contain; }
  .bs-header-actions { margin-left: auto; gap: 1px; flex-shrink: 0; }
  .bs-icon-button { min-width: 35px; min-height: 42px; padding: 7px; }
  .bs-mobile-menu { padding: 10px 16px 22px; max-height: calc(100dvh - 86px); overflow-y: auto; overscroll-behavior: contain; }
  .bs-mobile-menu a, .bs-mobile-menu summary { min-height: 44px; display: flex; align-items: center; }
  .bs-mobile-menu .bs-mobile-links .sub-menu { margin: 0; padding: 0 0 0 14px; list-style: none; }
  .bs-topbar .bs-container { min-height: 32px; padding: 4px 0; text-align: center; }
  .bs-topbar .bs-container > span:first-child { line-height: 1.35; font-size: 10px; }
  .bs-hero { min-height: 445px; height: clamp(445px, 120vw, 560px); }
  .bs-hero-content { padding: 30px 0; }
  .bs-hero h1 { font-size: clamp(34px, 8vw, 51px); }
  .bs-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
  .bs-hero-actions .bs-button { min-height: 44px; }
  .bs-benefits-inner { gap: 10px; }
  .bs-category-grid { gap: 12px; }
  .bs-category-card { border-radius: 4px; }
  .bs-section-heading { align-items: flex-start; flex-wrap: wrap; row-gap: 10px; }
  .bs-product-grid, ul.products.bs-product-grid,
  .woocommerce ul.products,
  .woocommerce .bs-shop-content ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .bs-product-grid .bs-product-card,
  .woocommerce ul.products li.product.bs-product-card { min-width: 0; }
  .bs-card-photo { aspect-ratio: 1; }
  .bs-product-meta { padding-top: 9px; }
  .bs-product-meta h3 { font-size: 12px; line-height: 1.45; }
  .bs-product-price { font-size: 14px; }
  .bs-shop-toolbar { flex-wrap: wrap; gap: 12px; }
  .bs-filter-form { gap: 10px; }
  .bs-pdp-summary h1 { font-size: clamp(28px, 7vw, 38px); line-height: 1.15; }
  .bs-pdp-top { display: block; }
  .woocommerce div.product .bs-pdp-gallery { margin-bottom: 22px; }
  .woocommerce div.product form.cart .quantity input.qty { height: 46px; }
  .woocommerce div.product form.cart .single_add_to_cart_button { min-height: 48px; }
  .bs-reviews-layout { gap: 22px; }
  .bs-review-modal-panel { width: min(100%, 580px); max-height: calc(100dvh - 20px); }
  .bs-footer-main { column-gap: 18px; }

  /* Cart as individual product cards instead of squeezed desktop table rows. */
  body.woocommerce-cart .bs-cart-main form.woocommerce-cart-form,
  body.woocommerce-cart .bs-cart-main table.woocommerce-cart-form__contents,
  body.woocommerce-cart .bs-cart-main table.woocommerce-cart-form__contents tbody { display: block; width: 100%; min-width: 0; }
  body.woocommerce-cart .bs-cart-main table.woocommerce-cart-form__contents { border: 0; }
  body.woocommerce-cart .bs-cart-main table.woocommerce-cart-form__contents thead { display: none !important; }
  body.woocommerce-cart .bs-cart-main table.woocommerce-cart-form__contents tr.cart_item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    gap: 7px 12px;
    align-items: start;
    padding: 17px 0;
    margin-bottom: 0;
    border-bottom: 1px solid #e8e8e8;
  }
  body.woocommerce-cart .bs-cart-main table.woocommerce-cart-form__contents tr.cart_item > td {
    display: block !important; width: auto !important; min-width: 0;
    padding: 0 !important; border: 0 !important; float: none !important;
    text-align: left !important; background: transparent;
  }
  body.woocommerce-cart .bs-cart-main tr.cart_item > td::before { content: none !important; display: none !important; }
  body.woocommerce-cart .bs-cart-main tr.cart_item > .product-thumbnail { grid-column: 1; grid-row: 1 / span 4; }
  body.woocommerce-cart .bs-cart-main tr.cart_item > .product-thumbnail img {
    width: 92px; max-width: 100%; height: auto; aspect-ratio: 1; object-fit: contain;
    display: block; border-radius: 4px;
  }
  body.woocommerce-cart .bs-cart-main tr.cart_item > .product-name { grid-column: 2; grid-row: 1; font-size: 14px; line-height: 1.35; }
  body.woocommerce-cart .bs-cart-main tr.cart_item > .product-price { grid-column: 2; grid-row: 2; font-size: 13px; color: #575757; }
  body.woocommerce-cart .bs-cart-main tr.cart_item > .product-quantity { grid-column: 2; grid-row: 3; }
  body.woocommerce-cart .bs-cart-main tr.cart_item > .product-quantity input.qty {
    width: 68px; min-width: 0; max-width: 100%; height: 42px;
  }
  body.woocommerce-cart .bs-cart-main tr.cart_item > .product-subtotal {
    grid-column: 3; grid-row: 3; justify-self: end;
    align-self: center; font-size: 14px; font-weight: 800; text-align: right !important;
  }
  body.woocommerce-cart .bs-cart-main tr.cart_item > .product-remove {
    grid-column: 3; grid-row: 1; justify-self: end; margin-top: -2px;
  }
  body.woocommerce-cart .bs-cart-main tr.cart_item .product-remove a.remove {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; font-size: 23px; border-radius: 50%;
  }
  body.woocommerce-cart .bs-cart-main table.woocommerce-cart-form__contents tr:last-child { display: block; }
  body.woocommerce-cart .bs-cart-main table.woocommerce-cart-form__contents td.actions {
    display: flex; flex-wrap: wrap; align-items: stretch; flex-direction: column;
    gap: 12px; padding: 20px 0 0 !important; border: 0 !important;
    text-align: left;
  }
  body.woocommerce-cart .bs-cart-main td.actions .coupon {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px; float: none; width: 100%;
  }
  body.woocommerce-cart .bs-cart-main td.actions .coupon #coupon_code {
    float: none !important; width: 100% !important; min-width: 0 !important;
    height: 48px; margin: 0 !important;
  }
  body.woocommerce-cart .bs-cart-main td.actions .coupon button.button {
    float: none; padding-inline: 15px; margin: 0;
    font-size: 12px; min-width: 0;
  }
  body.woocommerce-cart .bs-cart-main td.actions button[name="update_cart"] {
    float: none !important; align-self: flex-end;
    min-width: 150px; margin: 0;
  }
  body.woocommerce-cart .bs-cart-sidebar .bs-trust-badges { grid-template-columns: repeat(2, minmax(0,1fr)); }
  body.woocommerce-cart .bs-cart-recommend { padding-top: 20px; }
  body.woocommerce-cart .bs-cart-recommend h2 { font-size: 28px; }
  body.woocommerce-cart .cart-collaterals .cart_totals { padding: 22px; }

  /* Checkout stacks fields and order summary without horizontal scrolling. */
  body.woocommerce-checkout .bs-checkout-steps { display: flex; flex-wrap: wrap; gap: 4px; }
  body.woocommerce-checkout .bs-checkout-main .woocommerce-billing-fields,
  body.woocommerce-checkout .bs-checkout-main .woocommerce-shipping-fields { padding: 18px; }
  body.woocommerce-checkout .bs-checkout-main .form-row-first,
  body.woocommerce-checkout .bs-checkout-main .form-row-last {
    width: 100% !important; float: none !important; clear: both;
  }
  body.woocommerce-checkout .bs-checkout-main #customer_details .col-1,
  body.woocommerce-checkout .bs-checkout-main #customer_details .col-2 { width: 100%; }
  body.woocommerce-checkout .bs-checkout-main .form-row input,
  body.woocommerce-checkout .bs-checkout-main .form-row select,
  body.woocommerce-checkout .bs-checkout-main .form-row textarea { min-height: 46px; }
  body.woocommerce-checkout .bs-checkout-sidebar #order_review,
  body.woocommerce-checkout .bs-checkout-coupon-box form.checkout_coupon { padding: 18px; }
  body.woocommerce-checkout .woocommerce-checkout-payment #place_order { min-height: 50px; }
  body.woocommerce-checkout .bs-checkout-sidebar table.shop_table td,
  body.woocommerce-checkout .bs-checkout-sidebar table.shop_table th { padding: 12px 10px; }
  body.woocommerce-checkout .bs-checkout-sidebar table.shop_table { font-size: 13px; }
  body.woocommerce-checkout .bs-checkout-sidebar .bs-trust-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Blocks retain WooCommerce's own mobile structure. */
  .wc-block-cart, .wc-block-checkout,
  .wc-block-components-main,
  .wc-block-components-sidebar { min-width: 0; }
  .wc-block-components-sidebar { padding: 14px; }
}

@media (max-width: 420px) {
  :root { --bs-gutter: 28px; }
  .bs-logo-link { max-width: calc(100% - 105px); }
  .bs-logo-link img { max-width: min(44vw, 170px); }
  .bs-header-actions .bs-icon-button { min-width: 33px; padding: 6px; }
  .bs-hero-actions .bs-button { min-width: 0; }
  .bs-benefits-inner { gap: 7px; }
  .bs-benefit { gap: 7px; }
  .bs-benefit b { font-size: 10px; }
  body.woocommerce-cart .bs-cart-main table.woocommerce-cart-form__contents tr.cart_item {
    grid-template-columns: 76px minmax(0, 1fr) 30px; gap: 6px 9px;
  }
  body.woocommerce-cart .bs-cart-main tr.cart_item > .product-thumbnail img { width: 76px; }
  body.woocommerce-cart .bs-cart-main tr.cart_item > .product-subtotal { grid-column: 2 / 4; justify-self: start; grid-row: 4; }
  body.woocommerce-cart .bs-cart-main td.actions .coupon { grid-template-columns: minmax(0, 1fr); }
  body.woocommerce-cart .bs-cart-main td.actions .coupon button.button { width: 100%; }
  body.woocommerce-cart .bs-cart-main td.actions button[name="update_cart"] { align-self: stretch; }
  body.woocommerce-cart .bs-cart-sidebar .bs-trust-badges,
  body.woocommerce-checkout .bs-checkout-sidebar .bs-trust-badges { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  body.woocommerce-cart .woocommerce-cart-form button[name="update_cart"] { transition: none; }
}

/* Checkout coupons can be printed by plugins as classic WooCommerce .form-row columns.
   Keep both steps full-width on narrow devices; do not change coupon processing. */
@media (max-width: 767px) {
  body.woocommerce-checkout .bs-checkout-coupon-box form.checkout_coupon {
    display: block;
    width: 100%;
  }
  body.woocommerce-checkout .bs-checkout-coupon-box form.checkout_coupon p.form-row-first,
  body.woocommerce-checkout .bs-checkout-coupon-box form.checkout_coupon p.form-row-last {
    width: 100% !important;
    float: none !important;
    clear: both;
    display: block;
    margin: 0 0 10px !important;
  }
  body.woocommerce-checkout .bs-checkout-coupon-box form.checkout_coupon input.input-text,
  body.woocommerce-checkout .bs-checkout-coupon-box form.checkout_coupon button.button {
    width: 100% !important;
    min-width: 0;
    min-height: 46px;
  }
}
@media (min-width: 768px) and (max-width: 980px) {
  body.woocommerce-cart .bs-cart-main .woocommerce-cart-form {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.woocommerce-cart .bs-cart-main table.woocommerce-cart-form__contents {
    min-width: 680px;
  }
}

/* Graceful layout fallback for checkout coupon markup modified by third-party plugins. */
@media (max-width: 767px) {
  body.woocommerce-checkout .bs-checkout-coupon-box > p.form-row-first,
  body.woocommerce-checkout .bs-checkout-coupon-box > p.form-row-last {
    display: block;
    float: none !important;
    width: 100% !important;
    clear: both;
    margin: 0 0 10px;
  }
  body.woocommerce-checkout .bs-checkout-coupon-box > p.form-row-first input,
  body.woocommerce-checkout .bs-checkout-coupon-box > p.form-row-last button {
    width: 100% !important;
    max-width: none;
    min-height: 46px;
  }
}
