/* ==========================================================================
   Tamland Shared Components (Dropdown, Modals, Forms)
   ========================================================================== */
@import './tokens.css';
@import './tamland-dropdown.css';

html, body {
  max-width: 100%;
  overflow-x: clip;
}

/* ==========================================================================
   Tamland Mobile Bottom Navigation Bar (.tamland-mobile-bottom-nav)
   Harmonized with Figma Node: 4414-96853
   ========================================================================== */
.tamland-mobile-bottom-nav {
  display: none;
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: var(--tamland-z-bottom-nav, 10000);
  background: var(--tamland-color-surface-card);
  border-block-start: 1px solid var(--tamland-color-border-light, var(--tamland-color-border-divider));
  padding-block: var(--tamland-space-8);
  padding-inline: var(--tamland-space-16);
  box-shadow: 0 -0.25rem 0.75rem rgba(0, 0, 0, 0.04);
}

.tamland-mobile-bottom-nav__list {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tamland-mobile-bottom-nav__item {
  flex: 1;
  text-align: center;
}

.tamland-mobile-bottom-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--tamland-space-4);
  text-decoration: none;
  color: var(--tamland-color-text-secondary);
  font-family: var(--tamland-font-family);
  font-size: var(--tamland-font-size-label-sm);
  font-weight: var(--tamland-font-weight-regular);
  padding: var(--tamland-space-4);
  transition: color 150ms ease;
}

.tamland-mobile-bottom-nav__link svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.tamland-mobile-bottom-nav__link--active {
  color: var(--tamland-color-primary);
  font-weight: var(--tamland-font-weight-bold);
  position: relative;
}

.tamland-mobile-bottom-nav__link--active::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 1.5rem;
  height: 2px;
  background-color: var(--tamland-color-primary);
  border-radius: var(--tamland-radius-pill);
}

@media (max-width: 56rem) {
  .tamland-mobile-bottom-nav {
    display: block !important;
    z-index: var(--tamland-z-bottom-nav, 10000) !important;
  }

  body:not(.single-product) {
    padding-bottom: var(--tamland-bottom-nav-height, 5.25rem);
  }

  body:has(.cart-sticky-bar) {
    padding-bottom: calc(var(--tamland-cart-mobile-pb, 6.875rem) + var(--tamland-bottom-nav-height, 5.25rem));
  }

  body:has(.customer-info__mobile-sticky) {
    padding-bottom: calc(var(--tamland-checkout-mobile-pb, 12rem) + var(--tamland-bottom-nav-height, 5.25rem));
  }

  /* Suppress mobile bottom nav on pages with dedicated sticky action bars (Single Product) */
  body.single-product .tamland-mobile-bottom-nav {
    display: none !important;
  }
}

/* ==========================================================================
   Mobile Bottom Navigation Stacking & Loading Defense
   Enforces industry standard: Persistent App Shell chrome sits strictly above
   all document content, footers, in-page loaders, skeletons, and blockUI overlays.
   ========================================================================== */
.sticky-navbar,
.sticky-add-to-cart,
.only_mobile:has(> .sticky-add-to-cart) {
  display: none !important;
}

.blockUI.blockOverlay,
.tamland-loading-overlay,
.tamland-loading,
.tamland-btn-loading,
.tamland-payment-summary-loading,
.tamland-wc-archive__grid-wrap.is-loading .tamland-wc-archive__skeleton,
div:where(.blockUI, .blockOverlay, .wc-block-components-loading-mask, .loading-mask) {
  z-index: var(--tamland-z-loader, 1000) !important;
}

/* ==========================================================================
   WordPress Admin Bar Mobile Defense (#wpadminbar)
   Prevents admin bar from breaking into multiple rows and overlapping headers.
   Page top spacing is handled natively by WordPress core on root <html>.
   ========================================================================== */
