/* assets/css/home-sections.css
   Layout for the homepage category sections (Pickles, Murabba, Chutney, Desi Ghee).
   Product cards are NOT styled here: they use .product-card, .img-wrap, .price-row,
   .add-to-cart etc. from index.css, so they match the rest of the page exactly.
   Load this file AFTER index.css. */

.cs-section {
  --cs-cols: 4;      /* products per row on desktop: change to 6 to match the top grids */
  --cs-gap: 18px;
  --cs-text: #2c2c2c;
  --cs-accent: #b94a1a;
  --cs-radius: 16px;
  padding: 48px 0 8px;
  background: #fff;
}

.cs-section--ghee {
  background: #fdf8f6;
  padding-bottom: 48px;
}

.cs-wrap {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Heading with lines on both sides ---------- */
.cs-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  text-align: center;
}

.cs-title {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  margin: 0 0 10px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--cs-text);
}

.cs-title::before,
.cs-title::after {
  content: "";
  flex: 1 1 40px;
  height: 2px;
  background: var(--cs-text);
}

.cs-viewall {
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  font-size: 14px;
  color: var(--cs-text);
  text-decoration: none;
}

.cs-viewall:hover,
.cs-viewall:focus-visible {
  color: var(--cs-accent);
}

/* ---------- Product grid ---------- */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(var(--cs-cols), minmax(0, 1fr));
  gap: var(--cs-gap);
}

/* Desi ghee row: same card width as the grid, centred */
.cs-grid--center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.cs-grid--center .product-card {
  flex: 0 1 calc((100% - ((var(--cs-cols) - 1) * var(--cs-gap))) / var(--cs-cols));
}

/* Card names are h3 here (they sit under the section h2) but look like the h2 in index.css */
.cs-section .product-card h3 {
  margin-bottom: 6px;
  height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  color: #2c2c2c;
}

/* ---------- Desi ghee benefits row ---------- */
.cs-benefits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.cs-benefit {
  padding: 24px 18px;
  background: #fff;
  border: 1px solid #ead9cf;
  border-radius: var(--cs-radius);
  text-align: center;
}

.cs-benefit__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #fbeee6;
  color: var(--cs-accent);
  font-size: 22px;
}

.cs-benefit h3 {
  margin: 0 0 8px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--cs-text);
}

.cs-benefit p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: #4b5563;
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .cs-section { --cs-cols: 3; }
  .cs-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .cs-section {
    --cs-cols: 2;
    --cs-gap: 8px;
    padding-top: 36px;
  }

  .cs-wrap { padding: 0 12px; }

  .cs-title { gap: 12px; }

  .cs-title::before,
  .cs-title::after { flex-basis: 12px; }

  .cs-section .product-card h3 {
    height: 32px;
    font-size: 12.5px;
  }

  /* a single ghee card should not shrink to half width on phones */
  .cs-grid--center .product-card { flex-basis: min(100%, 320px); }
}

@media (max-width: 480px) {
  .cs-benefits { grid-template-columns: 1fr; }
}