/* =====================================================================
   YAXIN Industrial Supplies — home.css
   Styles exclusive to index.html
   (hero carousel, USP strip, category product rows, promo banner)
   ===================================================================== */

/* ===== Section shell ===== */
.section { padding: clamp(32px, 5vw, 56px) 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 30px; gap: 12px; }
.section-head .eyebrow { color: var(--red); font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.section-head h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; margin-top: 4px; }
.section-head .more { color: var(--red); font-weight: 600; font-size: 15px; }
.section-head .more:hover { text-decoration: underline; }

/* ===== Carousel ===== */
/* Full-bleed image banners: the artwork carries its own copy, so each slide is
   just a linked <img>. Height follows the image's natural ratio (1920x649,
   ~2.96:1) and scales with the viewport — no crop, no overlay text. */
.carousel { position: relative; overflow: hidden; }
.carousel-track { display: flex; transition: transform .5s ease; }
.slide {
  min-width: 100%; display: block; line-height: 0;
  position: relative; overflow: hidden;
}
.slide img { display: block; width: 100%; height: auto; }

.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.25); border: none; color: #fff;
  font-size: 20px; cursor: pointer; transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.carousel-arrow:hover { background: rgba(255,255,255,.45); }
.carousel-arrow.prev { left: 18px; }
.carousel-arrow.next { right: 18px; }
.carousel-dots {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px;
}
.carousel-dots button {
  width: 10px; height: 10px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.5); cursor: pointer; transition: all .2s;
}
.carousel-dots button.active { background: #fff; width: 26px; border-radius: 5px; }

/* ===== USP strip ===== */
.usp { background: var(--white); border-bottom: 1px solid var(--line); }
.usp .container {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  padding: clamp(18px, 2.5vw, 26px) 20px;
}
/* Each of the four promises centres as a unit inside its own grid cell — the
   icon + text pair is what gets centred, so the two text lines keep their own
   left alignment instead of the whole block going ragged-centred. */
.usp-item { display: flex; align-items: center; justify-content: center; gap: 14px; }
.usp-icon {
  width: 46px; height: 46px; border-radius: 50%; background: var(--red-light);
  display: flex; align-items: center; justify-content: center; color: var(--red); flex-shrink: 0;
}
.usp-item h4 { font-size: 15px; }
.usp-item p { font-size: 13px; color: var(--gray); }

/* ===== Category product rows (homepage) =====
   The "Shop by Category" card grid that used to sit above these rows was
   dropped on request, and its .cat-grid / .cat-card / .cat-icon rules went
   with it — every link that pointed at #categories now goes to products.html.
   What remains: one row per category — Solar Fans, Home Fans, Industrial Fans,
   Small Appliances, Motors — five cards each, so the 5-column grid is exactly
   one line on desktop. .cat-row also softens its heading to 600: the 800 the
   other section heads use reads too heavy once five of these rows stack up. */
.cat-row .section-head h2 { font-weight: 600; }
/* Phones show four cards per category, desktop keeps all five. The 5th card
   carries .phide in the markup (see index.html); the rule lives in the phone
   block at the bottom of this file so the desktop grid is untouched. */
.prod-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(14px, 1.5vw, 20px); }
.prod-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; transition: all .2s; position: relative; cursor: pointer;
}
.prod-card:hover { box-shadow: 0 12px 28px rgba(0,0,0,.1); transform: translateY(-4px); }
.prod-img {
  aspect-ratio: 1 / 1; height: auto; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #f8f9fa, #eef1f3);
}
.prod-body { padding: 18px; }
/* The category label (.prod-cat) was dropped from the homepage cards — no rule here.
   The rating line was dropped too — no .stars rule here either.
   The detail page's review stars are separate (.rev-score .stars, detail.css). */.prod-body h3 { font-size: 15px; margin: 6px 0 6px; min-height: 44px; }
/* Title -> price gap = h3's margin-bottom only: sibling margins collapse to the
   larger of the two, so .prod-foot carries no margin-top of its own. */