@media screen and (max-width: 782px) {
  #wpadminbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: var(--tamland-adminbar-height-mobile, 46px) !important;
    min-height: var(--tamland-adminbar-height-mobile, 46px) !important;
    max-height: var(--tamland-adminbar-height-mobile, 46px) !important;
    overflow: hidden !important;
    z-index: 99999 !important;
  }

  #wpadminbar #wp-toolbar {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
    height: var(--tamland-adminbar-height-mobile, 46px) !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding: 0 !important;
  }

  #wpadminbar #wp-toolbar::-webkit-scrollbar {
    display: none !important;
  }

  #wpadminbar .quicklinks {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
  }

  #wpadminbar .quicklinks > ul {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #wpadminbar .quicklinks > ul > li {
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    height: var(--tamland-adminbar-height-mobile, 46px) !important;
  }

  #wpadminbar .quicklinks > ul > li > a {
    height: var(--tamland-adminbar-height-mobile, 46px) !important;
    line-height: var(--tamland-adminbar-height-mobile, 46px) !important;
  }

  /* Offset sticky mobile elements when admin bar is present */
  body.admin-bar .elementor-location-header,
  body.admin-bar header.site-header {
    top: 0 !important;
  }

  body.admin-bar .tamland-panel-mobile-top,
  body.admin-bar .tamland-courses__mobile-header,
  body.admin-bar .tamland-class-help__mobile-topbar {
    top: calc(var(--tamland-adminbar-height-mobile, 46px) + var(--tamland-root-header-height, var(--tamland-header-height-mobile, 4.5rem))) !important;
  }
}

@media screen and (min-width: 783px) {
  body.admin-bar .elementor-location-header,
  body.admin-bar header.site-header {
    top: 0 !important;
  }

  body.admin-bar .tamland-panel-mobile-top,
  body.admin-bar .tamland-courses__mobile-header,
  body.admin-bar .tamland-class-help__mobile-topbar {
    top: calc(var(--tamland-adminbar-height-desktop, 32px) + var(--tamland-root-header-height, var(--tamland-header-height-tablet, 4.375rem))) !important;
  }
}

/* ==========================================================================
   Header & Mobile Navigation Drawer Layering Defense
   Prevents mobile page headings and bottom navigation from overlapping the drawer
   ========================================================================== */
.elementor-location-header,
header.site-header {
  position: relative;
  z-index: var(--tamland-z-sticky, 20);
}

body.jet-mobile-menu-visible .elementor-location-header,
body:has(.jet-mobile-menu-cover) .elementor-location-header,
body.jet-mobile-menu-visible header.site-header,
body:has(.jet-mobile-menu-cover) header.site-header,
body.jet-mobile-menu-visible .elementor-element-6b03992,
body:has(.jet-mobile-menu-cover) .elementor-element-6b03992 {
  z-index: var(--tamland-z-modal, 10000) !important;
}

body.jet-mobile-menu-visible .jet-mobile-menu__container,
body:has(.jet-mobile-menu-cover) .jet-mobile-menu__container {
  z-index: calc(var(--tamland-z-modal, 10000) + 10) !important;
}

body.jet-mobile-menu-visible .jet-mobile-menu-cover,
body:has(.jet-mobile-menu-cover) .jet-mobile-menu-cover {
  z-index: var(--tamland-z-drawer-backdrop, 9990) !important;
}

