/* ═══════════════════════════════════════
   HOME PAGE COMPONENTS
═══════════════════════════════════════ */
/* ═══════════════════════════════════════
   HERO CAROUSEL
═══════════════════════════════════════ */
.hero-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 0;          /* full-bleed: no rounded corners against the viewport edge */
  margin: 0 0 4px;           /* features section follows immediately below */
  min-height: 360px;         /* short enough that the features bar peeks above the fold on laptops */
}

.carousel-inner {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
}

.hero-slider {
  flex: 0 0 100%;
  /* Background spans full-bleed; content aligns to the 1280px page gutter on
     wide screens (so hero text lines up with the rest of the page), with an
     80px minimum on standard widths. */
  padding: 36px max(80px, calc((100% - 1280px) / 2 + 20px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 360px;
  position: relative;
  overflow: hidden;
}

/* Foreground <img> used instead of CSS background-image (WCAG 1.1.1) */
.hero-slider__bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;   /* fill the banner edge-to-edge; crops overflow instead of letterboxing */
  object-position: center;
  z-index: 0;
}

/* Video background: sits above the poster still and fades in once it plays, so
   the poster covers the gap before playback (and reduced-motion, and failure). */
.hero-slider__bg-video {
  z-index: 1;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hero-slider__bg-video.is-playing { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero-slider__bg-video { display: none !important; }
}

.hero-slider--green {
  background-color: var(--primary-color);
  color: var(--white);
}

.hero-slider--pink {
  background-color: #fce7f3;
  color: var(--text-dark);
}

.hero-slider__content {
  flex: 1;
  max-width: 500px;
  z-index: 2;
}

.hero-slider__badge {
  display: inline-block;
  background-color: var(--secondary-color);
  color: var(--text-dark);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 20px;
}

.hero-slider__title {
  font-size: 48px;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero-slider--green .hero-slider__title {
  color: var(--white);
}

.hero-slider__desc {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 30px;
}

.hero-slider__image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  z-index: 2;
}

.hero-slider__image img {
  max-height: 380px;
  object-fit: contain;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.carousel-btn:hover {
  background-color: rgba(255, 255, 255, 0.5);
  color: var(--primary-color);
}

.carousel-btn--prev { left: 20px; }
.carousel-btn--next { right: 20px; }

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  z-index: 10;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #e2e8f0;
  cursor: pointer;
  transition: var(--transition);
  /* Reset button defaults */
  border: none;
  padding: 0;
  font: inherit;
  min-width: 10px;
}

.dot.active,
.dot[aria-selected="true"] {
  width: 30px;
  background-color: var(--primary-color);
  border-radius: 5px;
}

/* Respect reduced motion for carousel transition */
@media (prefers-reduced-motion: reduce) {
  .carousel-inner { transition: none !important; }
}

.hero-slider__desc {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 30px;
}

.hero-slider__image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  z-index: 2;
}

.hero-slider__image img {
  max-height: 400px;
  object-fit: contain;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.feature-card {
  background-color: var(--white);
  padding: 30px 20px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary-color);
}

.feature-card__icon {
  width: 60px;
  height: 60px;
  background-color: var(--secondary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 24px;
  color: var(--secondary-color);
  transition: var(--transition);
}

.feature-card:hover .feature-card__icon {
  background-color: var(--secondary-color);
  color: var(--white);
  transform: scale(1.1);
}

.feature-card__title {
  font-size: 16px;
  margin-bottom: 10px;
}

.feature-card__desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* Section Header */
.section-header {
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-title {
  font-size: 28px;
  margin-bottom: 5px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

/* Products Grid */
.products-grid {
  display: grid;
  /* auto-fit: up to 6 columns, but when there are fewer products (short
     limit, manual pick, or few active products) the existing cards stretch
     to fill the row instead of leaving a blank gap. */
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.product-card {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
  transform: translateY(-4px);
}

.product-card__badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: var(--danger);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  z-index: 2;
}

.product-card__image {
  position: relative;
  margin-bottom: 15px;
  aspect-ratio: 1;
  background-color: #f4f6f8;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card__image img {
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.5s ease;
  mix-blend-mode: multiply;
}

.product-card:hover .product-card__image img {
  transform: scale(1.08);
}

.product-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card__title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-dark);
}

.product-card__title:hover {
  color: var(--primary-color);
}

.product-card__rating {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--secondary-color);
  font-size: 12px;
  margin-bottom: 12px;
}

.product-card__rating span {
  color: var(--text-muted);
}

.product-card__price {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 15px;
  color: var(--text-dark);
}

.product-card__price del {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  margin-left: 5px;
}

.product-card__price .discount {
  color: var(--danger);
  font-size: 11px;
  margin-left: 5px;
}

.product-card__actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.product-card__btn {
  flex: 1;
  padding: 8px;
  font-size: 13px;
  border-radius: var(--radius-md);
  background-color: var(--primary-color);
}

.product-card__wishlist {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
  background-color: var(--white);
}

.product-card__wishlist:hover {
  color: var(--danger);
  border-color: var(--danger);
  background-color: #fff5f5;
}

/* Best Sellers Section with curve */
.best-sellers-section {
  background-color: #9fdf71;
  padding: 38px 0;
  border-radius: 40px;
  margin-bottom: 34px;
  position: relative;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}

.category-card {
  text-align: center;
  transition: var(--transition);
}

.category-card:hover {
  transform: translateY(-5px);
}

.category-card__image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--white);
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.category-card:hover .category-card__image {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.category-card__image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.category-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 1200px) {
  .categories-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 992px) {
  .hero-slider { flex-direction: column; padding: 40px; text-align: center; }
  .hero-slider__image { margin-top: 30px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .categories-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .hero-slider__title { font-size: 36px; }
  /* Rows can't fit — become a swipeable slider instead of squeezing the cards */
  .products-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 58%;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 14px;
    padding: 0 0 10px !important; /* beats the inline 40px side padding */
    margin-bottom: 40px;
  }
  .products-grid::-webkit-scrollbar { display: none; }
  .products-grid > .product-card { scroll-snap-align: start; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 576px) {
  .hero-slider__title { font-size: 28px; }
  .features { grid-template-columns: 1fr; }
  .products-grid { grid-auto-columns: 72%; }
  .products-grid .product-card__actions { gap: 6px; }
  .products-grid .product-card__actions .product-card__wishlist,
  .products-grid .product-card__actions .product-card__whatsapp { width: 34px !important; height: 34px !important; margin-left: 0 !important; flex-shrink: 0; }
  .products-grid .product-card__btn { font-size: 12px; padding: 8px 6px; margin-left: 0 !important; min-width: 0; white-space: nowrap; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .best-sellers-section { border-radius: 20px; padding: 40px 0; }
}

/* ═══════════════════════════════════════
   HERO — text animation on active slide
═══════════════════════════════════════ */
.carousel-inner {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slider__content > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
/* Trigger via JS — add class to the active slide */
.hero-slider.is-active .hero-slider__content > * {
  opacity: 1;
  transform: translateY(0);
}
.hero-slider.is-active .hero-slider__badge   { transition-delay: 0.1s; }
.hero-slider.is-active .hero-slider__title   { transition-delay: 0.2s; }
.hero-slider.is-active .hero-slider__desc    { transition-delay: 0.3s; }
.hero-slider.is-active .hero-slider__actions { transition-delay: 0.4s; }

/* Carousel buttons — bigger + more prominent */
.carousel-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.3);
  opacity: 0;
  transition: opacity 0.25s ease, background-color 0.2s ease, transform 0.2s ease;
}
.hero-carousel:hover .carousel-btn { opacity: 1; }
.carousel-btn:hover {
  background: rgba(255,255,255,0.85);
  color: var(--primary-color);
  transform: translateY(-50%) scale(1.1);
}

/* Dots — pill active state */
.dot {
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1), background-color 0.3s ease;
}

