/*
 * SHE'S BUNDLED UP
 * MOBILE FOOTER + SHOP CARD REFINEMENTS
 * Desktop layout is untouched.
 */

@media (max-width: 767px) {

  /* ===================================
     MOBILE FOOTER
  =================================== */

  .sbu-shared-footer {
    padding: 42px 5% 22px !important;
  }

  .sbu-shared-footer .footer-grid {
    display: grid !important;
    grid-template-columns:
      minmax(0, 1fr) minmax(0, 1.15fr) !important;
    gap: 20px 20px !important;
    align-items: start;
  }

  .sbu-shared-footer .footer-grid > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  /* Logo, tagline and social icons */
  .sbu-shared-footer .footer-grid > :nth-child(1) {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    text-align: center;
  }

  .sbu-shared-footer .footer-grid > :nth-child(1)
  .footer-logo {
    display: block;
    margin: 0 auto 12px !important;
    width: 110px;
    height: auto;
  }

  .sbu-shared-footer .footer-grid > :nth-child(1)
  .social-links,
  .sbu-shared-footer .footer-grid > :nth-child(1)
  .social-icons,
  .sbu-shared-footer .footer-grid > :nth-child(1)
  .footer-social {
    justify-content: center;
  }

  /* SHOP: left */
  .sbu-shared-footer .footer-grid > :nth-child(2) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  /* EXPLORE: below Shop, left */
  .sbu-shared-footer .footer-grid > :nth-child(3) {
    grid-column: 1 !important;
    grid-row: 3 !important;
  }

  /* HELP & POLICIES: right */
  .sbu-shared-footer .footer-grid > :nth-child(4) {
    grid-column: 2 !important;
    grid-row: 2 / span 2 !important;
  }

  .sbu-shared-footer h3 {
    font-size: 11px !important;
    line-height: 1.4;
    letter-spacing: .65px;
    margin: 0 0 12px !important;
  }

  .sbu-shared-footer a {
    font-size: 12px !important;
    line-height: 1.5;
    margin: 0 0 11px !important;
    overflow-wrap: break-word;
  }

  .sbu-shared-footer p {
    font-size: 12px;
    line-height: 1.6;
  }

  .sbu-shared-footer .footer-bottom {
    margin-top: 30px !important;
    padding-top: 18px !important;
  }

  /* ===================================
     SHOP: COMPACT TWO-COLUMN CARDS
  =================================== */

  body.post-type-archive-product
  .woocommerce ul.products,
  body.woocommerce-shop
  .woocommerce ul.products,
  body.woocommerce-shop
  ul.wc-block-product-template {
    display: grid !important;
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;
    gap: 15px 12px !important;
    align-items: stretch;
  }

  body.woocommerce-shop
  .woocommerce ul.products::before,
  body.woocommerce-shop
  .woocommerce ul.products::after {
    content: none !important;
    display: none !important;
  }

  body.woocommerce-shop
  .woocommerce ul.products li.product,
  body.post-type-archive-product
  .woocommerce ul.products li.product,
  body.woocommerce-shop
  ul.wc-block-product-template > li {
    box-sizing: border-box;
    float: none !important;
    clear: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 10px 9px 15px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Product image */
  body.woocommerce-shop
  .woocommerce ul.products li.product img,
  body.post-type-archive-product
  .woocommerce ul.products li.product img,
  body.woocommerce-shop
  .wc-block-components-product-image img {
    width: 100% !important;
    max-width: 100% !important;
    height: 180px !important;
    object-fit: contain !important;
    object-position: center;
    margin: 0 auto 10px !important;
    border-radius: 12px;
  }

  /* Product names */
  body.woocommerce-shop
  .woocommerce ul.products li.product h2,
  body.woocommerce-shop
  .woocommerce ul.products li.product
  .woocommerce-loop-product__title,
  body.post-type-archive-product
  .woocommerce ul.products li.product
  .woocommerce-loop-product__title,
  body.woocommerce-shop
  .wc-block-components-product-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    letter-spacing: -.25px !important;
    margin: 7px 0 11px !important;
    padding: 0 !important;
    overflow-wrap: anywhere;
  }

  /* Product prices */
  body.woocommerce-shop
  .woocommerce ul.products li.product .price,
  body.post-type-archive-product
  .woocommerce ul.products li.product .price,
  body.woocommerce-shop
  .wc-block-components-product-price {
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
    margin: 0 0 15px !important;
    padding: 0 !important;
  }

  body.woocommerce-shop
  .woocommerce ul.products li.product .price *,
  body.post-type-archive-product
  .woocommerce ul.products li.product .price * {
    font-size: inherit !important;
  }

  /* Buttons */
  body.woocommerce-shop
  .woocommerce ul.products li.product .button,
  body.post-type-archive-product
  .woocommerce ul.products li.product .button,
  body.woocommerce-shop
  .wc-block-components-product-button a {
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    max-width: 170px !important;
    min-height: 38px !important;
    padding: 9px 9px !important;
    margin: auto 0 0 !important;
    border-radius: 30px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    white-space: normal;
    text-align: center;
  }

  /* Results and sorting */
  body.woocommerce-shop
  .woocommerce-result-count {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  body.woocommerce-shop
  .woocommerce-ordering select {
    max-width: 100%;
    font-size: 13px !important;
  }
}

/* Narrow phones */
@media (max-width: 390px) {

  .sbu-shared-footer .footer-grid {
    grid-template-columns:
      minmax(0, 1fr) minmax(0, 1.1fr) !important;
    gap: 16px !important;
  }

  .sbu-shared-footer h3 {
    font-size: 10px !important;
  }

  .sbu-shared-footer a {
    font-size: 11px !important;
  }

  body.woocommerce-shop
  .woocommerce ul.products li.product img {
    height: 150px !important;
  }

  body.woocommerce-shop
  .woocommerce ul.products li.product
  .woocommerce-loop-product__title {
    font-size: 13px !important;
  }

  body.woocommerce-shop
  .woocommerce ul.products li.product .price {
    font-size: 13px !important;
  }

  body.woocommerce-shop
  .woocommerce ul.products li.product .button {
    font-size: 11px !important;
  }
}

/* === SBU MOBILE CART V2 START === */

@media (max-width: 767px) {

  /*
   * WooCommerce Cart Block:
   * Preserve table semantics but present each cart
   * row as a flexible two-column card on phones.
   */

  body.woocommerce-cart .wc-block-cart {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  body.woocommerce-cart
  .wc-block-cart-items {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
  }

  body.woocommerce-cart
  .wc-block-cart-items tbody {
    display: block !important;
    width: 100% !important;
  }

  body.woocommerce-cart
  .wc-block-cart-items
  tr.wc-block-cart-items__row {
    display: grid !important;
    grid-template-columns: 76px minmax(0, 1fr) !important;
    grid-template-areas:
      "photo info"
      "total total" !important;
    gap: 12px 15px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 18px 12px !important;
    margin: 0 0 15px !important;
    border: 1px solid #dce9f1 !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-sizing: border-box !important;
  }

  body.woocommerce-cart
  .wc-block-cart-items
  tr.wc-block-cart-items__row > td {
    display: block !important;
    box-sizing: border-box !important;
    float: none !important;
    position: static !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
  }

  /* Image */
  body.woocommerce-cart
  .wc-block-cart-items
  td.wc-block-cart-item__image {
    grid-area: photo !important;
    align-self: start;
  }

  body.woocommerce-cart
  .wc-block-cart-item__image img {
    display: block !important;
    width: 76px !important;
    max-width: 100% !important;
    height: 90px !important;
    object-fit: contain !important;
    border-radius: 10px;
  }

  /* Product name, unit price, variations and quantity */
  body.woocommerce-cart
  .wc-block-cart-items
  td.wc-block-cart-item__product {
    grid-area: info !important;
    text-align: left !important;
    overflow: visible !important;
  }

  body.woocommerce-cart
  .wc-block-cart-item__wrap {
    display: block !important;
    grid-area: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    text-align: left !important;
  }

  body.woocommerce-cart
  .wc-block-cart-item__wrap
  .wc-block-components-product-name {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    margin: 0 0 8px !important;
  }

  body.woocommerce-cart
  .wc-block-cart-item__prices {
    display: block !important;
    grid-area: auto !important;
    position: static !important;
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 0 9px !important;
    text-align: left !important;
  }

  body.woocommerce-cart
  .wc-block-cart-item__prices
  .wc-block-components-product-price {
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
  }

  body.woocommerce-cart
  .wc-block-components-product-metadata,
  body.woocommerce-cart
  .wc-block-components-product-details {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
    overflow-wrap: break-word !important;
    margin: 5px 0 10px !important;
  }

  body.woocommerce-cart
  .wc-block-components-product-details li {
    margin-bottom: 3px !important;
  }

  /* Quantity selector and remove button */
  body.woocommerce-cart
  .wc-block-cart-item__quantity {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px 0 0 !important;
  }

  body.woocommerce-cart
  .wc-block-components-quantity-selector {
    width: 125px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 40px !important;
    margin: 0 !important;
  }

  body.woocommerce-cart
  .wc-block-cart-item__remove-link {
    position: static !important;
    margin: 0 !important;
    font-size: 12px !important;
  }

  /* Line total below the product details */
  body.woocommerce-cart
  .wc-block-cart-items
  td.wc-block-cart-item__total {
    grid-area: total !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    padding-top: 12px !important;
    border-top: 1px solid #e3ebf2 !important;
    text-align: right !important;
  }

  body.woocommerce-cart
  .wc-block-cart-item__total
  .wc-block-components-product-price {
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
  }

  body.woocommerce-cart
  .wc-block-cart-item__total::before {
    content: "Item total";
    margin-right: auto;
    font-size: 12px;
    font-weight: 600;
    color: #536c7e;
  }

  /* Keep totals and checkout button within the viewport */
  body.woocommerce-cart .wc-block-cart__sidebar,
  body.woocommerce-cart .wc-block-components-sidebar,
  body.woocommerce-cart .wc-block-cart__submit,
  body.woocommerce-cart .wc-block-components-totals-wrapper {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.woocommerce-cart
  .wc-block-cart__submit-button {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 50px !important;
    box-sizing: border-box !important;
    font-size: 15px !important;
  }
}

@media (max-width: 390px) {
  body.woocommerce-cart
  .wc-block-cart-items
  tr.wc-block-cart-items__row {
    grid-template-columns: 65px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 14px 10px !important;
  }

  body.woocommerce-cart
  .wc-block-cart-item__image img {
    width: 65px !important;
    height: 80px !important;
  }

  body.woocommerce-cart
  .wc-block-cart-item__wrap
  .wc-block-components-product-name {
    font-size: 14px !important;
  }
}

/* === SBU MOBILE CART V2 END === */

/* SBU CHECKOUT MOBILE V3 START */

@media (max-width: 767px) {

  /* Keep checkout panels inside phone width */
  body.woocommerce-checkout
  .wc-block-checkout,
  body.woocommerce-checkout
  .wc-block-components-sidebar-layout,
  body.woocommerce-checkout
  .wc-block-components-main,
  body.woocommerce-checkout
  .wc-block-components-sidebar {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Shipping and payment sections */
  body.woocommerce-checkout
  .wc-block-checkout__shipping-option,
  body.woocommerce-checkout
  .wc-block-checkout__payment-method,
  body.woocommerce-checkout
  .wc-block-components-shipping-rates-control,
  body.woocommerce-checkout
  .wc-block-components-payment-methods {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /*
   * WooCommerce radio options:
   * Reserve the left side exclusively for the radio
   * and keep the label out of its way.
   */
  body.woocommerce-checkout
  .wc-block-components-radio-control__option {
    box-sizing: border-box !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 58px !important;
    padding: 13px 12px 13px 46px !important;
    margin: 0 !important;
    white-space: normal !important;
    text-align: left !important;
  }

  /* Actual selectable radio button */
  body.woocommerce-checkout
  .wc-block-components-radio-control__input {
    box-sizing: border-box !important;
    position: absolute !important;
    left: 14px !important;
    top: 20px !important;
    right: auto !important;
    margin: 0 !important;
    transform: none !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    z-index: 2;
  }

  /* Payment / shipping option label */
  body.woocommerce-checkout
  .wc-block-components-radio-control__label {
    box-sizing: border-box !important;
    display: block !important;
    position: static !important;
    float: none !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    text-indent: 0 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
  }

  /* Shipping rate name and price */
  body.woocommerce-checkout
  .wc-block-components-shipping-rates-control__package,
  body.woocommerce-checkout
  .wc-block-components-shipping-rates-control__package-items,
  body.woocommerce-checkout
  .wc-block-components-radio-control__description {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  body.woocommerce-checkout
  .wc-block-components-radio-control__option
  .wc-block-formatted-money-amount {
    font-size: 14px !important;
    white-space: nowrap !important;
  }

  /*
   * Payment option logos:
   * Allow them to shrink or wrap instead of
   * pushing the payment name into the radio.
   */
  body.woocommerce-checkout
  .wc-block-components-payment-method-label,
  body.woocommerce-checkout
  .wc-block-components-radio-control__option
  .wc-block-components-payment-method-label {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
    white-space: normal !important;
  }

  body.woocommerce-checkout
  .wc-block-components-payment-method-label img,
  body.woocommerce-checkout
  .wc-block-components-radio-control__option img {
    max-height: 24px !important;
    max-width: 75px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Space for payment gateway's actual fields */
  body.woocommerce-checkout
  .wc-block-components-radio-control-accordion-content {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 16px 12px !important;
    overflow: visible !important;
  }

  /* Payment fields and gateway iframes */
  body.woocommerce-checkout
  .wc-block-components-radio-control-accordion-content iframe {
    max-width: 100% !important;
  }

  body.woocommerce-checkout
  .wc-block-components-radio-control-accordion-content
  .wc-block-components-text-input {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-bottom: 12px !important;
  }

  /* Don't allow checkout buttons to exceed container */
  body.woocommerce-checkout
  .wc-block-components-checkout-place-order-button {
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-height: 52px !important;
    font-size: 15px !important;
  }
}

@media (max-width: 390px) {

  body.woocommerce-checkout
  .wc-block-components-radio-control__option {
    padding-left: 43px !important;
    padding-right: 9px !important;
  }

  body.woocommerce-checkout
  .wc-block-components-radio-control__input {
    left: 12px !important;
  }

  body.woocommerce-checkout
  .wc-block-components-radio-control__label {
    font-size: 13px !important;
  }
}

/* SBU CHECKOUT MOBILE V3 END */
