/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme
 Author:       XTemos
 Author URI:   http://xtemos.com
 Template:     woodmart
 Version:      1.0.0
 Text Domain:  woodmart
*/
@media screen and (max-width: 900px) {
  .woocommerce .woocommerce-cart-form table.shop_table td {
    border: none !important;
    padding: 8px 0 !important;
  }


  .woocommerce table.shop_table td.product-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    text-align: left !important;
    margin-bottom: 24px;
  }

  .woocommerce .actions .coupon {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .woocommerce .actions .coupon input {
    margin: 0 !important;
    width: 100% !important;
  }
}

/* Fluid Checkout coupon codes in standalone section (outside payment step) */
body.theme-woodmart.woocommerce-checkout .fc-coupon-standalone-section {
  margin: 0 0 14px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

body.theme-woodmart.woocommerce-checkout .fc-coupon-standalone-section .fc-coupon-standalone-inner>[data-substep-id="coupon_codes"] {
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body.theme-woodmart.woocommerce-checkout .fc-coupon-standalone-section .fc-step__substep-title {
  padding: 14px 16px 0;
}

body.theme-woodmart.woocommerce-checkout .fc-coupon-standalone-section .fc-step__substep-fields,
body.theme-woodmart.woocommerce-checkout .fc-coupon-standalone-section .fc-step__substep-fields-inner {
  padding: 12px 16px 16px !important;
}

/* Always show coupon field + apply button (do not require "Add coupon code" click) */
body.theme-woodmart.woocommerce-checkout .fc-coupon-standalone-section [data-collapsible].is-collapsed>.collapsible-content__inner {
  display: block !important;
}

body.theme-woodmart.woocommerce-checkout .fc-coupon-standalone-section .expansible-section__toggle-plus,
body.theme-woodmart.woocommerce-checkout .fc-coupon-standalone-section [data-collapsible-handler] {
  display: none !important;
}

/* Keep coupon button text exactly as entered (no uppercase transform) */
body.theme-woodmart.woocommerce-checkout .fc-coupon-standalone-section .fc-coupon-code__apply,
body.theme-woodmart.woocommerce-checkout .fc-coupon-standalone-section button,
body.theme-woodmart.woocommerce-checkout .fc-coupon-standalone-section .button {
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* Fluid Checkout - improve State/City dropdown visual quality (billing + shipping) */
body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-billing-fields .select2-container,
body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-shipping-fields .select2-container {
  width: 100% !important;
}

body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-billing-fields .select2-container .select2-selection--single,
body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-shipping-fields .select2-container .select2-selection--single {
  height: 46px !important;
  min-height: 46px !important;
  border: 1px solid #d9dee5 !important;
  border-radius: 8px !important;
  background: #fff !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-billing-fields .select2-container .select2-selection--single .select2-selection__rendered,
body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-shipping-fields .select2-container .select2-selection--single .select2-selection__rendered {
  height: 44px !important;
  line-height: 44px !important;
  padding: 0 42px 0 14px !important;
  color: #242424 !important;
  font-size: 14px !important;
}

body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-billing-fields .select2-container .select2-selection--single .select2-selection__arrow,
body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-shipping-fields .select2-container .select2-selection--single .select2-selection__arrow {
  right: 12px !important;
  height: 44px !important;
  width: 18px !important;
}

body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-billing-fields .select2-container--open .select2-selection--single,
body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-shipping-fields .select2-container--open .select2-selection--single,
body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-billing-fields .select2-container--focus .select2-selection--single,
body.theme-woodmart.woocommerce-checkout .fc-wrapper .woocommerce-shipping-fields .select2-container--focus .select2-selection--single {
  border-color: #1A62AB !important;
  box-shadow: 0 0 0 3px rgba(26, 98, 171, 0.14) !important;
}

body.theme-woodmart .select2-dropdown {
  border: 1px solid #d9dee5 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.12) !important;
}

body.theme-woodmart .select2-search--dropdown {
  padding: 10px !important;
  background: #f8fafc !important;
}

body.theme-woodmart .select2-search--dropdown .select2-search__field {
  height: 38px !important;
  border: 1px solid #d9dee5 !important;
  border-radius: 8px !important;
  padding: 0 10px !important;
}

body.theme-woodmart .select2-results__option {
  padding: 10px 12px !important;
  font-size: 14px !important;
}

body.theme-woodmart .select2-results__option--highlighted[aria-selected] {
  background: #eef5fc !important;
  color: #123c63 !important;
}

body.theme-woodmart .select2-results__option[aria-selected="true"] {
  background: #1A62AB !important;
  color: #fff !important;
}

/* Checkout order summary quantity control - reuse the Woodmart default
   `.quantity` look (same as the WC-B2IO mobile-cart module). Only the
   outer wrapper layout is tweaked; the +/- buttons inherit the theme style. */
body.theme-woodmart.woocommerce-checkout .fc-wrapper #order_review .cart-item__quantity-control {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
}

body.theme-woodmart.woocommerce-checkout .fc-wrapper #order_review .cart-item__quantity-control .quantity {
  margin: 0;
}

/*
 * Hide the native browser number-input spinner arrows so only the Woodmart
 * `.minus` / `.plus` buttons are the single way to change the quantity.
 * Woodmart's woo-mod-quantity style already does this, but these rules
 * guarantee it even if that stylesheet fails to load.
 */
body.theme-woodmart.woocommerce-checkout .fc-wrapper #order_review .cart-item__quantity-control input.qty::-webkit-outer-spin-button,
body.theme-woodmart.woocommerce-checkout .fc-wrapper #order_review .cart-item__quantity-control input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body.theme-woodmart.woocommerce-checkout .fc-wrapper #order_review .cart-item__quantity-control input.qty {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Woolentor checkout shipping methods: method left, price/FREE right */
body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 .woolentor-checkout__shipping-method table,
body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 .woolentor-checkout__shipping-method tbody,
body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 .woolentor-checkout__shipping-method tr,
body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 .woolentor-checkout__shipping-method td {
  display: block;
  width: 100%;
}

body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 .woolentor-checkout__shipping-method th {
  display: none;
}

body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul#shipping_method,
body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul.woocommerce-shipping-methods {
  width: 100%;
  margin: 0;
}

body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul#shipping_method li,
body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul.woocommerce-shipping-methods li {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul#shipping_method li input.shipping_method,
body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul.woocommerce-shipping-methods li input.shipping_method {
  flex: 0 0 auto;
  margin: 0;
}

body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul#shipping_method li label,
body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul.woocommerce-shipping-methods li label {
  display: flex !important;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  min-width: 0;
  margin: 0;
  text-align: left;
}

body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul#shipping_method li label .woocommerce-Price-amount,
body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul.woocommerce-shipping-methods li label .woocommerce-Price-amount,
body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 .b2io-checkout-shipping-free {
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 .b2io-checkout-shipping-free {
  color: #16833a;
  font-weight: 700;
}

body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul#shipping_method li label .woolentor-desc,
body.theme-woodmart.woocommerce-checkout .woolentor-shipping-method-1 ul.woocommerce-shipping-methods li label .woolentor-desc {
  flex: 0 0 100%;
  margin-left: 0;
}

/* Variable product "Select options" modal on product loops */
body.b2io-select-options-modal-open {
  overflow: hidden;
}

.b2io-select-options-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
}

.b2io-select-options-modal.is-open {
  display: block;
}

.b2io-select-options-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 26, 36, 0.58);
}

.b2io-select-options-modal__dialog {
  position: relative;
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  margin: 14px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
  overflow: auto;
}

.b2io-select-options-modal__close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f2f5f9;
  color: #3b4450;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.b2io-select-options-modal__content {
  padding: 18px;
}

