/* ── Home layout ── */
.home-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 0;
}

.home-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 2.5rem;
}

.home-page__fluid {
  width: 100%;
}

.home-page__contained {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: min(1280px, 94vw);
  margin-inline: auto;
}

.home-page__contained .section-header,
.home-page__contained .category-chips,
.home-page__contained .flash-sale,
.home-page__contained .campaign-row,
.home-page__contained .product-carousel,
.home-page__contained .promo-grid,
.home-page__contained .brand-row,
.home-page__contained .dual-promo {
  padding-inline: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.section-header .section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.section-header__more {
  font-size: 0.88rem;
  color: var(--pink-600);
  text-decoration: none;
  white-space: nowrap;
}

.section-header__more:hover {
  text-decoration: underline;
}

/* ── Hero slider (square tiles, full-width) ── */
.hero-slider--square {
  --hero-gap: 4px;
  --hero-cols: 1;
  position: relative;
  width: 100%;
  margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
  .hero-slider--square {
    --hero-cols: 2;
  }
}

@media (min-width: 992px) {
  .hero-slider--square {
    --hero-cols: 4;
  }
}

.hero-slider__viewport {
  overflow: hidden;
  width: 100%;
  direction: ltr;
}

.hero-slider--carousel .hero-slider__viewport {
  cursor: grab;
  touch-action: pan-y;
  container-type: inline-size;
}

.hero-slider--carousel .hero-slider__viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.hero-slider__track {
  display: grid;
  width: 100%;
  gap: var(--hero-gap);
  grid-template-columns: repeat(var(--hero-cols), minmax(0, 1fr));
}

.hero-slider__slide {
  min-width: 0;
}

/* Carousel mode: 4+ items — show 3.5 tiles on desktop as scroll hint */
@media (min-width: 992px) {
  .hero-slider--carousel {
    --hero-visible: 3.5;
  }

  .hero-slider--carousel .hero-slider__track {
    display: flex;
    width: max-content;
    transition: transform 0.45s ease;
    will-change: transform;
  }

  .hero-slider--carousel .hero-slider__slide {
    flex: 0 0 calc((100vw - var(--hero-gap) * 3) / 3.5);
    width: calc((100vw - var(--hero-gap) * 3) / 3.5);
    max-width: calc((100vw - var(--hero-gap) * 3) / 3.5);
  }

  @supports (width: 1cqw) {
    .hero-slider--carousel .hero-slider__slide {
      flex: 0 0 calc((100cqw - var(--hero-gap) * 3) / 3.5);
      width: calc((100cqw - var(--hero-gap) * 3) / 3.5);
      max-width: calc((100cqw - var(--hero-gap) * 3) / 3.5);
    }
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .hero-slider--carousel .hero-slider__track {
    display: flex;
    width: max-content;
    transition: transform 0.45s ease;
    will-change: transform;
  }

  .hero-slider--carousel .hero-slider__slide {
    flex: 0 0 calc((100vw - var(--hero-gap)) / 2);
    width: calc((100vw - var(--hero-gap)) / 2);
  }
}

@media (max-width: 767px) {
  .hero-slider--carousel .hero-slider__track {
    display: flex;
    width: max-content;
    transition: transform 0.45s ease;
    will-change: transform;
  }

  .hero-slider--carousel .hero-slider__slide {
    flex: 0 0 100vw;
    width: 100vw;
  }
}

.hero-slider__tile {
  display: block;
  text-decoration: none;
  color: inherit;
}

.hero-slider__media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--pink-100);
}

.hero-slider__media .img-placeholder--hero-square {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.hero-slider__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slider__caption {
  direction: rtl;
  position: absolute;
  inset-inline: 0.65rem;
  bottom: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
  z-index: 1;
}

.hero-slider__title {
  font-size: clamp(0.82rem, 2.2vw, 1rem);
  font-weight: 800;
  color: var(--text);
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.85);
}

.hero-slider__badge {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pink-600);
  box-shadow: var(--shadow-sm);
}

.hero-slider__nav {
  position: absolute;
  bottom: 0.75rem;
  transform: none;
  top: auto;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 2;
}

.hero-slider__nav[hidden] {
  display: none;
}

.hero-slider__nav::after {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  margin: auto;
  border: 2px solid var(--pink-600);
  border-top: none;
  border-left: none;
}

.hero-slider__nav--prev {
  inset-inline-start: 0.65rem;
}

.hero-slider__nav--prev::after {
  transform: rotate(135deg);
  margin-inline-end: -2px;
}

.hero-slider__nav--next {
  inset-inline-end: 0.65rem;
}

.hero-slider__nav--next::after {
  transform: rotate(-45deg);
  margin-inline-start: -2px;
}

/* ── Category chips ── */
.category-chips {
  --chip-icon-size: 100px;
  display: flex;
  justify-content: center;
  padding-inline: clamp(0.75rem, 3vw, 1.5rem);
}

.category-chips__scroll {
  display: inline-flex;
  max-width: 100%;
  gap: 0.85rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-block: 0.35rem;
  padding-inline: 2px;
  scrollbar-width: none;
}

