/* MarketKit 4.1 — scoped shopping UX enhancements.
   Leaves ATIIE logo, banners, product cards, vendor views, and 4.0.4 cart tile intact. */
@layer marketkit-storefront {
  body.mk-shell {
    --mk41-teal: #087c82;
    --mk41-teal-dark: #065d63;
    --mk41-line: #dcebed;
  }
  /* Accessible product / category search. The original header height is unchanged. */
  body.mk-shell .mk-search[data-mk41-search] { position: relative; isolation: isolate; }
  body.mk-shell .mk-search[data-mk41-search] .mk-search-results:not([hidden]) {
    display: block !important;
    width: 100% !important;
    max-height: min(65vh, 475px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 120 !important;
    border: 1px solid var(--mk41-line) !important;
    border-radius: 15px !important;
    padding: 7px !important;
    box-shadow: 0 18px 40px rgba(15, 66, 74, .15) !important;
    background: #fff !important;
  }
  body.mk-shell .mk-search[data-mk41-search] .mk41-search-heading {
    color: #5a7780;
    font-size: 11px;
    font-weight: 800;
    padding: 10px 10px 5px;
    line-height: 1.5;
  }
  body.mk-shell .mk-search[data-mk41-search] .mk41-search-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 3px 8px 7px;
  }
  body.mk-shell .mk-search[data-mk41-search] .mk41-category-result {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 10px;
    background: #eff9f8;
    color: #076b72 !important;
    border: 1px solid #d7eeeb;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
  }
  body.mk-shell .mk-search[data-mk41-search] .mk41-category-result:is(:hover, :focus-visible) {
    background: #dff3f0;
    border-color: #9fd5cf;
  }
  body.mk-shell .mk-search[data-mk41-search] .mk41-product-result {
    padding: 9px 10px !important;
    border-radius: 10px !important;
    border-bottom: 1px solid #eef2f4 !important;
    min-height: 68px;
    color: #203e47;
    text-decoration: none !important;
  }
  body.mk-shell .mk-search[data-mk41-search] .mk41-product-result:is(:hover, :focus-visible) {
    background: #f2faf9 !important;
  }
  body.mk-shell .mk-search[data-mk41-search] .mk41-product-result img {
    width: 48px !important;
    height: 48px !important;
    object-fit: contain !important;
    border-radius: 8px;
    background: #f7faf9;
  }
  body.mk-shell .mk-search[data-mk41-search] .mk41-product-result small { color: #0a747a; }
  body.mk-shell .mk-search[data-mk41-search] .mk41-search-all {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 39px;
    padding: 9px 12px;
    margin: 7px 5px 3px;
    border-radius: 10px;
    background: var(--mk41-teal);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 800;
  }
  body.mk-shell .mk-search[data-mk41-search] .mk41-search-all:is(:hover, :focus-visible) {
    background: var(--mk41-teal-dark);
  }

  /* Product page: small, clear shortcuts to *existing* product detail tabs. */
  body.mk-shell .mk-pdp.mk-reference-pdp .mk41-product-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 9px;
    width: 100%;
    margin: 16px 0 20px;
    padding: 11px 13px;
    border-radius: 14px;
    background: #f7fbfb;
    border: 1px solid #e4eeee;
    box-sizing: border-box;
  }
  body.mk-shell .mk-pdp.mk-reference-pdp .mk41-product-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 37px;
    padding: 8px 15px;
    border: 1px solid #d1e6e5;
    border-radius: 999px;
    background: #fff;
    color: #0b636b;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: none;
    white-space: nowrap;
  }
  body.mk-shell .mk-pdp.mk-reference-pdp .mk41-product-nav-link:is(:hover, :focus-visible) {
    background: #e8f6f4;
    border-color: #a5d7d2;
  }
  body.mk-shell .mk-pdp .mk-gallery-stage.mk41-swipe-gallery { touch-action: pan-y pinch-zoom; }
  body.mk-shell .mk41-gallery-hint { display: none; }
  body.mk-shell .mk-pdp .mk-gallery-thumbs { scroll-padding-inline: 10px; }
  body.mk-shell .mk-pdp .mk-pdp-details,
  body.mk-shell .mk-pdp .mk-pdp-gallery,
  body.mk-shell .mk-pdp #mk-buybox { scroll-margin-top: 170px; }

  @media (max-width: 767px) {
    body.mk-shell .mk-search[data-mk41-search] .mk-search-results:not([hidden]) {
      max-height: min(56dvh, 420px) !important;
      border-radius: 13px !important;
    }
    body.mk-shell .mk-pdp.mk-reference-pdp .mk41-product-nav {
      flex-wrap: nowrap !important;
      overflow-x: auto !important;
      overscroll-behavior-inline: contain;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      gap: 8px;
      padding: 9px 10px;
      margin: 12px 0 15px;
      max-width: 100%;
    }
    body.mk-shell .mk41-product-nav::-webkit-scrollbar { display: none; }
    body.mk-shell .mk-pdp.mk-reference-pdp .mk41-product-nav-link {
      flex: 0 0 auto;
      min-height: 40px;
      font-size: 12px;
      padding: 8px 12px;
    }
    /* Gallery thumbnails scroll within their box, never widen the page. */
    body.mk-shell .mk-pdp .mk-gallery-thumbs {
      display: flex !important;
      flex-wrap: nowrap !important;
      justify-content: flex-start !important;
      gap: 9px !important;
      max-width: 100% !important;
      overflow-x: auto !important;
      overflow-y: hidden !important;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-inline: contain;
      scroll-snap-type: x proximity;
      padding: 7px 5px !important;
    }
    body.mk-shell .mk-pdp .mk-gallery-thumbs .mk-gallery-thumb {
      flex: 0 0 64px !important;
      width: 64px !important;
      min-width: 64px !important;
      scroll-snap-align: start;
    }
    body.mk-shell .mk-pdp .mk-gallery-stage.mk41-swipe-gallery .mk41-gallery-hint {
      position: absolute;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      inset-inline-start: 50%;
      bottom: 13px;
      transform: translateX(50%);
      pointer-events: none;
      padding: 5px 10px;
      border: 1px solid #d7e9e9;
      border-radius: 999px;
      background: rgba(255, 255, 255, .92);
      color: #26646b;
      font-size: 10px;
      font-weight: 700;
      line-height: 1.4;
      white-space: nowrap;
      z-index: 2;
    }
    body:not(.rtl).mk-shell .mk-pdp .mk-gallery-stage.mk41-swipe-gallery .mk41-gallery-hint {
      transform: translateX(-50%);
    }
    body.mk-shell .mk-pdp .mk-pdp-details,
    body.mk-shell .mk-pdp .mk-pdp-gallery,
    body.mk-shell .mk-pdp #mk-buybox { scroll-margin-top: 130px; }
    body.mk-shell .mk-pdp .mk-detail-tablist {
      max-width: 100% !important;
      overflow-x: auto !important;
      overflow-y: hidden !important;
      flex-wrap: nowrap !important;
      overscroll-behavior-inline: contain;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    body.mk-shell .mk-pdp .mk-detail-tablist [data-mk-tab] {
      flex: 0 0 auto;
      min-height: 45px !important;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    body.mk-shell .mk-pdp .mk41-product-nav-link,
    body.mk-shell .mk-search[data-mk41-search] :is(.mk41-category-result,.mk41-search-all) {
      transition: none !important;
    }
  }
}