.b2io-select-options-modal__layout {
  display: grid;
  grid-template-columns: minmax(280px, 42%) minmax(0, 58%);
  gap: 22px;
  align-items: start;
}

.b2io-select-options-modal__left img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

.b2io-select-options-modal__name {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.3;
  color: #1f2937;
}

.b2io-select-options-modal__price {
  margin-bottom: 14px;
  font-size: 20px;
}

.b2io-select-options-modal .variations {
  margin-bottom: 12px;
}

.b2io-select-options-modal .single_variation_wrap {
  margin-top: 10px;
}

.b2io-select-options-modal__loading,
.b2io-select-options-modal__error {
  padding: 28px 18px;
  text-align: center;
  color: #3f4957;
  font-size: 15px;
}

.b2io-select-options-modal__message {
  margin-top: 10px;
  color: #1A62AB;
  font-size: 14px;
}

@media (max-width: 800px) {
  .b2io-select-options-modal__layout {
    grid-template-columns: 1fr;
  }
}

/* Header Builder custom element: Search/Menu */
.wd-header-search-menu {
  width: 100%;
  max-width: 100%;
}

.wd-header-search-menu__inner {
  width: calc(100% - var(--wd-searchmenu-margin-left, 0px) - var(--wd-searchmenu-margin-right, 0px));
  max-width: var(--wd-searchmenu-boxed-width, 1222px);
  padding-left: var(--wd-searchmenu-side-padding, 15px);
  padding-right: var(--wd-searchmenu-side-padding, 15px);
  margin-top: var(--wd-searchmenu-margin-top, 0px);
  margin-bottom: var(--wd-searchmenu-margin-bottom, 0px);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.wd-header-search-menu__search {
  width: 100%;
  max-width: var(--wd-searchmenu-search-max-width, 1222px);
}

.wd-header-search-menu__search .wd-search-form {
  width: 100%;
}

.wd-header-search-menu__menu {
  width: 100%;
  margin-top: var(--wd-searchmenu-menu-top-margin, 10px);
  margin-bottom: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.wd-header-search-menu__menu .wd-nav {
  justify-content: flex-start;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0;
  padding-bottom: 0;
}

/* Header layout fixes for Search/Menu element alignment and spacing */
.whb-column11 .wd-header-main-nav {
  margin-left: 0 !important;
}

header.whb-header .whb-main-header .container {
  padding-top: 1px;
  padding-bottom: 1px;
}

header.whb-header .whb-main-header .wd-header-main-nav,
header.whb-header .whb-main-header .wd-search-form,
header.whb-header .whb-main-header .wd-header-text,
header.whb-header .whb-main-header .wd-tools-element,
header.whb-header .whb-main-header .site-logo {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}


header.whb-header {
  z-index: 399;
}


body.admin-bar header.whb-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar header.whb-header {
    top: 46px;
  }
}

/* Force mobile layout ONLY for General header rows (up to 1024px).
   Top header (.whb-top-bar) and bottom header (.whb-header-bottom)
   retain Woodmart's default responsive behaviour. */
@media (max-width: 1024px) {
  .whb-general-header .whb-row.whb-hidden-desktop {
    display: block !important;
  }
  .whb-general-header .whb-column.whb-hidden-desktop,
  .whb-general-header .whb-flex-row.whb-hidden-desktop {
    display: flex !important;
  }
  .whb-general-header .wd-tools-element.whb-hidden-desktop,
  .whb-general-header .wd-nav.whb-hidden-desktop {
    display: inline-flex !important;
  }
  .whb-general-header .whb-hidden-mobile {
    display: none !important;
  }
}

/* Force desktop layout for General header rows only (1025px and up) */
@media (min-width: 1025px) {
  .whb-general-header .whb-hidden-desktop {
    display: none !important;
  }
  .whb-general-header .whb-row.whb-hidden-mobile {
    display: block !important;
  }
  .whb-general-header .whb-column.whb-hidden-mobile,
  .whb-general-header .whb-flex-row.whb-hidden-mobile {
    display: flex !important;
  }
}


/* Prevent parent overflow-x from breaking position:sticky in Safari & Firefox */
.website-wrapper {
  overflow: clip !important;
}

/*
 * 3. Dropdown menus: ensure correct z-index and rendering on iOS Safari.
 *    iOS Safari can clip fixed/absolute elements inside overflow:hidden
 *    ancestors — explicitly reset here.
 */
header.whb-header .wd-dropdown,
header.whb-header .wd-dropdown-menu,
header.whb-header .wd-sub-menu {
  -webkit-overflow-scrolling: touch;
  /* iOS momentum scrolling in deep menus */
  overscroll-behavior: contain;
}

/*
 * 4. Mobile / tablet (≤ 1024px): fix full-width layout edge cases.
 *    Use box-sizing instead of !important width overrides where possible.
 */
@media (max-width: 1024px) {
  header.whb-header .whb-flex-row {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  header.whb-header .whb-mobile-left,
  header.whb-header .whb-mobile-right,
  header.whb-header .whb-col-mobile {
    min-width: 0;
    box-sizing: border-box;
  }

  header.whb-header .wd-header-search-menu__inner {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: min(var(--wd-searchmenu-side-padding, 15px), 15px);
    padding-right: min(var(--wd-searchmenu-side-padding, 15px), 15px);
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/*
 * 5. iOS Safari: prevent content jumping when the URL bar hides/shows.
 *    Use dvh (dynamic viewport height) with fallback to --wd-viewport-h
 *    set by header-browser-fixes.js.
 */
@supports (height: 1dvh) {
  header.whb-header {
    /* If full-screen/overlap mode, constrain to dynamic viewport */
    max-height: 100dvh;
  }
}

/*
 * 6. Firefox: prevent layout flash on back/forward navigation.
 *    @-moz-document is deprecated — use @supports to target Gecko.
 *    (position:-moz-sticky never existed; just ensure standard sticky works)
 */
@supports (-moz-appearance: none) {

  header.whb-header.whb-sticky-prepared,
  header.whb-header.whb-sticked {
    position: sticky;
  }
}

/*
 * 7. Ensure mobile nav panel is fully scrollable on iOS.
 */
.wd-side-panel,
.wd-nav-mobile {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Product image/color swatches: keep the actual swatch surface at 30px. */
[class*="wd-swatches"] .wd-swatch.wd-bg {
  --wd-swatch-size: 30px !important;
  --wd-swatch-w: 30px !important;
  --wd-swatch-h: 30px !important;
}
