/* Hummingbird 7LASER customizations v1.0.5.2 */

/* --- Desktop >=1200px: search centered in the top bar ---
   Below 1200px the search stays in its original place (header-bottom row), so the top bar
   keeps the original Hummingbird layout and can never overlap on tablets. */
.header-top__search { display: none; }
@media (min-width: 1200px) {
  .header-top .row {
    display: grid;
    /* side columns are never narrower than their content (no wrapping/overlap); search takes what is left */
    grid-template-columns: minmax(max-content, 1fr) minmax(9rem, 22rem) minmax(max-content, 1fr);
    column-gap: 1rem;
    align-items: center;
  }
  .header-top__left,
  .header-top__right { width: auto; max-width: none; min-width: 0; flex-wrap: nowrap; white-space: nowrap; }
  .header-top__left { justify-content: flex-start; }
  .header-top__right { justify-content: flex-end; }
  .header-top__search { min-width: 0; display: flex; justify-content: center; align-items: center; }
  .header-top__search #_desktop_ps_searchbar {
    display: flex !important; width: 100%; max-width: 22rem; margin: 0; padding: 0;
  }
  .header-top__search #ps_searchbar,
  .header-top__search .ps-searchbar__form { width: 100%; }
  .header-top__search .ps-searchbar { margin-block: 0; min-width: 0; width: 100%; }
  .header-top__search .ps-searchbar__dropdown {
    left: 50%; right: auto; transform: translateX(-50%); max-width: 30rem;
  }
}

/* --- Desktop menu: dropdown sized to its content and always kept inside the screen ---
   Width/height limits come from hummingbird7laser-1.0.5.2.js (CSS variables below);
   the calc() values are only a fallback if the script has not run yet. */
