/*
 * Compatibility guard for the owner bicycle shops.
 *
 * Some Samsung Internet/WebView builds can briefly retain the desktop product
 * grid while evaluating the shop's larger responsive stylesheet. That leaves
 * the product-information column only a few characters wide. Keep the header,
 * product columns and Black Friday gift picker viewport-bound without relying
 * on container queries.
 */

@media (max-width: 900px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .kgl-product-page,
  .kgl-product-top,
  .kgl-product-gallery,
  .kgl-product-info {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .kgl-product-page {
    margin-inline: 0 !important;
    padding-inline: 0 !important;
  }

  .kgl-product-top {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .kgl-product-gallery,
  .kgl-product-info {
    position: static !important;
    inset: auto !important;
  }

  .kgl-site-header {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: 44px minmax(0, 1fr) auto !important;
    overflow: visible !important;
  }

  .kgl-site-nav {
    display: none !important;
  }

  .kgl-site-logo {
    min-width: 0 !important;
    max-width: min(44vw, 170px) !important;
    justify-self: center !important;
  }

  .kgl-site-logo img {
    display: block !important;
    max-width: 100% !important;
    object-fit: contain !important;
  }

  .kgl-header-actions {
    min-width: 0 !important;
    max-width: 104px !important;
  }

  .kgl-bf-offer {
    container-type: normal !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .kgl-bf-banner,
  .kgl-bf-gifts,
  .kgl-bf-head,
  .kgl-bf-head > div,
  .kgl-bf-choices,
  .kgl-bf-choice {
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .kgl-bf-banner {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .kgl-bf-title {
    align-self: flex-start !important;
    max-width: 100% !important;
  }

  .kgl-bf-countdown {
    flex-wrap: wrap !important;
    justify-content: space-between !important;
  }

  .kgl-bf-time {
    max-width: 100% !important;
  }

  .kgl-bf-head h2,
  .kgl-bf-head p,
  .kgl-bf-note,
  .kgl-bf-choice strong {
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
}

@media (max-width: 419px) {
  .kgl-bf-choices {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 7px !important;
  }

  .kgl-bf-choices > .kgl-bf-choice,
  .kgl-bf-choices > .kgl-bf-choice.is-selected {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    min-height: 68px !important;
    padding: 6px 34px 6px 6px !important;
    text-align: left !important;
  }

  .kgl-bf-choices > .kgl-bf-choice.is-selected {
    padding: 5px 33px 5px 5px !important;
  }

  .kgl-bf-choice img {
    width: 64px !important;
    height: 54px !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
  }

  .kgl-bf-choice strong {
    width: auto !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
  }

  .kgl-bf-choice input {
    top: 50% !important;
    right: 10px !important;
    width: 18px !important;
    height: 18px !important;
    transform: translateY(-50%) !important;
  }
}

@supports not (overflow: clip) {
  @media (max-width: 900px) {
    html,
    body {
      overflow-x: hidden;
    }
  }
}
