/* =========================================================
   Collection page specific styles
   ========================================================= */

.category-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  margin-top: 20px;
}


.category-pill {
  background: none;
  border: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.category-pill img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.category-pill span {
  font-size: 14px;
  font-weight: 500;
  max-width: 90px;
  line-height: 1.25;
}

.category-pill:hover img,
.category-pill.is-active img {
  border-color: var(--green-mid);
  transform: translateY(-3px);
}

/* Category section: full-width rounded banner image with the heading +
   lead overlaid on its empty left side, then the product cards below. */
.category-section {
  margin-top: 90px;
}

.category-banner {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 28px;
  margin: 0 0 40px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  aspect-ratio: 1800 / 350;
  min-height: 170px;
}

.category-banner .banner-text {
  max-width: 58%;
  padding: 30px clamp(24px, 3.5vw, 64px);
  color: #fff;
}

.category-banner .section-title {
  color: #fff;
  font-size: clamp(22px, 2.2vw, 38px);
  margin-bottom: 14px;
}

.category-banner .section-lead {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(14px, 1.15vw, 19px);
  line-height: 1.55;
  margin: 0;
  max-width: 640px;
}

@media (max-width: 700px) {
  .category-banner {
    aspect-ratio: auto;
    background-position: right center;
  }

  .category-banner .banner-text {
    max-width: 100%;
    padding: 24px 20px;
    background: linear-gradient(90deg, rgba(59, 31, 12, 0.92) 55%, rgba(59, 31, 12, 0.55));
    border-radius: 28px;
  }
}

.banner--groundnut {
  background-image: url("../../srivi_assets/collection_page_assets/collection_banners/Artboard 1.jpg");
}

.banner--mustard {
  background-image: url("../../Collection page assets/Collection banners/Artboard 2.jpg");
}

.banner--coconut {
  background-image: url("../../Collection page assets/Collection banners/Artboard 3.jpg");
}

.banner--sesame {
  background-image: url("../../Collection page assets/Collection banners/Artboard 4.jpg");
}

.banner--safflower-sunflower {
  background-image: url("../../Collection page assets/Collection banners/Artboard 5.jpg");
}

.banner--castor {
  background-image: url("../../Collection page assets/Collection banners/Artboard 6.jpg");
}

.category-section .product-grid {
  margin-bottom: 10px;
}

.category-section:last-of-type {
  margin-bottom: 40px;
}

.category-pill img {
  width: 90px;
  height: 90px;
}
/* =========================================================
   Mobile fixes. NOTE: this file loads AFTER style.css, so the
   unqualified .category-pill img / .category-section rules above
   override style.css at every width — the mobile overrides must
   therefore live here too.
   ========================================================= */
@media (max-width: 700px) {
  .category-strip {
    gap: 16px 12px;
  }

  .category-pill img {
    width: 60px;
    height: 60px;
    border-width: 2px;
  }

  .category-pill span {
    font-size: 12px;
    max-width: 74px;
  }

  .category-section {
    margin-top: 48px;
  }

  .category-banner {
    margin-bottom: 24px;
    border-radius: 18px;
    min-height: 150px;
  }

  .category-banner .banner-text {
    border-radius: 18px;
  }

  .category-banner .section-title {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .category-banner .section-lead {
    font-size: 13.5px;
  }
}

@media (max-width: 420px) {
  .category-pill img {
    width: 52px;
    height: 52px;
  }

  .category-pill span {
    font-size: 11px;
    max-width: 66px;
  }
}

/* Single in-place collection result area. These rules intentionally override
   the older all-category-sections layout above. */
.collections-categories { padding-bottom: 52px; background: #fff; }
.collections-categories .section-title { margin-bottom: 28px; }
.category-strip { gap: 24px; }
.category-pill { width: 100px; padding: 0; transition: color .2s ease; }
.category-pill img { width: 88px; height: 88px; border: 3px solid transparent; box-shadow: 0 2px 7px rgba(1, 96, 40, .12); }
.category-pill span { min-height: 34px; display: flex; align-items: flex-start; justify-content: center; font-weight: 600; }
.category-pill:hover, .category-pill:focus-visible, .category-pill.is-active { color: var(--green-deep); }
.category-pill:hover img, .category-pill:focus-visible img, .category-pill.is-active img { border-color: var(--green-mid); box-shadow: 0 5px 14px rgba(1, 96, 40, .24); transform: translateY(-3px); }
.category-pill:focus-visible { outline: 2px solid var(--green-mid); outline-offset: 5px; border-radius: 10px; }

.collection-results { min-height: 460px; padding-top: 62px; }
/* .category-section's own margin-top (90px base / 72px-48px scoped to the
   static list below) is meant to separate consecutive sections in that
   list. When a category is promoted up here, .collection-results' own
   padding-top already provides the same top spacing as the default "All
   Oils" view, so that extra margin would just stack on top of it. */
.collection-results .category-section { margin-top: 0; }
.collection-results__description { margin-bottom: 38px; }
.collection-results__feature:empty { display: none; }
.category-banner { width: 100%; min-height: 220px; margin: 0 0 34px; border-radius: 22px; background-position: center; background-repeat: no-repeat; background-size: cover; overflow: hidden; }
.collection-results__grid { position: relative; transition: opacity .18s ease; }
.collection-results.is-loading .collection-results__grid,
.collection-results.is-loading .collection-results__feature,
.collection-results.is-loading [data-collection-title],
.collection-results.is-loading [data-collection-description] { opacity: .42; pointer-events: none; }
.collection-results.is-loading .collection-results__grid::after { content: "Updating collection…"; position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; min-height: 180px; color: var(--green-deep); font-size: 16px; font-weight: 700; background: rgba(250, 250, 250, .76); }
.collection-results__empty { grid-column: 1 / -1; min-height: 160px; margin: 0; display: grid; place-items: center; border: 1px dashed #b9cdbd; border-radius: var(--radius-md); color: #4d5b51; font-size: 17px; background: #fff; }
.collection-category-details { padding-top: 20px; background: #fff; }
.collection-category-details .category-section { margin-top: 72px; }
.collection-category-details .category-section:first-child { margin-top: 0; }
.category-section__description { margin-bottom: 28px; }
.collection-category-details .category-banner__description { max-width: 52%; text-align: left; }
.collection-category-details .category-banner__description .section-lead { font-size: clamp(16px, 1.3vw, 21px); }
.category-section__description--mobile { display: none; }
.category-section__description--mobile .section-title { color: var(--ink); }
.category-section__description--mobile .section-lead { color: inherit; }

@media (max-width: 900px) {
  .category-strip { gap: 20px 16px; }
  .category-pill { width: 86px; }
  .category-pill img { width: 72px; height: 72px; }
  .category-pill span { font-size: 13px; }
  .collection-results { padding-top: 52px; }
  .category-banner { min-height: 180px; }
  .collection-category-details .category-section { margin-top: 58px; }
}

@media (max-width: 700px) {
  .collections-categories { padding: 40px 0 34px; }
  .collections-categories .section-title { margin-bottom: 22px; font-size: 25px; }
  .category-strip { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 2px 4px 9px; margin: 0 -4px; }
  .category-pill { flex: 0 0 70px; width: 70px; gap: 7px; }
  .category-pill img { width: 58px; height: 58px; border-width: 2px; }
  .category-pill span { min-height: 30px; font-size: 10.5px; line-height: 1.18; }
  .collection-results { padding: 44px 0 56px; min-height: 380px; }
  .collection-results .container--wide { padding: 0 16px; }
  .collection-results .section-title { font-size: 24px; margin-bottom: 10px; }
  .collection-results__description { margin-bottom: 24px; font-size: 14px; line-height: 1.45; }
  .category-banner { min-height: 124px; margin-bottom: 22px; border-radius: 15px; background-position: center; }
  /* Same design as desktop: title + description sit ON the banner (white text over the image).
     The banner is no longer the thin 1800:350 strip, so the text fits; the image covers it. */
  .collection-results .category-banner,
  .collection-category-details .category-banner {
    width: 100%;
    max-width: 100%;
    min-height: 170px;
    aspect-ratio: auto;
    margin-left: 0;
    margin-right: 0;
    background-size: cover;
    background-position: center;
  }
  /* Category's dedicated mobile banner, when it has one (see snippets/collection-detail.liquid). */
  /* Mobile banner is authored at 4:3 (800x600 min, 1200x900 recommended, 1600x1200 max), so the box is
     exactly 4:3 and the image fills it edge to edge: nothing is cropped or letterboxed. The text sits
     in the left column, vertically centred, like desktop, so the bottle on the right is never covered. */
  .collection-results .category-banner[data-has-mobile-banner],
  .collection-category-details .category-banner[data-has-mobile-banner] {
    background-image: var(--banner-m) !important;
    aspect-ratio: 4 / 3;
    min-height: 0;
    border-radius: 18px;
    align-items: center;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
  }
  .collection-results .category-banner[data-has-mobile-banner] .category-banner__description,
  .collection-category-details .category-banner[data-has-mobile-banner] .category-banner__description {
    position: static; /* title is positioned against the banner itself */
    z-index: 1;
    background: none;
    /* Full banner width so the title can be centred across the whole banner; the description below
       is kept to the left 58% column exactly as before. */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* Bottom padding is larger than the top, which lifts the whole text block a little above the vertical centre. */
    padding: 14px 14px 35px;
  }
  .collection-results .category-banner[data-has-mobile-banner] .category-banner__description .section-title,
  .collection-category-details .category-banner[data-has-mobile-banner] .category-banner__description .section-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    /* Pinned to the top of the banner, centred across its full width. The description keeps its own
       position (it reserves this title's height via margin-top below). */
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    z-index: 2;
    box-sizing: border-box;
    padding: 0 14px;
    text-align: center;
    color: #000;
    text-shadow: none;
  }
  .collection-results .category-banner[data-has-mobile-banner] .category-banner__description .section-lead,
  .collection-category-details .category-banner[data-has-mobile-banner] .category-banner__description .section-lead {
    font-size: 10px;
    margin-top: 21px; /* the space the title used to take, so the description does not move */
    font-weight: 500;
    line-height: 1.35;
    color: #000;
    /* Left column, 66% of the banner minus the 14px left padding. */
    width: calc(66% - 14px);
    max-width: calc(66% - 14px);
    text-align: left;
    /* The column is narrower than the full-width layout; clamp so a long description cannot spill past the banner. */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;
    overflow: hidden;
  }
  .collection-category-details { padding-top: 0; }
  .collection-category-details .category-section { margin-top: 48px; }
  .collection-category-details .section-title { font-size: 23px; margin-bottom: 9px; }
  .category-section__description { margin-bottom: 20px; font-size: 13.5px; line-height: 1.45; }
  /* The title/description now render on the banner, exactly like desktop (this also covers the
     promoted article moved into .collection-results when a pill is clicked). The separate
     "above the banner" copy is hidden so the text is not shown twice. */
  .collection-category-details .category-banner__description,
  .collection-results .category-banner__description {
    display: block;
    max-width: 100%;
    width: 100%;
    padding: 18px 16px;
    text-align: left;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 70%, rgba(0, 0, 0, 0) 100%);
  }
  .collection-category-details .category-banner__description .section-title,
  .collection-results .category-banner__description .section-title { color: #fff; font-size: 20px; margin-bottom: 6px; }
  .collection-category-details .category-banner__description .section-lead,
  .collection-results .category-banner__description .section-lead { color: rgba(255, 255, 255, 0.92); font-size: 12.5px; line-height: 1.45; max-width: 100%; }
  .category-section__description--mobile { display: none; }
  .collection-results__grid { gap: 14px 10px; }
  .collection-results__empty { min-height: 120px; padding: 18px; font-size: 14px; text-align: center; }

  /* Collections follow the Figma two-card mobile grid; the shared theme
     falls back to one card below 420px, so override it for this page only. */
  .collection-results .product-card,
  .collection-category-details .product-card { padding: 10px; border-radius: 10px; }
  .collection-results .product-card img,
  .collection-category-details .product-card img { height: auto; margin-bottom: 10px; }
  .collection-results .product-card h3,
  .collection-category-details .product-card h3 { min-height: 2.6em; font-size: 12px; line-height: 1.3; }
  .collection-results .price-row,
  .collection-category-details .price-row { gap: 6px; margin: 7px 0 10px; }
  .collection-results .price,
  .collection-category-details .price { font-size: 13px; }
  .collection-results .price--old,
  .collection-category-details .price--old { font-size: 11px; }
  .collection-results .add-to-cart,
  .collection-category-details .add-to-cart { width: 100%; min-height: 34px; justify-content: center; padding: 8px 6px; font-size: 11px; gap: 5px; }
}

.collection-category-details .category-banner--empty{background:var(--green-deep,#016028)}


/* Collections hero carousel: every slide carries the title plus two copy
   paragraphs. Sized with vw so the authored <br> lines (<= ~62 characters)
   fit the 45%-wide content column and the whole block stays inside the
   banner. Mobile (<=700px) keeps the shared home.css rules. */
@media (min-width: 701px) {
  .hero-banner .hero-content { top: 11%; --hero-h1: clamp(14px, min(4cqw, 7cqh), 52px); }
  .hero-banner .hero-content h1 { margin-bottom: 0.35em; }
  .hero-banner .hero-content p { margin-bottom: 0.8em; }
  .hero-banner .hero-content p + p { margin-bottom: 1.2em; }
}
