/* Responsive refinements for sections rendered by HomePageOne. */
@media (max-width: 575px) {
  .offer .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .offer .offer-card {
    min-height: 190px;
    height: auto !important;
    gap: 12px !important;
    padding: 14px !important;
  }

  .gn-product-card-wrap {
    width: min(260px, calc(100vw - 40px));
  }
}

@media (max-width: 380px) {
  .offer .offer-card {
    align-items: flex-start !important;
  }

  .gn-product-card-wrap {
    width: calc(100vw - 32px);
  }
}

/* Mobile layout fixes for the shared customer header and homepage sections. */
.customer-homepage,
.customer-homepage > * { min-width: 0; max-width: 100%; }

@media (max-width: 767px) {
  .customer-homepage .feature-section-header { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .customer-homepage .feature-main-subtitle { font-size: 12px; line-height: 1.45; }
  .customer-homepage .feature-view-all { font-size: 11px; }
  .customer-homepage .offer .container,
  .customer-homepage .container.container-lg { max-width: 100%; }
  .customer-homepage .gn-delivery-section { padding: 28px 0; }

  .customer-homepage .feature-collection-icon {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    padding: 0;
    background: #f3f8f4;
  }

  .customer-homepage .feature-collection-icon img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center;
    border-radius: inherit;
  }
}

@media (max-width: 576px) {
  .gh-header .gh-header-main-row { gap: 8px !important; }
  .gh-header .gh-logo-wrap { gap: 7px; padding: 6px 8px; border-radius: 11px; }
  .gh-header .gh-logo-icon { width: 30px; height: 30px; font-size: 16px; }
  .gh-header .gh-logo-name { font-size: 16px; }
  .gh-header .gh-logo-name span { font-size: 13px; }
  .gh-header .gh-logo-tagline { display: none; }
  .gh-header .gh-mobile-actions { flex: 0 0 auto; gap: 1px !important; }
  .gh-header .gh-mobile-actions .gh-action-btn { width: 32px; height: 36px; font-size: 19px; }
  .gh-header .gh-mobile-actions > button:last-child { font-size: 24px !important; margin-left: 0 !important; padding: 0 2px; }
  .gh-header .gh-mobile-actions .gh-badge { top: 0; right: 0; min-width: 15px; height: 15px; font-size: 8px; }

  .customer-homepage .gn-banner-slide,
  .customer-homepage .gn-banner-image-link {
    height: auto;
    max-height: none;
    aspect-ratio: 8 / 3;
  }
  .customer-homepage .gn-banner-slide {
    height: auto;
    max-height: none;
    aspect-ratio: 8 / 3;
  }
  .customer-homepage .gn-banner-image {
    height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center;
    position: relative;
    top: 1px;
  }
  .customer-homepage .feature-collections-container { padding-left: 16px; padding-right: 16px; }
  .customer-homepage .feature-main-title { font-size: clamp(22px, 6vw, 26px); }
  .customer-homepage .feature-main-subtitle { font-size: 11px; }
  .customer-homepage .feature-view-all { font-size: 10px; }
  .customer-homepage .offer .offer-card { min-height: 180px; padding: 14px !important; }
  .customer-homepage .gn-product-card-wrap { width: min(260px, calc(100vw - 32px)); }
  .customer-homepage .gn-delivery-section > .container { padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 360px) {
  .gh-header .gh-header-main-row { gap: 5px !important; }
  .gh-header .gh-logo-wrap { gap: 5px; padding: 5px 6px; }
  .gh-header .gh-logo-name { font-size: 14px; }
  .gh-header .gh-logo-name span { font-size: 12px; }
  .gh-header .gh-logo-icon { width: 27px; height: 27px; }
  .gh-header .gh-mobile-actions .gh-action-btn { width: 29px; }
  .gh-header .gh-mobile-actions > button:last-child { font-size: 22px !important; }
  .customer-homepage .feature-main-title { font-size: 21px; }
  .customer-homepage .feature-main-subtitle { font-size: 10px; }
  .customer-homepage .gn-product-card-wrap { width: calc(100vw - 24px); }
}
/* Preserve touch gestures on homepage product sliders. */
@media (max-width: 768px) {
  .customer-homepage .organic-food__slider,
  .customer-homepage .organic-food__slider .slick-slider,
  .customer-homepage .organic-food__slider .slick-list {
    touch-action: pan-y;
  }
  .customer-homepage .organic-food__slider .slick-list {
    -webkit-user-select: none;
    user-select: none;
  }
}

@media (max-width: 768px) {
  .customer-homepage .organic-food__slider .slick-list { cursor: grab; }
  .customer-homepage .organic-food__slider .slick-list:active { cursor: grabbing; }
}

/* Render homepage category products as a two-column grid on phones. */
@media (max-width: 767px) {
  /* Portrait product tiles make customer catalog imagery fill mobile cards like a fashion listing. */
  .shop .gn-product-card-thumb,
  .customer-homepage .gn-product-card-thumb {
    height: auto;
    aspect-ratio: 3 / 4;
    background: #fff;
  }

  .shop .gn-product-card-thumb > a,
  .customer-homepage .gn-product-card-thumb > a {
    box-sizing: border-box;
    padding: 5px;
    overflow: hidden;
  }

  .shop .gn-product-card-thumb .gn-product-img,
  .customer-homepage .gn-product-card-thumb .gn-product-img {
    object-fit: cover;
    object-position: center top;
    background: transparent;
    border-radius: 8px;
  }

  .customer-homepage .gn-home-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .customer-homepage .gn-home-product-grid > .gn-product-card-wrap {
    width: 100% !important;
    min-width: 0;
    height: 100%;
    padding: 4px 0;
  }

  .customer-homepage .gn-home-product-grid .gn-product-card {
    min-width: 0;
    padding: 7px;
  }

  .customer-homepage .gn-home-product-grid .gn-product-card-thumb {
    height: auto;
  }

  .customer-homepage .gn-home-product-grid .gn-product-content {
    min-width: 0;
    padding: 7px 1px 2px;
  }

  .customer-homepage .gn-home-product-grid .gn-product-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 14px;
  }

  .customer-homepage .gn-home-product-grid .gn-product-rating-row {
    flex-wrap: wrap;
  }

  .customer-homepage .gn-home-product-grid .gn-product-desc {
    -webkit-line-clamp: 2;
  }

  .customer-homepage .gn-home-product-grid .gn-product-bottom-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px;
  }

  .customer-homepage .gn-home-product-grid .gn-product-sale-price { font-size: 16px; }
  .customer-homepage .gn-home-product-grid .gn-product-cart-btn { padding: 6px 9px; font-size: 10px; }
}

