/*
 * HMNB compact gift card header banner (Nov 2026).
 * Server: public_html/store/themes/hmnbcheckout/assets/css/giftcard-header.css
 * Loaded by the .hmnb-gch block in templates/_partials/header.tpl (not on
 * cart / checkout / order / order-confirmation). Every rule is scoped to
 * .hmnb-gch, or to #ttr_header_inner only when it contains .hmnb-gch.
 *
 * Desktop/tablet (>=768px): sits in the navy strip between the logo and the
 *   "Holiday Shop / Free shipping" promo, under Call us / Sign in / Cart.
 * Phones (<=767px): centered under the logo and the Call us row, above the
 *   string lights; the strip grows by the banner's height.
 * Image: 640x240 (2x). Shown at 320/280/200-240px wide (desktop/laptop/tablet),
 *   min(300px, 90vw) on phones.
 */
#ttr_header_inner .hmnb-gch {
  position: absolute;
  z-index: 504;
  line-height: 0;
  margin: 0;
  padding: 0;
}

#ttr_header_inner .hmnb-gch .hmnb-gch__link {
  display: block;
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#ttr_header_inner .hmnb-gch .hmnb-gch__link:hover,
#ttr_header_inner .hmnb-gch .hmnb-gch__link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

#ttr_header_inner .hmnb-gch .hmnb-gch__link:focus-visible {
  outline: 2px solid #C9A227;
  outline-offset: 2px;
}

#ttr_header_inner .hmnb-gch .hmnb-gch__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  border: 0;
}

/* >=1200px: logo ends at 236px, links start at 250px, promo starts ~600px+. */
@media only screen and (min-width: 1200px) {
  #ttr_header_inner .hmnb-gch {
    left: 250px;
    top: 126px;
    width: 320px;
    transform: translateY(-50%);
  }
}

/* 992-1199px: promo starts at ~558-606px. */
@media only screen and (min-width: 992px) and (max-width: 1199px) {
  #ttr_header_inner .hmnb-gch {
    left: 250px;
    top: 126px;
    width: 280px;
    transform: translateY(-50%);
  }
}

/* 768-991px: logo is 200px wide, links start at 210px, promo starts ~562px. */
@media only screen and (min-width: 768px) and (max-width: 991px) {
  #ttr_header_inner .hmnb-gch {
    left: 212px;
    top: 124px;
    width: clamp(200px, 26vw, 240px);
    transform: translateY(-50%);
  }
}

/* Phones: logo (0-164px) and Call us row (168-192px) are absolutely placed
   in a fixed-height strip. Put the banner under them and grow the strip by
   the banner height so the string lights stay at the bottom edge. */
@media only screen and (max-width: 767px) {
  #ttr_header_inner .hmnb-gch {
    left: 50%;
    top: 202px;
    width: min(300px, 90vw);
    transform: translateX(-50%);
  }

  header#ttr_header #ttr_header_inner:has(> .hmnb-gch),
  header #ttr_header_inner:has(> .hmnb-gch) {
    height: calc(226px + min(300px, 90vw) * 0.375) !important;
  }
}

/* Browsers without :has() cannot grow the phone strip, so hide the banner
   there rather than let it cover the string lights. */
@supports not selector(:has(*)) {
  @media only screen and (max-width: 767px) {
    #ttr_header_inner .hmnb-gch {
      display: none;
    }
  }
}
