/* Small phones, version 2 (Nov 27-28, 2026). Owner report: Samsung Galaxy J7 class phones
   (360 x 640 CSS px; floor 320 x 568). Layout only: no copy, price, offer or
   tracking changes; every control stays available.
   Linked once by storefront_presentation.polish. Other stylesheets that load
   later style the same components, so selectors carry extra weight.
   The help smiley, the cart drawer and the offer ticker are owned by
   boss-support-smile.css, site-chrome.css and storefront-offers.css and are
   not restyled here. */

/* 1. Short phone screens (up to 700px tall): product pages get their screen
      back. The offer bar scrolls away with the page (the header stays), and
      the purchase bar becomes two short rows: the price with its coupon note,
      then Add to cart and Buy now. Name, gift line and rating are already in
      the product page itself. */
@media (max-width: 767px) and (max-height: 700px) {
  html.boss-product-page body:has(#purchase #main-product-img) > .boss-announcement { position: relative; }
  html.boss-product-page body:has(#purchase #main-product-img) > .boss-announcement + .boss-global-header { top: 0; }
  html.boss-product-page { --boss-mobile-buy-bar-height: 96px; scroll-padding-top: calc(var(--boss-navigation-height, 65px) + 12px); }

  html body #boss-mobile-buy-bar { padding-top: 7px !important; padding-bottom: max(8px, env(safe-area-inset-bottom)) !important; }
  html body #boss-mobile-buy-bar .boss-sticky-buy-inner { gap: 6px 10px; }
  html body #boss-mobile-buy-bar .boss-mobile-buy-summary { display: none; }
  html body #boss-mobile-buy-bar .boss-sticky-buy-price-group {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0 8px;
    min-width: 0;
    min-height: 30px;
  }
  html body #boss-mobile-buy-bar #boss-mobile-buy-price { order: 1; flex: none; font-size: 16px; line-height: 1.2; white-space: nowrap; }
  html body #boss-mobile-buy-bar #boss-mobile-buy-original-price { order: 2; flex: none; font-size: 12px; line-height: 1.2; white-space: nowrap; }
  html body #boss-mobile-buy-bar [data-pdp-base-before-load] { order: 1; flex: none; }
  /* The coupon note keeps its full wording and wraps beside the price. */
  html body #boss-mobile-buy-bar #boss-mobile-buy-price-note {
    order: 3;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    font-size: 12px;
    line-height: 1.25;
    text-align: right;
    text-wrap: balance;
  }
  /* Both buttons keep site-chrome.css sizing (44px tall). */
  html body #boss-mobile-buy-bar .boss-mobile-buy-actions { grid-row: 2; }
}

/* 2. First visit: the cookie card is compact on phones, Accept and Decline
      stay side by side at the same size, and the card is docked where the
      help smiley no longer sits (boss-support-smile.css hides it on phone
      product pages and on every page up to 400px wide): directly on the
      purchase bar, or on the bottom edge of the screen, instead of floating
      80px higher over the page. */
@media (max-width: 480px) {
  html body .boss-cookie-banner { gap: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.4; }
  html body .boss-cookie-banner .boss-cookie-links a + a { margin-left: 8px; }
  html body .boss-cookie-banner .boss-cookie-actions { gap: 6px; }
  html body .boss-cookie-banner .boss-cookie-actions button { min-height: 40px; padding: 6px; font-size: 12.5px; }
}
@media (max-width: 767px) {
  html body.boss-mobile-buy-bar-active .boss-cookie-banner { bottom: calc(var(--boss-mobile-buy-bar-height, 96px) + 6px) !important; }
}
@media (max-width: 400px) {
  html body:not(.boss-mobile-buy-bar-active) .boss-cookie-banner { bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important; }
}

/* 3. While the cookie card is open, the end of every page can still be
      scrolled clear of it (and of the purchase bar on product pages). */
@media (max-width: 767px) {
  /* Pages without a purchase bar, 401-767px: the card keeps its place 80px up. */
  html body:has(.boss-cookie-banner:not([hidden])) { padding-bottom: calc(var(--boss-cookie-banner-height, 130px) + 96px) !important; }
  html body.boss-mobile-buy-bar-active:has(.boss-cookie-banner:not([hidden])) {
    padding-bottom: calc(var(--boss-mobile-buy-bar-height, 96px) + var(--boss-cookie-banner-height, 130px) + 22px) !important;
  }
}
@media (max-width: 400px) {
  html body:not(.boss-mobile-buy-bar-active):has(.boss-cookie-banner:not([hidden])) {
    padding-bottom: calc(var(--boss-cookie-banner-height, 130px) + 24px) !important;
  }
}

/* 4. Finger-sized links in today's buy box reassurance list, the A5 "Request
      a quote" link and breadcrumbs (they were 17-21px tall). */
@media (max-width: 480px) {
  html body .boss-buy-assurance ul { gap: 0 14px; }
  html body .boss-buy-assurance li { min-height: 32px; align-items: center; }
  html body .boss-buy-assurance a { display: inline-block; padding-block: 6px; }
  /* Taller touch area, same line height and position. */
  html body nav.breadcrumbs a,
  html body nav.seo-breadcrumbs a,
  html body .boss-team-block p > a { display: inline-block; padding-block: 11px; margin-block: -11px; }
}

/* 5. Article shop card (seo-journeys.css): on the narrowest phones the text
      column beside the photo was 149px wide, so the card stacks instead. */
@media (max-width: 400px) {
  html body .seo-shop-card { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  html body .seo-shop-card__actions a { display: inline-block; padding-block: 11px; margin-block: -11px; }
}