body.jet-mobile-menu-visible .tamland-mobile-bottom-nav,
body:has(.jet-mobile-menu-cover) .tamland-mobile-bottom-nav,
body.jet-mobile-menu-visible .tamland-courses__bottom-nav,
body:has(.jet-mobile-menu-cover) .tamland-courses__bottom-nav,
body.tlhm-lock .tamland-mobile-bottom-nav,
body.tlhm-is-open .tamland-mobile-bottom-nav,
body:has(.tlhm.is-open) .tamland-mobile-bottom-nav,
body.tlhm-lock .tamland-courses__bottom-nav,
body.tlhm-is-open .tamland-courses__bottom-nav,
body:has(.tlhm.is-open) .tamland-courses__bottom-nav,
body.tamland-search-drawer-open .tamland-mobile-bottom-nav,
body.tamland-search-drawer-open .tamland-courses__bottom-nav {
  z-index: var(--tamland-z-substicky, 10) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* ==========================================================================
   Mobile Header: Search Icon & Cart Defense
   In mobile version of all pages:
   - Cart icon is strictly hidden (handled by bottom navigation)
   - Only Search icon is displayed in the mobile header action container
   - All properties strictly enforce design tokens
   ========================================================================== */
.tamland-header-search {
  display: none;
}

@media screen and (max-width: 48rem) {
  /* 1. Strictly hide cart icon in mobile header across all pages */
  .elementor-location-header .elementor-widget-woocommerce-menu-cart,
  .elementor-element-6b03992 .elementor-widget-woocommerce-menu-cart,
  .elementor-element-58a085e .elementor-widget-woocommerce-menu-cart,
  .tamland-header .elementor-widget-woocommerce-menu-cart,
  .tamland-header__actions .elementor-widget-woocommerce-menu-cart {
    display: none !important;
  }

  /* 2. Show and style the Search Icon component ONLY inside header */
  .elementor-location-header .tamland-header-search,
  header.site-header .tamland-header-search,
  .elementor-element-6b03992 .tamland-header-search,
  .elementor-element-58a085e .tamland-header-search {
    display: inline-flex !important;
    align-items: center;
    position: relative;
    z-index: var(--tamland-z-base, 1);
  }

  .tamland-header-search__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tamland-space-40, 2.5rem);
    height: var(--tamland-space-40, 2.5rem);
    padding: var(--tamland-space-0, 0);
    border-radius: var(--tamland-radius-8, 0.5rem);
    border: 1px solid var(--tamland-color-border-light, rgba(213, 213, 213, 0.5));
    background: var(--tamland-color-surface-card, #FFFFFF);
    color: var(--tamland-color-text-secondary, #57595B);
    cursor: pointer;
    transition: all 150ms ease;
  }

  .tamland-header-search__btn:hover,
  .tamland-header-search__btn:focus-visible {
    color: var(--tamland-color-primary, #C5161C);
    border-color: var(--tamland-color-primary, #C5161C);
    background: var(--tamland-color-pink-soft-bg, #FCEFEF);
    outline: none;
  }

  .tamland-header-search__btn svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    stroke-width: 2;
  }
}

/* ==========================================================================
   Mobile Header: Back Button on Single Product (Figma Node 3276-111601)
   Replaces hamburger menu exclusively on Single Product pages in mobile view.
   ========================================================================== */
.tamland-header-back-btn {
  display: none;
}

@media screen and (max-width: 48rem) {
  /* 1. Suppress hamburger menu toggles exclusively on single product pages */
  body.single-product .elementor-element-5f79b8f .tlhm__burger,
  body.single-product .elementor-element-5f79b8f .jet-mobile-menu__toggle,
  body.single-product .elementor-element-6b03992 .tlhm__burger,
  body.single-product .elementor-element-6b03992 .jet-mobile-menu__toggle,
  body.single-product .tlhm .tlhm__bar .tlhm__burger,
  body:has(.sp-page) .elementor-element-5f79b8f .tlhm__burger,
  body:has(.sp-page) .elementor-element-5f79b8f .jet-mobile-menu__toggle,
  body:has(.sp-page) .elementor-element-6b03992 .tlhm__burger,
  body:has(.sp-page) .elementor-element-6b03992 .jet-mobile-menu__toggle,
  body:has(.sp-page) .tlhm .tlhm__bar .tlhm__burger {
    display: none !important;
  }

  /* 2. Display and style Back Button in mobile header exclusively on single product */
  body.single-product .tamland-header-back-btn,
  body:has(.sp-page) .tamland-header-back-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: var(--tamland-space-40);
    height: var(--tamland-space-40);
    padding: var(--tamland-space-0);
    border-radius: var(--tamland-radius-8);
    border: 1px solid var(--tamland-color-border-light);
    background: var(--tamland-color-surface-card);
    color: var(--tamland-color-text-primary);
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 150ms ease;
    position: relative;
    z-index: var(--tamland-z-base);
  }

  body.single-product .tamland-header-back-btn:hover,
  body.single-product .tamland-header-back-btn:focus-visible,
  body:has(.sp-page) .tamland-header-back-btn:hover,
  body:has(.sp-page) .tamland-header-back-btn:focus-visible {
    color: var(--tamland-color-primary);
    border-color: var(--tamland-color-primary);
    background: var(--tamland-color-pink-soft-bg);
    outline: none;
  }

  body.single-product .tamland-header-back-btn svg,
  body:has(.sp-page) .tamland-header-back-btn svg {
    width: var(--tamland-space-24);
    height: var(--tamland-space-24);
    stroke: currentColor;
    fill: none !important;
  }

  body.single-product .tamland-header-back-btn svg path,
  body:has(.sp-page) .tamland-header-back-btn svg path {
    stroke: currentColor;
    fill: none !important;
  }
}

@media screen and (min-width: 48.0625rem) {
  .tamland-header-back-btn {
    display: none !important;
  }
}

/* On desktop, hide mobile header search component */
@media screen and (min-width: 48.0625rem) {
  .tamland-header-search {
    display: none !important;
  }
}

/* Lock background scrolling when search popup is open */
html.tamland-search-drawer-open,
body.tamland-search-drawer-open {
  overflow: hidden !important;
  overscroll-behavior: contain !important;
  touch-action: none !important;
}

/* Mobile Search Drawer & Modal Overlay (Universal) - Centered Modal */
.tamland-header-search__drawer {
  position: fixed;
  inset: var(--tamland-space-0, 0);
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: var(--tamland-z-modal, var(--tamland-z-drawer, 10000));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--tamland-space-16, 1rem);
  box-sizing: border-box;
  overscroll-behavior: contain;
}

.tamland-header-search__backdrop {
  position: fixed;
  inset: var(--tamland-space-0, 0);
  background: var(--tamland-overlay-backdrop, rgba(0, 0, 0, 0.5));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--tamland-z-base, 1);
}

