/* ==========================================================================
   Homepage-only styles: hero, why-panel, CTA band
   (shared components live in main.css)
   ========================================================================== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-7) var(--space-6);
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  right: -120px;
  top: -120px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 174, 239, 0.16), transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-primary-600);
  background: var(--color-primary-50);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  margin-bottom: var(--space-4);
}

.hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: var(--font-weight-extrabold);
  max-width: 18ch;
  color: var(--color-primary-900);
  margin-bottom: var(--space-4);
}

.hero-lead {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-5) 0;
}

.hero-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero-points .icon {
  color: var(--color-accent);
  flex-shrink: 0;
}

.hero-panel {
  padding: var(--space-5);
  position: relative;
  z-index: 1;
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3);
  background: var(--glass-bg-tint);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-md);
}

.hero-stat strong {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-primary-700);
}

.hero-stat span {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  line-height: 1.3;
}

/* hero demo/feature image (CMS hero block `image` key) */

.hero-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  position: relative;
  z-index: 1;
}

.hero-visual {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border-soft);
  box-shadow: var(--shadow-md);
  background: var(--color-primary-50);
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* why medihub */

.why-panel {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: var(--space-6);
  padding: var(--space-6);
  align-items: center;
}

.why-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.why-list li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.why-list .icon {
  color: var(--color-accent);
  flex-shrink: 0;
  margin-top: 3px;
}

.why-list strong {
  display: block;
  font-size: var(--font-size-sm);
}

.why-list span {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.why-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.step-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
}

.step-card p {
  margin: 0;
  font-size: var(--font-size-sm);
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
}

.step-card strong {
  display: block;
}

/* cta band */

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-6);
  background:
    linear-gradient(120deg, rgba(0, 174, 239, 0.1), rgba(57, 181, 74, 0.08)),
    var(--glass-bg-strong);
}

.cta-band h2 {
  margin-bottom: var(--space-2);
}

.cta-band p {
  margin: 0;
  max-width: 62ch;
}

.cta-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ----------------------------- featured products ----------------------------- */

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.product-card.featured-item {
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-primary-50);
}

.featured-item .featured-rating {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin: var(--space-2) 0;
  font-size: var(--font-size-sm);
  line-height: 1;
  color: var(--color-border-strong);
}

/* Grey base star with an amber overlay clipped to --fill (mirrors .star in main.css). */
.featured-item .featured-rating span {
  position: relative;
  display: inline-block;
}

.featured-item .featured-rating span::before {
  content: '\2605';
  position: absolute;
  left: 0;
  top: 0;
  width: var(--fill, 0%);
  overflow: hidden;
  color: var(--color-warning);
}

.featured-item .featured-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--glass-border-soft);
}

.featured-item .featured-price-row {
  margin: var(--space-2) 0;
  font-weight: var(--font-weight-medium);
}

/* Hero badge proportions: featured flag takes 40% width, price 60% */

.featured-item .product-flag {
  font-size: var(--font-size-xs);
  padding: 2px 6px;
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 2;
}

.featured-item .product-flag.flag-sale {
  background: var(--color-danger-500);
  color: #fff;
}

.featured-item .product-flag.flag-featured {
  background: var(--color-primary-600);
  color: #fff;
}

/* Mobile: one column running side to side of the screen. The card — and its
   image placeholder — goes edge to edge instead of main.css's 2-up phone grid.
   Specificity must beat `body.page-home .product-grid`, and the negative
   margin cancels `.main`'s side padding for a true full-bleed. */

@media (max-width: 768px) {
  body.page-home .product-grid.featured-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    margin-inline: calc(-1 * var(--space-5));
  }

  body.page-home .product-grid.featured-grid .featured-item {
    padding: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

@media (max-width: 640px) {
  /* `.main` narrows to --space-4 side padding down here; the bleed follows. */
  body.page-home .product-grid.featured-grid {
    margin-inline: calc(-1 * var(--space-4));
  }

  /* The full-bleed card is far wider than the 2-up tiles these type sizes
     were tuned for: shorten the 1:1 placeholder and scale up the copy and
     buttons so the card reads like a product hero, not a squeezed tile. */
  body.page-home .product-grid.featured-grid .product-media {
    aspect-ratio: 4 / 3;
  }

  body.page-home .product-grid.featured-grid .product-category {
    font-size: 0.72rem;
  }

  body.page-home .product-grid.featured-grid .product-name {
    font-size: 1.1rem;
    line-height: 1.3;
  }

  body.page-home .product-grid.featured-grid .featured-price {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--color-primary-800);
  }

  body.page-home .product-grid.featured-grid .featured-actions {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
  }

  /* Comfortable tap targets; “Add to cart” fills the row, quote stays square. */
  body.page-home .product-grid.featured-grid .featured-actions .btn {
    min-height: 44px;
  }

  body.page-home .product-grid.featured-grid .featured-actions .btn:first-child {
    flex: 1;
  }

  body.page-home .product-grid.featured-grid .featured-actions .btn-ghost {
    flex: 0 0 auto;
    min-width: 44px;
    padding: 0 var(--space-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .featured-item {
    transition: none;
  }
}

/* ------------------------------ hero slider ------------------------------ */
/* 1–3 hero photos rotate; each slide keeps the 4/3 frame so the layout
   never jumps between images with different dimensions. */

.hero-slider {
  position: relative;
}

.hero-slides {
  position: relative;
}

.hero-slide {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border-soft);
  box-shadow: var(--shadow-md);
  background: var(--color-primary-50);
}

.hero-slide:not(.is-active) {
  display: none;
}

.hero-slide.is-active {
  animation: hero-slide-in 0.45s ease;
}

.hero-slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

@keyframes hero-slide-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--color-primary-800);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.hero-arrow:hover {
  background: #fff;
  color: var(--color-primary-600);
}

.hero-arrow[data-hero-prev] { left: 10px; }
.hero-arrow[data-hero-next] { right: 10px; }

.hero-slider-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}

.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-border-strong);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
  width: 22px;
  background: var(--color-primary-500);
}

@media (max-width: 640px) {
  .hero-arrow {
    width: 30px;
    height: 30px;
    font-size: 17px;
  }

  .hero-slider-controls {
    bottom: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide.is-active {
    animation: none;
  }
}

/* ------------------------------- responsive ------------------------------ */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding: var(--space-6) var(--space-5);
  }

  .hero h1 {
    max-width: none;
  }

  .why-panel {
    grid-template-columns: 1fr;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: var(--space-5) var(--space-4);
    gap: var(--space-5);
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-panel {
    padding: var(--space-4);
  }

  .why-panel {
    padding: var(--space-4);
    gap: var(--space-5);
  }

  .step-card {
    padding: var(--space-3);
    gap: var(--space-3);
  }

  .cta-band {
    padding: var(--space-5) var(--space-4);
  }
}

/* ------------------------------ page rhythm ------------------------------ */
/* Homepage blocks sit one step closer together than inner pages (space-7 →
   space-6), and the first block starts flush under the sticky navbar. */

body.page-home .section {
  margin-top: var(--space-6);
}

body.page-home .cms-block {
  margin-bottom: var(--space-6);
}

body.page-home .main {
  padding-top: 0;
}

body.page-home .main > :first-child {
  margin-top: 0;
}