@media (min-width: 1200px) {
  .ps-mainmenu.ps-mainmenu--desktop .ps-mainmenu__tree > li.ps-mainmenu__tree-item--fit {
    position: relative;
  }
  .ps-mainmenu.ps-mainmenu--desktop .ps-mainmenu__tree > li.ps-mainmenu__tree-item--fit > .submenu {
    left: 0;                 /* the script shifts it left if it would leave the screen */
    right: auto;
    top: 100% !important;    /* theme JS sets an inline top for the full-width menu */
    width: max-content;
    min-width: 14rem;
    max-width: var(--h7l-submenu-max-w, calc(100vw - 3rem));
    max-height: var(--h7l-submenu-max-h, calc(100vh - 10rem));
    overflow-x: hidden;
    overflow-y: auto;        /* inner scroll when there are too many items for the screen height */
    overscroll-behavior: contain;
    border: .0625rem solid var(--bs-border-color);
    border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
  }
  .submenu--compact .container,
  .submenu--columns .container { width: auto; max-width: none; padding: 0; }
  .submenu--compact .submenu__row,
  .submenu--columns .submenu__row { display: block; margin: 0; --bs-gutter-x: 0; }

  /* 2 levels: simple list; with many items it flows into 2, 3 or 4 columns */
  .submenu--compact .submenu__left { width: 100%; max-width: none; padding: .5rem; border-right: 0; }
  .submenu--compact .submenu__right { display: none; }
  .submenu--compact .submenu__left:has(> :nth-child(9))  { display: block; column-count: 2; column-width: 12rem; column-gap: 1rem; }
  .submenu--compact .submenu__left:has(> :nth-child(17)) { column-count: 3; }
  .submenu--compact .submenu__left:has(> :nth-child(25)) { column-count: 4; }
  .submenu--compact .submenu__left > .submenu__left-item {
    break-inside: avoid;
    overflow-wrap: anywhere;
  }
  .submenu--compact .submenu__left:has(> :nth-child(9)) > .submenu__left-item { margin-bottom: .25rem; }

  /* 3+ levels: one column per subcategory; columns wrap onto new rows when the screen is narrow */
  .submenu__columns {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
  }
  .submenu__column {
    flex: 0 0 13rem;         /* same width for every column so rows line up */
    width: 13rem;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .submenu__column-title {
    display: block;
    font-weight: 600;
    font-size: 1.0625rem;
    color: var(--bs-body-color);
    text-decoration: none;
  }
  .submenu__column-title:hover { color: var(--bs-link-hover-color); }
  .submenu__column-list,
  .submenu__column-sublist { list-style: none; margin: 0; padding: 0; }
  .submenu__column-list { margin-top: .5rem; display: flex; flex-direction: column; gap: .375rem; }
  .submenu__column-list .menu-item { color: var(--bs-body-color); text-decoration: none; }
  .submenu__column-list .menu-item:hover { color: var(--bs-link-hover-color); }
  .submenu__column-sublist { margin-top: .25rem; padding-inline-start: .75rem; }
}

/* --- Product page (v1.0.5): description right under the photo, guarantees right under the buy box ---
   product.tpl now has ONE grid (.product__container--cols) with three children:
     .product__left        photo + thumbnails
     .product__right-col   .product__right (buy box) + .product__bottom-right (guarantees)
     .product__bottom-left description / details / downloads accordion
   Desktop: photo and description share column 1, the buy box column 2 spans both rows, so no row is
   stretched by the (taller) buy box and there is no blank gap under the photo. Row 2 is the flexible
   one (1fr): items spanning a flexible track do not size the "auto" row 1.
   Below 992px it is one column: photo, buy box, description, guarantees (same order as before). */
@media (min-width: 992px) {
  .product__container--cols { grid-template-rows: auto 1fr; }
  .product__container--cols > .product__left { grid-column: 1; grid-row: 1; min-width: 0; align-self: start; }
  .product__container--cols > .product__bottom-left { grid-column: 1; grid-row: 2; min-width: 0; align-self: start; }
  .product__container--cols > .product__right-col { grid-column: 2; grid-row: 1 / span 2; min-width: 0; align-self: start; }
  .product__container--cols .product__bottom-right { margin-block: 1.5rem 0; }
}
@media (max-width: 991.98px) {
  .product__container--cols { display: flex; flex-direction: column; }
  .product__container--cols > .product__right-col { display: contents; }
  .product__container--cols > .product__left { order: 1; }
  .product__container--cols .product__right { order: 2; }
  .product__container--cols > .product__bottom-left { order: 3; margin-block-start: 1.5rem; }
  .product__container--cols .product__bottom-right { order: 4; margin-block-start: 1.5rem; }
}

/* --- v1.0.5.1 (+ Stripe error fix in 1.0.5.2) Product page, mobile/tablet (<992px):
   less space between the buy box and the description ---
   .product__additional-info (hook displayProductAdditionalInfo) is a flex column with gap (theme.css).
   Besides share buttons and the review button, stripe_official prints there an "&nbsp;" text node and
   three placeholder divs (#stripe-express-checkout-element, #stripe-error-message,
   #payment-method-messaging-element) that are normally empty: each one added a gap (and the &nbsp; a
   text line). Fix: no gap; spacing via margin only between items; the express checkout and messaging
   placeholders are hidden ONLY while they have no element inside (Stripe inserts its iframe/elements
   there and then they show again); the stray text is shrunk with font-size 0 on the container.
   #stripe-error-message is NEVER hidden (Stripe may write the error as plain text): it only loses its
   top margin while empty (an empty div has no height). Desktop unchanged. */
@media (max-width: 991.98px) {
  .page-product .product__additional-info { gap: 0; font-size: 0; }
  .page-product .product__additional-info > * { font-size: 1rem; }
  .page-product .product__additional-info > * + * { margin-block-start: 1rem; }
  .page-product .product__additional-info > #stripe-express-checkout-element:not(:has(*)),
  .page-product .product__additional-info > #payment-method-messaging-element:not(:has(*)) { display: none; }
  .page-product .product__additional-info > #stripe-error-message { margin-block-start: 0; }
  .page-product .product__additional-info > #stripe-error-message:has(*) { margin-block-start: 1rem; }
  .page-product .product__actions { margin-block-end: 0; }
  .product__container--cols > .product__bottom-left { margin-block-start: 1.5rem; }
}

/* --- v1.0.5.2 Product images ---
   1) Arrows of the main carousel always visible (all widths): round white button with shadow,
      40px, instead of the theme's 35% opacity small square.
   2) Mobile/tablet (<992px): thumbnails in ONE horizontal row that scrolls with the finger
      (~5.5 visible so it is clear there are more); the active one is scrolled into view by
      hummingbird7laser-1.0.5.2.js. Counter "3 / 24" below the main photo (created by the JS,
      only when there are 2+ images). Desktop thumbnails grid unchanged.
   Swipe on the main photo: see the JS (Bootstrap carousel instance created on page load). */
.page-product .product__carousel .carousel-control-prev,
.page-product .product__carousel .carousel-control-next {
  opacity: 1;
  width: auto;
  padding-inline: .5rem;
}
.page-product .product__carousel .carousel-control-prev-icon,
.page-product .product__carousel .carousel-control-next-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  transition: background-color .15s ease, box-shadow .15s ease;
}
.page-product .product__carousel .carousel-control-prev-icon::before,
.page-product .product__carousel .carousel-control-next-icon::before { font-size: 24px; }
.page-product .product__carousel .carousel-control-prev:hover .carousel-control-prev-icon,
.page-product .product__carousel .carousel-control-next:hover .carousel-control-next-icon,
.page-product .product__carousel .carousel-control-prev:focus-visible .carousel-control-prev-icon,
.page-product .product__carousel .carousel-control-next:focus-visible .carousel-control-next-icon {
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.page-product .h7l-carousel-counter { display: none; }

@media (max-width: 991.98px) {
  .page-product .h7l-carousel-counter {
    display: block;
    margin-block-start: .5rem;
    text-align: center;
    font-size: .8125rem;
    line-height: 1.25;
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
  }
  .page-product .h7l-carousel-counter + .product__thumbnails { margin-block-start: .5rem; }
  .page-product .product__thumbnails-list {
    --h7l-thumb-gap: .5rem;
    position: relative;
    display: flex;
    gap: var(--h7l-thumb-gap);
    margin: 0;
    padding: 0 0 .25rem;
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .page-product .product__thumbnails-list::-webkit-scrollbar { display: none; }
  .page-product .product__thumbnails-item {
    flex: 0 0 calc((100% - 5 * var(--h7l-thumb-gap)) / 5.5);
    min-width: 0;
    scroll-snap-align: start;
  }
}