.tamland-header-search__dialog {
  position: relative;
  z-index: var(--tamland-z-sticky, 20);
  background: var(--tamland-color-surface-card, #FFFFFF);
  padding: var(--tamland-space-16, 1rem);
  width: 100%;
  max-width: var(--tamland-search-modal-max-w, 26rem);
  border-radius: var(--tamland-radius-16, 1rem);
  box-shadow: var(--tamland-shadow-menu, 0 1rem 2rem rgba(0, 0, 0, 0.08));
  border: var(--tamland-border-width-1, 1px) solid var(--tamland-color-border-light, rgba(213, 213, 213, 0.5));
  box-sizing: border-box;
}

.tamland-header-search__form {
  display: flex;
  align-items: center;
  gap: var(--tamland-space-8, 0.5rem);
  width: 100%;
  direction: rtl;
}

.tamland-header-search__input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  background: var(--tamland-color-surface-muted, #F4F4F5);
  border: 1px solid var(--tamland-color-border-light, rgba(213, 213, 213, 0.5));
  border-radius: var(--tamland-radius-8, 0.5rem);
  padding: var(--tamland-space-0, 0) var(--tamland-space-8, 0.5rem);
  height: var(--tamland-btn-sub-height, 3rem);
}

.tamland-header-search__submit-btn {
  background: none;
  border: none;
  padding: var(--tamland-space-4, 0.25rem);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tamland-color-text-muted, #7E7F83);
  cursor: pointer;
}

.tamland-header-search__input {
  flex: 1;
  background: transparent;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: var(--tamland-font-family);
  font-size: var(--tamland-font-size-body-md, 0.875rem);
  color: var(--tamland-color-text-primary, #202021);
  padding: var(--tamland-space-0, 0) var(--tamland-space-8, 0.5rem);
  direction: rtl;
  text-align: right;
}

.tamland-header-search__close-btn {
  background: none;
  border: none;
  padding: var(--tamland-space-4, 0.25rem);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--tamland-color-text-muted, #7E7F83);
  cursor: pointer;
}

/* ==========================================================================
   Mobile Account Pages Defense: Hide Header & Footer on /my-account
   Enforces dedicated native app UX for profile pages on mobile viewports:
   - Suppresses root site header & footer
   - Aligns sticky profile topbar (.tamland-panel-mobile-top) cleanly to the top
   ========================================================================== */
@media screen and (max-width: 48rem) {
  body.woocommerce-account .elementor-location-header,
  body.woocommerce-account .elementor-sticky__spacer,
  body.woocommerce-account header.site-header,
  body.woocommerce-account [data-elementor-type="header"],
  body.woocommerce-account .elementor-63 {
    display: none !important;
  }

  /* Site Mobile Menu Defense on /my-account: Allow drawer & backdrop to display when menu is opened */
  body.woocommerce-account.tlhm-is-open .elementor-location-header,
  body.woocommerce-account.tlhm-lock .elementor-location-header,
  body.woocommerce-account:has(.tlhm.is-open) .elementor-location-header,
  body.woocommerce-account.tlhm-is-open .elementor-63,
  body.woocommerce-account.tlhm-lock .elementor-63,
  body.woocommerce-account:has(.tlhm.is-open) .elementor-63 {
    display: block !important;
    position: static !important;
    height: var(--tamland-space-0, 0) !important;
    min-height: var(--tamland-space-0, 0) !important;
    max-height: var(--tamland-space-0, 0) !important;
    margin: var(--tamland-space-0, 0) !important;
    padding: var(--tamland-space-0, 0) !important;
    border: none !important;
    overflow: visible !important;
  }

  body.woocommerce-account.tlhm-is-open .elementor-element-6b03992,
  body.woocommerce-account.tlhm-lock .elementor-element-6b03992,
  body.woocommerce-account:has(.tlhm.is-open) .elementor-element-6b03992,
  body.woocommerce-account.tlhm-is-open .elementor-element-6b03992 > .e-con-inner,
  body.woocommerce-account.tlhm-lock .elementor-element-6b03992 > .e-con-inner,
  body.woocommerce-account:has(.tlhm.is-open) .elementor-element-6b03992 > .e-con-inner {
    display: flex !important;
    position: static !important;
    height: var(--tamland-space-0, 0) !important;
    min-height: var(--tamland-space-0, 0) !important;
    max-height: var(--tamland-space-0, 0) !important;
    margin: var(--tamland-space-0, 0) !important;
    padding: var(--tamland-space-0, 0) !important;
    border: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  body.woocommerce-account.tlhm-is-open .elementor-element-6b03992 > *:not(.e-con-inner):not(.elementor-widget-jet-mobile-menu):not(.tlhm),
  body.woocommerce-account.tlhm-lock .elementor-element-6b03992 > *:not(.e-con-inner):not(.elementor-widget-jet-mobile-menu):not(.tlhm),
  body.woocommerce-account:has(.tlhm.is-open) .elementor-element-6b03992 > *:not(.e-con-inner):not(.elementor-widget-jet-mobile-menu):not(.tlhm),
  body.woocommerce-account.tlhm-is-open .e-con-inner > *:not(.elementor-widget-jet-mobile-menu):not(.tlhm),
  body.woocommerce-account.tlhm-lock .e-con-inner > *:not(.elementor-widget-jet-mobile-menu):not(.tlhm),
  body.woocommerce-account:has(.tlhm.is-open) .e-con-inner > *:not(.elementor-widget-jet-mobile-menu):not(.tlhm) {
    display: none !important;
  }

  body.woocommerce-account.tlhm-is-open .tlhm__bar,
  body.woocommerce-account.tlhm-lock .tlhm__bar,
  body.woocommerce-account:has(.tlhm.is-open) .tlhm__bar {
    display: block !important;
    position: static !important;
    height: var(--tamland-space-0, 0) !important;
    min-height: var(--tamland-space-0, 0) !important;
    max-height: var(--tamland-space-0, 0) !important;
    margin: var(--tamland-space-0, 0) !important;
    padding: var(--tamland-space-0, 0) !important;
    border: none !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.woocommerce-account.tlhm-is-open .tlhm__burger,
  body.woocommerce-account.tlhm-lock .tlhm__burger,
  body.woocommerce-account:has(.tlhm.is-open) .tlhm__burger {
    display: none !important;
  }

  body.woocommerce-account .t-footer,
  body.woocommerce-account footer.site-footer,
  body.woocommerce-account footer,
  body.woocommerce-account [data-elementor-type="footer"],
  body.woocommerce-account [data-elementor-type="wp-footer"] {
    display: none !important;
  }

  body.woocommerce-account .tamland-panel-mobile-top,
  body.woocommerce-account .tamland-courses__mobile-header,
  body.woocommerce-account .tamland-class-help__mobile-topbar {
    top: var(--tamland-space-0, 0) !important;
  }

  body.woocommerce-account.admin-bar .tamland-panel-mobile-top,
  body.woocommerce-account.admin-bar .tamland-courses__mobile-header,
  body.woocommerce-account.admin-bar .tamland-class-help__mobile-topbar {
    top: var(--tamland-adminbar-height-mobile, 46px) !important;
  }
}

/* ==========================================================================
   Cart Page Defense: Hide Footer on Cart (Mobile & Desktop)
   Suppresses the website footer across all viewports on WooCommerce cart
   ========================================================================== */
body.woocommerce-cart .t-footer,
body.woocommerce-cart footer.site-footer,
body.woocommerce-cart footer,
body.woocommerce-cart [data-elementor-type="footer"],
body.woocommerce-cart [data-elementor-type="wp-footer"],
body:has(.cart-main) .t-footer,
body:has(.cart-main) footer.site-footer,
body:has(.cart-main) footer,
body:has(.cart-main) [data-elementor-type="footer"],
body:has(.cart-empty) .t-footer,
body:has(.cart-empty) footer.site-footer,
body:has(.cart-empty) footer {
  display: none !important;
}





