/*
 * Narrow tablets cannot accommodate the full category navigation in one row.
 * Use the existing accessible hamburger navigation instead of horizontal overflow.
 */
@media (min-width: 850px) and (max-width: 960px) {
  .gfuk-main-header .gfuk-category-nav { display:none; }
  .gfuk-main-header .gfuk-mobile-menu-btn {
    display:grid;
    place-items:center;
    min-width:44px;
    min-height:44px;
    touch-action:manipulation;
  }
  .gfuk-main-header .gfuk-mobile-menu {
    display:block;
    max-height:calc(100dvh - 120px);
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  .gfuk-main-header .gfuk-mobile-menu a { min-height:44px; }
  .gfuk-main-header .gfuk-mobile-menu .gfuk-mobile-search { max-width:550px; }
  .gfuk-main-header .gfuk-mobile-editable-menu { display:block;list-style:none;padding:0;margin:0; }
  .gfuk-main-header .gfuk-mobile-editable-menu li { list-style:none; }
  .gfuk-main-header .gfuk-mobile-editable-menu > li > a {
    display:block;
    padding:12px 0;
    border-bottom:1px solid #e9ece7;
    text-decoration:none;
    font-weight:700;
  }
  .gfuk-main-header .gfuk-mobile-editable-menu .sub-menu {
    position:static;
    visibility:visible;
    opacity:1;
    transform:none;
    padding:2px 0 10px 20px;
    box-shadow:none;
    border:0;
  }
  .gfuk-main-header .gfuk-mobile-editable-menu .sub-menu a {
    padding:8px 12px;
    min-height:44px;
    display:block;
  }
  .gfuk-main-header .gfuk-mobile-editable-menu ~ a { display:none!important; }
}

/*
 * Shroom Dispensary responsive refinements.
 * Enqueued after the theme's compiled Tailwind CSS so phones and tablets
 * receive reliable layout rules without changing the desktop storefront.
 * Mobile banners default to full, uncropped desktop artwork; the Customizer
 * supports 750x940 phone artwork for each slide.
 */

.gfuk-mobile-banner-caption { display: none; }

@media (max-width: 849px) {
  /* A single mobile banner experience on all phones and small tablets. */
  .gfuk-home .gfuk-reference-feature-section { display: none !important; }
  .gfuk-home .gfuk-mobile-promo-slider {
    display: block !important;
    padding: 10px 0 0;
    background: #fff;
  }
  .gfuk-home .gfuk-mobile-promo-frame {
    position: relative;
    display: block;
    width: min(760px, calc(100% - 24px));
    height: auto !important;
    aspect-ratio: 24 / 11;
    margin: 0 auto;
    background: #f6f4ee;
    overflow: hidden;
    border-radius: 10px;
    isolation: isolate;
  }
  /* Only expand into a portrait frame if every active slide has phone artwork. */
  .gfuk-home .gfuk-mobile-promo-frame.gfuk-mobile-portrait-frame {
    aspect-ratio: 4 / 5;
    max-width: 550px;
  }
  .gfuk-home .gfuk-mobile-promo-slide {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    background: #f6f4ee;
    text-decoration: none;
  }
  .gfuk-home .gfuk-mobile-promo-picture {
    display: block;
    width: 100%;
    height: 100%;
  }
  .gfuk-home .gfuk-mobile-promo-slide img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain !important;
    object-position: center center;
  }
  .gfuk-home .gfuk-mobile-portrait-frame .gfuk-mobile-promo-slide img {
    object-fit: cover !important;
  }
  .gfuk-home .gfuk-mobile-promo-arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    margin: 0;
    width: 44px;
    height: 48px;
    min-width: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: rgba(28, 41, 32, .58);
    color: #fff;
    cursor: pointer;
    text-shadow: none;
    touch-action: manipulation;
  }
  .gfuk-home .gfuk-mobile-promo-arrow svg { display:block; width:24px; height:24px; }
  .gfuk-home .gfuk-mobile-promo-prev { left: 7px; }
  .gfuk-home .gfuk-mobile-promo-next { right: 7px; }
  .gfuk-home .gfuk-mobile-promo-dots {
    position: absolute;
    z-index: 6;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
  }
  .gfuk-home .gfuk-mobile-promo-dots button {
    position: relative;
    width: 40px;
    height: 44px;
    min-width: 40px;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
    touch-action: manipulation;
  }
  .gfuk-home .gfuk-mobile-promo-dots button::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    border: 1.5px solid #fff;
    border-radius: 50%;
    background: rgba(28, 41, 32, .4);
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
  }
  .gfuk-home .gfuk-mobile-promo-dots button.is-active::before {
    background: #fff;
  }
  .gfuk-home .gfuk-mobile-banner-caption {
    width: min(760px, calc(100% - 24px));
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 13px 4px 17px;
    color: #284632;
  }
  .gfuk-mobile-banner-caption > span { font-size: 14px; font-weight: 700; line-height: 1.4; }
  .gfuk-mobile-banner-caption > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 9px 16px;
    border-radius: 9px;
    background: #2e6417;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
    touch-action: manipulation;
  }
  .gfuk-mobile-banner-caption > a svg { width: 16px; height: 16px; }
  .gfuk-home .gfuk-mobile-promo-arrow:focus-visible,
  .gfuk-home .gfuk-mobile-promo-dots button:focus-visible,
  .gfuk-mobile-banner-caption > a:focus-visible {
    outline: 3px solid #d9a01a;
    outline-offset: 3px;
  }

  /* Header controls, navigation and search remain usable at touch sizes. */
  .gfuk-main-header .gfuk-main-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .gfuk-main-header .gfuk-header-icons { flex-shrink: 0; }
  .gfuk-main-header .gfuk-header-icon,
  .gfuk-main-header .gfuk-mobile-menu-btn {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }
  .gfuk-mobile-header-search .gfuk-search { width:100%;max-width:none; }
  .gfuk-mobile-header-search .gfuk-search input {
    width: 100%;
    min-width: 0;
    padding: 0 14px;
    text-align: left;
    font-size: 16px;
  }
  .gfuk-mobile-header-search .gfuk-search button { flex: 0 0 46px; }
  .gfuk-mobile-menu { max-height: calc(100dvh - 115px); overflow-y: auto; }
  .gfuk-mobile-menu a { min-height: 44px; }

  /* Category cards, featured products and checkout should not overflow. */
  .gfuk-container,
  .gfuk-product-grid,
  .gfuk-product-card,
  .gfuk-product-info,
  .gfuk-woo-content,
  .gfuk-single-grid > *,
  .gfuk-contact-form-grid > * {
    min-width: 0;
  }
  .gfuk-category-image-grid,
  .gfuk-product-grid,
  .gfuk-brand-grid,
  .gfuk-review-list-grid {
    max-width: 100%;
  }
  .gfuk-product-title,
  .gfuk-brand-card,
  .gfuk-woo-content,
  .gfuk-prose { overflow-wrap: anywhere; }
  .gfuk-product-card img,
  .gfuk-brand-card img,
  .gfuk-woo-content img { max-width:100%;height:auto; }
  .gfuk-product-gallery .flex-control-thumbs {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .gfuk-footer-payment-icons { justify-content:center;max-width:100%; }
  .gfuk-footer-bottom-inner { flex-wrap:wrap; }
  .gfuk-newsletter-form input[type="email"] { min-width:0; }
  .gfuk-review-gallery { max-width:100%; }
  .gfuk-woo-content .woocommerce-cart-form { max-width:100%;overflow-x:auto; }
  .gfuk-woo-content .woocommerce-cart-form table.shop_table { min-width:460px; }
  .gfuk-woo-content input,
  .gfuk-woo-content select,
  .gfuk-woo-content textarea { max-width:100%; }
  .gfuk-woo-content .wc-block-components-text-input input {
    min-width:0;
  }
}

