/* Fensgarden Mobile Hero & Nav 1.0.2
   Desktop (min-width: 1000px) is unchanged: Homepage Layout 1.0.20 stays as-is.
   All layout changes below apply only at max-width: 999px. */

/* Horizontal merch bar removed on all viewports (user 2026-11-19 annotation). */
.fg-mobile-merch,
#fg-mobile-merch {
  display: none !important;
}

.fg-mobile-offcanvas-merch {
  display: none;
}

@media (min-width: 1000px) {
  .fg-mobile-merch,
  #fg-mobile-merch,
  .fg-mobile-offcanvas-merch {
    display: none !important;
  }
}

@media (max-width: 999px) {
  body.home {
    --fg-header-offset: 112px; /* fallback; script measures the remaining mobile header */
    --fg-art-bar: 17.5rem;
  }

  /* Transparent mobile header overlays the page; start the hero below MENU / logo / search. */
  body.home #main {
    padding-top: var(--fg-header-offset);
  }

  /* Cookie bar must not cover the open MENU drawer. Hide cookie and floating
     buttons while the drawer is open so the last items stay tappable. */
  .cookie-notification {
    z-index: 30;
  }

  #offcanvas.ct-panel {
    z-index: 2147483000 !important;
  }

  #offcanvas .ct-panel-content[data-device="mobile"] {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    max-height: 100%;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }

  body:has(#offcanvas:not([inert])) .cookie-notification,
  body:has(#offcanvas.active) .cookie-notification,
  body:has(#offcanvas[aria-hidden="false"]) .cookie-notification,
  body:has(#offcanvas:not([inert])) .floating-menu.float-menu-1,
  body:has(#offcanvas.active) .floating-menu.float-menu-1,
  body:has(#offcanvas:not([inert])) .xoo-wsc-modal .xoo-wsc-basket,
  body:has(#offcanvas.active) .xoo-wsc-modal .xoo-wsc-basket,
  body:has(#offcanvas:not([inert])) .gtranslate_wrapper,
  body:has(#offcanvas.active) .gtranslate_wrapper {
    display: none !important;
  }

  /* Offcanvas: merchandising categories first, as a clean one-column list.
     Hide the old slogan. Submenus stay collapsed until the parent is opened. */
  .fg-mobile-offcanvas-merch {
    display: none;
  }
  #offcanvas .fg-mobile-offcanvas-merch {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 1.25rem;
    padding: 0 0 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    overflow: visible !important;
    float: none !important;
  }

  #offcanvas .fg-mobile-offcanvas-merch ul.menu,
  #offcanvas .fg-mobile-offcanvas-merch ul.sub-menu {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    columns: 1 !important;
    column-count: 1 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #offcanvas .fg-mobile-offcanvas-merch ul.sub-menu {
    display: none !important;
    padding-left: 0.9rem !important;
  }

  #offcanvas .fg-mobile-offcanvas-merch li.fg-open > ul.sub-menu,
  #offcanvas .fg-mobile-offcanvas-merch li.is-open > ul.sub-menu {
    display: block !important;
  }

  #offcanvas .fg-mobile-offcanvas-merch li {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    margin: 0 !important;
  }

  #offcanvas .fg-mobile-offcanvas-merch a {
    display: block !important;
    color: #fff !important;
    text-decoration: none !important;
    padding: 0.55rem 0 !important;
    font-weight: 600;
    white-space: normal !important;
    line-height: 1.3;
  }

  #offcanvas .fg-mobile-offcanvas-merch .fensgarden-nav-sale > a {
    color: #D52828 !important;
  }

  #offcanvas [data-device="mobile"] .ct-header-text .stk-block-heading__text,
  #offcanvas [data-device="mobile"] .ct-header-text p.stk-block-heading__text {
    display: none;
  }

  /* ---- Homepage hero: first-version mobile images, 1.0.20 copy ----
     Slide 1 fills the first screen under the remaining header, down to
     near the Delivery Guarantee card, leaving room so the cookie bar
     does not cover the title or buttons. */
  body.home .fghp-hero__viewport {
    aspect-ratio: auto;
    height: calc(100svh - var(--fg-header-offset) - 8rem);
    min-height: 26rem;
    max-height: none;
    overflow: hidden;
  }

  /* Slide 1: square first-version porch photo, not the desktop 2.5:1 dining crop. */
  body.home .fghp-hero__slide:not(.fghp-hero__slide--art) {
    background-image: url("https://fensgarden.com/wp-content/uploads/2026/11/01-lifestyle-porch-set-of-2.jpg") !important;
    background-size: cover !important;
    background-position: center 35% !important;
    background-repeat: no-repeat !important;
  }

  body.home .fghp-hero__copy {
    margin-bottom: 1.25rem;
    width: min(var(--fg-max), calc(100% - 2rem));
    padding-right: 5.25rem; /* clear prev/next + dots */
  }

  body.home .fghp-hero__copy h1 {
    font-size: clamp(1.28rem, 5.8vw, 1.6rem);
    max-width: none;
    margin-bottom: 0.55rem;
    line-height: 1.25;
  }

  body.home .fghp-hero__actions {
    gap: 0.5rem;
  }

  body.home .fghp-hero__slide:not(.fghp-hero__slide--art) .fghp-btn {
    font-size: 0.85rem;
    padding: 0.5rem 0.9rem;
  }

  /* Slide 2: original square butterfly-beach photo, same first-screen fill as
     slide 1. Do not use the desktop 1600×520 five-artwork banner on mobile.
     Caption overlays the bottom so the butterfly stays clear. */
  body.home .fghp-hero__slide--art {
    background-image: url("https://fensgarden.com/wp-content/uploads/2025/12/sublimated-towel-white-30x60-beach-66150ae974871.png") !important;
    background-size: cover !important;
    background-position: center 35% !important;
    background-repeat: no-repeat !important;
    background-origin: border-box !important;
    background-clip: border-box !important;
    padding-bottom: 0 !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
  }

  body.home .fghp-hero__slide--art .fghp-hero__overlay--art {
    background: linear-gradient(180deg, rgba(25, 44, 39, 0.06) 42%, rgba(25, 44, 39, 0.72) 100%);
  }

  body.home .fghp-hero__slide--art .fghp-hero__copy--caption {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 auto 1.25rem;
    padding-right: 5.25rem;
    width: min(var(--fg-max), calc(100% - 2rem));
    background: transparent;
  }

  body.home .fghp-hero__slide--art .fghp-hero__caption {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0;
    height: auto;
    background: transparent;
    box-sizing: border-box;
  }

  body.home .fghp-hero__slide--art h2 {
    font-size: clamp(1.28rem, 5.8vw, 1.6rem);
    margin: 0 0 0.35rem;
    color: #fff;
  }

  body.home .fghp-hero__slide--art .fghp-hero__caption-text {
    max-width: none;
  }

  body.home .fghp-hero__slide--art .fghp-hero__caption-text p {
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0.25rem 0 0;
    color: rgba(255, 255, 255, 0.94);
  }

  body.home .fghp-hero__slide--art .fghp-btn {
    margin-top: 0.35rem;
  }
}