.category-chips__scroll::-webkit-scrollbar {
  display: none;
}

.category-chips__item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: var(--chip-icon-size);
  text-decoration: none;
  color: var(--text);
  scroll-snap-align: start;
}

.category-chips__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--chip-icon-size);
  height: var(--chip-icon-size);
  border-radius: 50%;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--pink-100);
  box-sizing: border-box;
}

.category-chips__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-chips__fallback {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pink-500);
}

.category-chips__label {
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.35;
  max-width: 100%;
}

/* ── Promo grid ── */
.promo-grid {
  padding-inline: clamp(0.5rem, 2vw, 1rem);
}

.promo-grid__inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.promo-grid__card {
  display: block;
  min-width: 0;
  text-decoration: none;
}

.promo-grid__media {
  display: block;
  line-height: 0;
}

.promo-grid__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* ── Brand row ── */
.brand-row {
  padding-inline: clamp(0.75rem, 3vw, 1.5rem);
}

.brand-row__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  padding: 0.75rem;
  background: var(--white);
  border: 1px solid var(--border, #e8e8e8);
  border-radius: var(--radius-lg);
}

@media (min-width: 640px) {
  .brand-row__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 900px) {
  .brand-row__grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
  }
}

.brand-row__scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.25rem 0;
}

.brand-row__item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 96px;
  padding: 0.45rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border, #eee);
  text-decoration: none;
  overflow: hidden;
}

.brand-row__item img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-row__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

/* ── Flash sale ── */
.flash-sale {
  padding-inline: clamp(0.75rem, 3vw, 1.5rem);
}

.flash-sale__inner {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  border-radius: var(--radius-lg);
  padding: 1rem clamp(0.75rem, 3vw, 1.25rem) 1.15rem;
  color: var(--white);
}

.flash-sale__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.flash-sale__title-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.flash-sale__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.flash-sale__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
}

.flash-sale__countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.flash-sale__countdown-label {
  font-size: 0.72rem;
  opacity: 0.9;
}

.flash-sale__timer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.flash-sale__time {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.5rem;
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.18);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

.flash-sale__time small {
  font-size: 0.62rem;
  font-weight: 500;
  opacity: 0.9;
}

.flash-sale__sep {
  font-weight: 700;
  opacity: 0.85;
}

.flash-sale__more {
  color: var(--white) !important;
}

.flash-sale__more:hover {
  color: var(--white) !important;
  opacity: 0.9;
}

.flash-sale__carousel .product-carousel__track {
  padding-inline: 2.5rem;
}

.flash-sale__carousel .product-carousel__nav {
  background: rgba(255, 255, 255, 0.95);
}

/* ── Campaign row ── */
.campaign-row {
  padding-inline: clamp(0.5rem, 2vw, 1rem);
}

.campaign-row__inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 768px) {
  .campaign-row__inner {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}

.campaign-row__card {
  display: block;
  min-width: 0;
  text-decoration: none;
}

.campaign-row__media {
  display: block;
  line-height: 0;
}

.campaign-row__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* ── Dual promo banners ── */
.dual-promo {
  padding-inline: clamp(0.75rem, 3vw, 1.5rem);
}

.dual-promo__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .dual-promo__inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

.dual-promo__card {
  --dual-promo-bg: var(--pink-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 120px;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-lg);
  background: var(--dual-promo-bg);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dual-promo__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  flex: 1;
}

.dual-promo__text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
}

.dual-promo__btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.dual-promo__graphic {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
}

.dual-promo__graphic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── Product carousel ── */
.home-page .product-carousel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.home-page .product-carousel > .section-header {
  justify-content: flex-start;
  gap: 0.65rem;
  margin-bottom: 0;
}

.home-page .product-carousel__wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.home-page .product-carousel__track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.85rem 2.75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.home-page .product-carousel__slide {
  flex: 0 0 auto;
  width: min(220px, 42vw);
  scroll-snap-align: start;
  padding-inline: 0.85rem;
}

.home-page .product-carousel__slide + .product-carousel__slide {
  border-inline-start: 1px solid var(--border);
}

.home-page .product-carousel__slide .product-card {
  height: 100%;
  border: none;
  box-shadow: none;
}

.home-page .product-carousel__slide .product-card:hover {
  transform: none;
  box-shadow: none;
}

.home-page .product-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 2;
}

.home-page .product-carousel__nav::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: auto;
  border: 2px solid var(--pink-600);
  border-top: none;
  border-left: none;
}

.home-page .product-carousel__nav--prev {
  inset-inline-start: 0.65rem;
}

.home-page .product-carousel__nav--prev::after {
  transform: rotate(135deg);
}

.home-page .product-carousel__nav--next {
  inset-inline-end: 0.65rem;
}

.home-page .product-carousel__nav--next::after {
  transform: rotate(-45deg);
}

@media (max-width: 640px) {
  .home-page .product-carousel__nav {
    display: none;
  }

  .home-page .product-carousel__track {
    padding-inline: 0.85rem;
  }
}