/* Keep MenuProductSection product imagery portrait and full-bleed on tablet and desktop too. */
@media (min-width: 768px) {
  .customer-homepage .organic-food__slider .gn-product-card-thumb {
    height: auto;
    aspect-ratio: 3 / 4;
    background: #fff;
  }

  .customer-homepage .organic-food__slider .gn-product-img {
    object-fit: cover;
    object-position: center top;
    background: transparent;
    border-radius: 8px;
  }
}

/* Manual, infinitely looping Shop By Collections carousel. */
.customer-homepage .feature-section-header {
  column-gap: 12px;
}

.customer-homepage .feature-collections-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.customer-homepage .feature-carousel-arrow {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #dce9df;
  border-radius: 50%;
  background: #fff;
  color: #075744;
  cursor: pointer;
  font-size: 16px;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.customer-homepage .feature-carousel-arrow svg {
  display: block;
  width: 18px;
  height: 18px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.customer-homepage .feature-carousel-arrow--previous:hover {
  transform: translateX(-3px);
}

.customer-homepage .feature-carousel-arrow--next:hover {
  transform: translateX(3px);
}

.customer-homepage .feature-carousel-arrow:hover {
  border-color: #075744;
  background: #075744;
  color: #fff;
  box-shadow: 0 4px 10px rgba(7, 87, 68, .2);
}

.customer-homepage .feature-carousel-arrow:focus-visible {
  outline: 2px solid #d99720;
  outline-offset: 2px;
}

.customer-homepage .feature-carousel-arrow:disabled {
  cursor: default;
  opacity: .45;
}

.customer-homepage .feature-collections-carousel {
  min-width: 0;
  max-width: 680px;
  margin: 0;
}

.customer-homepage .feature-collections-carousel .slick-list {
  overflow: hidden;
  touch-action: pan-y;
}

.customer-homepage .feature-collections-carousel .slick-track {
  display: flex;
  align-items: flex-start;
}

.customer-homepage .feature-collections-carousel .slick-slide {
  height: auto;
  margin: 0;
  padding: 2px 5px 10px;
  box-sizing: border-box;
}

.customer-homepage .feature-collections-carousel .slick-slide > div {
  height: auto;
}

.customer-homepage .feature-collections-carousel .feature-collection-item {
  width: 100%;
  height: 100%;
  display: flex !important;
}

.customer-homepage .feature-collections-carousel .feature-collection-item .feature-collection-name {
  align-self: center;
  width: 100%;
  margin-inline: auto;
  text-align: center;
}

.customer-homepage .feature-collections-carousel .feature-item-line {
  align-self: center;
  margin-inline: auto;
}

@media (max-width: 767px) {
  .customer-homepage .feature-collections-carousel {
    max-width: none;
  }

  .customer-homepage .feature-section-header {
    flex-wrap: wrap;
    align-items: flex-end;
    row-gap: 8px;
  }

  .customer-homepage .feature-collections-header-actions {
    gap: 6px;
  }

  .customer-homepage .feature-carousel-arrow {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 14px;
  }

  .customer-homepage .feature-carousel-arrow svg { width: 17px; height: 17px; }

  .customer-homepage .feature-collections-carousel { margin-right: -3px; margin-left: -3px; }
  .customer-homepage .feature-collections-carousel .slick-slide { padding-right: 3px; padding-left: 3px; }
}