.prod-foot { display: flex; justify-content: space-between; align-items: center; }
.price { color: var(--red); font-size: 22px; }
.price s { color: #adb5bd; font-size: 13px; margin-left: 6px; }
/* This row used to hold a "+ Add" button; it now holds a static .sold count,
   whose rule lives in base.css because the products list shows it too. */

/* ===== Promo banner ===== */
.promo {
  background: linear-gradient(115deg, var(--red) 0%, var(--red-dark) 100%);
  border-radius: 14px; color: #fff;
  padding: clamp(24px, 4vw, 44px) clamp(20px, 4vw, 48px);
  display: flex; justify-content: space-between; align-items: center; gap: 28px;
}
.promo h3 { font-size: clamp(20px, 2.6vw, 28px); font-weight: 800; margin-bottom: 8px; }
.promo p { opacity: .9; margin-bottom: 22px; }
.promo .btn-outline {
  border: 2px solid #fff; color: #fff; padding: 11px 30px; border-radius: 6px;
  font-weight: 700; font-size: 15px; display: inline-block; transition: all .2s;
}
.promo .btn-outline:hover { background: #fff; color: var(--red); }
.promo-code {
  background: rgba(255,255,255,.14); border: 1px dashed rgba(255,255,255,.6);
  padding: 22px 34px; border-radius: 10px; text-align: center;
}
.promo-code .label { font-size: 13px; letter-spacing: 1px; opacity: .85; }
.promo-code .code { font-size: 30px; font-weight: 800; letter-spacing: 4px; margin-top: 4px; }

/* ===== Home responsive ===== */
@media (max-width: 1024px) {
  .prod-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  /* One category row = 4 cards on phones (desktop keeps 5). Two per row, so
     every category lands on exactly two lines instead of a trailing orphan. */
  .cat-row .prod-grid .prod-card.phide { display: none; }
  .usp .container { grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 20px 16px; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .section { padding: 36px 0; }
  .section-head { margin-bottom: 20px; }
}
@media (max-width: 560px) {
  /* Phones only: the four promises stop stacking and become one swipeable row.
     Exactly two sit in view at rest — flex-basis is half the content box minus
     the gap, so "2 per screen" is arithmetic, not a guess — and the other two
     come in with a horizontal drag. The container is the scroll port, so the
     long row can never widen the page; the grid properties below are simply
     ignored once display is flex. Desktop/tablet never see any of this. */
  .usp .container {
    display: flex; gap: 12px; padding: 18px 16px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scrollbar-width: none;
    /* Snapping aligns against the snapport, which by default starts at the
       scrollport edge and so ignores padding — without this the first promise
       snaps flush to the screen edge and swallows the 16px gutter. */
    scroll-padding-inline: 16px;
  }
  .usp .container::-webkit-scrollbar { display: none; }
  .usp-item {
    flex: 0 0 calc((100% - 12px) / 2);
    min-width: 0; scroll-snap-align: start;
  }
  .carousel-arrow { width: 36px; height: 36px; }
  .carousel-arrow.prev { left: 10px; }
  .carousel-arrow.next { right: 10px; }
  .promo { flex-direction: column; text-align: center; gap: 22px; }
  .promo h3 { font-size: 22px; }
  .promo-code { width: 100%; padding: 16px 20px; }
  .promo-code .code { font-size: 24px; }
  .section-head h2 { font-size: 21px; }
}
@media (max-width: 400px) {
  /* Same two-per-row rule as the list page: the card tightens, it does not
     collapse to a single column. */
  .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .prod-body { padding: 10px; }
  .prod-body h3 { font-size: 12.5px; min-height: 34px; margin: 5px 0; }
  .price { font-size: 17px; }
  .price s { font-size: 11.5px; margin-left: 5px; }
  .prod-foot { flex-wrap: wrap; gap: 2px 6px; }
  .sold { font-size: 11px; }
  /* Two promises now share the row, so each one steps down again to keep the
     icon + two text lines inside its half without wrapping into a stack. */
  .usp-icon { width: 38px; height: 38px; }
  .usp-item { gap: 10px; }
  .usp-item h4 { font-size: 13.5px; }
  .usp-item p { font-size: 11.5px; }
}