@media (max-width: 549px) {
  .gfuk-main-header .gfuk-logo,
  .gfuk-main-header .gfuk-logo img { width: min(155px, 100%); }
  .gfuk-utility-reviews { max-width:100%;font-size:11px;line-height:1.35;text-align:center; }
  .gfuk-home .gfuk-mobile-promo-frame,
  .gfuk-home .gfuk-mobile-banner-caption { width:calc(100% - 18px); }
  .gfuk-home .gfuk-mobile-promo-frame { border-radius:7px; }
  .gfuk-home .gfuk-mobile-promo-arrow { width:44px;height:44px; }
  .gfuk-home .gfuk-mobile-promo-prev { left: 4px; }
  .gfuk-home .gfuk-mobile-promo-next { right: 4px; }
  .gfuk-home .gfuk-flower-selection-mobile { padding-top:22px; }
  .gfuk-home .gfuk-flower-selection-head { gap:8px; }
  .gfuk-home .gfuk-flower-selection-head h2 { font-size:clamp(19px,5vw,24px); }
  .gfuk-home .gfuk-flower-selection-head a { font-size:12px;white-space:nowrap; }
  .gfuk-home .gfuk-section-title-row h2 { font-size:clamp(22px,5.6vw,27px); }
  .gfuk-home .gfuk-category-image-grid { gap:12px 10px; }
  .gfuk-home .gfuk-category-image-grid h3 { font-size:12px;line-height:1.35;overflow-wrap:anywhere; }
  .gfuk-home .gfuk-product-grid { gap:14px 9px; }
  .gfuk-home .gfuk-product-info { padding:10px 9px 0; }
  .gfuk-home .gfuk-product-title { font-size:13px;line-height:1.38; }
  .gfuk-home .gfuk-shop-button { min-height:44px; }
  .gfuk-footer-mobile .gfuk-newsletter-form { width:100%; }
  .gfuk-footer-mobile .gfuk-newsletter-form button { padding:0 13px; }
  .gfuk-footer-payment-icons { gap:6px; }
  .gfuk-footer-payment-badge { font-size:10px;padding:5px 8px; }
}

@media (max-width: 380px) {
  .gfuk-home .gfuk-mobile-banner-caption { flex-direction:column;align-items:stretch;gap:8px; }
  .gfuk-mobile-banner-caption > span { text-align:center; }
  .gfuk-mobile-banner-caption > a { width:100%; }
  .gfuk-main-header .gfuk-logo,
  .gfuk-main-header .gfuk-logo img { width:min(136px,100%); }
  .gfuk-home .gfuk-mobile-promo-dots button { width:40px;min-width:40px; }
  .gfuk-home .gfuk-product-grid,
  .gfuk-shop-layout .gfuk-product-grid { gap:12px 8px; }
  .gfuk-woo-content .checkout { gap:14px; }
}

@media (prefers-reduced-motion: reduce) {
  .gfuk-home .gfuk-mobile-promo-slide,
  .gfuk-home .gfuk-mobile-promo-arrow,
  .gfuk-mobile-banner-caption > a { transition:none!important; }
}