/* Feature cards — richer hover */
.feature-card {
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  will-change: transform;
}
.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.08);
  border-color: var(--secondary-color);
}

/* Product cards — subtle lift */
.product-card {
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
  will-change: transform;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.10);
  border-color: var(--primary-light);
}

/* Category cards — scale image on hover */
.category-card__image {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.category-card:hover .category-card__image {
  transform: scale(1.06);
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
  border-color: var(--primary-color);
}

/* Section header animated underline */
.section-title {
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 42px;
  height: 3px;
  background: var(--secondary-color);
  border-radius: 2px;
}

/* Countdown — pulse on seconds digit */
@keyframes countPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}
.countdown-box:last-child .countdown-val {
  animation: countPulse 1s ease infinite;
}

/* Best sellers section — brighter, more contrast */
.best-sellers-section {
  background: linear-gradient(135deg, #8cd467 0%, #b5e88a 100%);
}

/* ══════════════════════════════════════════════════════════════════════
   HOMEPAGE SECTION BACKGROUNDS — optional image / GIF / video behind any
   builder section, chosen from the media library. A scrim keeps text legible.
   ══════════════════════════════════════════════════════════════════════ */
.hp-secbg { position: relative; overflow: hidden; isolation: isolate; }
.hp-secbg__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}
.hp-secbg__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0b1020;   /* opacity set inline from the admin overlay slider */
  pointer-events: none;
}
.hp-secbg__inner { position: relative; z-index: 2; }
/* Video only fades in once it can play, so the poster-less black doesn't flash. */
.hp-secbg--video .hp-secbg__media { opacity: 0; transition: opacity .6s ease; }
.hp-secbg--video .hp-secbg__media.is-playing { opacity: 1; }
