/* Home page (Home/HomeView). Design: docs/homedesign/home1.html */

/* Hero carousel: centred banner with the previous and next banners always peeking in on both sides, so visitors
   can see there is more, rounded */
.v1-hero {
  --swiper-theme-color: var(--brand-primary-hover);
  padding-bottom: 32px;
}

/* Fixed frame, ratio set by HomeView-JS fitHero() from the banners themselves (3:1 until it runs), banner fitted
   inside uncropped. A banner with a different ratio is centred over a blurred copy of itself, so the frame never
   shows a gap; the backdrop uses a 200px copy of the image, so it costs next to nothing. */
.v1-hero .swiper-slide {
  position: relative;
  width: 68%;
  height: auto;
  aspect-ratio: var(--hero-ratio, 3);
  border-radius: 20px;
  overflow: hidden;
  opacity: 0.6;
  transition: opacity 0.3s;
  /* a hairline keeps pale banners from dissolving into the page background when they are dimmed */
  outline: 1px solid rgba(15, 23, 42, 0.1);
  outline-offset: -1px;
}

.v1-hero .swiper-slide::before {
  content: '';
  position: absolute;
  inset: -24px;
  background: var(--hero-bg) center / cover;
  filter: blur(18px);
}

.v1-hero .swiper-slide a {
  position: relative;
  display: block;
  height: 100%;
}

.v1-hero .swiper-slide img {
  object-fit: contain;
}

.v1-hero .swiper-slide-active {
  opacity: 1;
}

/* only the centred banner is a link; clicking a neighbour slides it into view (slideToClickedSlide) */
.v1-hero .swiper-slide:not(.swiper-slide-active) a {
  pointer-events: none;
}

/* own dots (one per real banner; the slider holds extra copies), centred under the banners */
.v1-hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.v1-hero-dot {
  width: 8px;
  height: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #cbd5e1;
  box-shadow: none;
  transition: width 0.3s, background-color 0.3s;
}

.v1-hero-dot.active {
  width: 22px;
  background: var(--brand-primary-hover);
}

/* centre the arrows on the banners, not on the banners + pagination */
.v1-hero .swiper-button-next,
.v1-hero .swiper-button-prev {
  top: calc(50% - 16px);
}

/* wide banners (about 3:1): most of the container width, so the hero stays a sensible height and readable,
   leaving about 10% on each side for the neighbours */
.v1-hero-wide .swiper-slide {
  width: 80%;
}

@media (max-width: 767px) {
  .v1-hero .swiper-slide {
    width: 82%;
  }

  .v1-hero-wide .swiper-slide {
    width: 82%;
  }

  .v1-hero .swiper-slide::before {
    background-image: var(--hero-bg-mobile);
  }
}

/* Swiper Navigation Customization */
.hv1 .swiper-button-next,
.hv1 .swiper-button-prev {
  background-color: white;
  color: var(--brand-primary-hover);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.hv1 .swiper-button-next:after,
.hv1 .swiper-button-prev:after {
  font-size: 1.2rem;
  font-weight: bold;
}

/* Tiles (Highlight Top and Shop by Category) */
.v1-tile {
  isolation: isolate;
}

.v1-tile-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  transition: transform 0.3s;
}

.v1-tile:hover .v1-tile-img {
  transform: scale(1.05);
}

.v1-tile-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 28px 12px 10px;
  font-size: 0.9rem;
  line-height: 1.3;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), transparent);
}

/* a category tile is pictured by one of its product packshots: the packshot's white background blends into the
   tint (multiply) and the product sits above the caption */
.v1-tile-product .v1-tile-img {
  padding: 4px 4px 40px;
  mix-blend-mode: multiply;
}

/* Parallax Banner */
.parallax-banner {
  background-image: var(--parallax-bg);
  /* set inline from join_seller */
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  min-height: 400px;
  display: flex;
  align-items: center;
  position: relative;
}

@media (max-width: 767px) {
  .parallax-banner {
    background-image: var(--parallax-bg-mobile);
    background-attachment: scroll;
    /* fixed backgrounds are ignored or janky on mobile */
  }
}

.parallax-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 100%);
}

/* Welcome voucher popup */
.v1-claim-btn {
  --bs-btn-bg: #2e6944;
  --bs-btn-border-color: #2e6944;
  --bs-btn-hover-bg: #245437;
  --bs-btn-hover-border-color: #245437;
  --bs-btn-active-bg: #245437;
  --bs-btn-active-border-color: #245437;
}

/* stacked on phones the close button sits on the banner photo: give it a white disc so it stays visible */
@media (max-width: 767px) {
  #voucherPopupModal .btn-close {
    background-color: #fff;
    border-radius: 50%;
    opacity: 1;
  }
}

/* Lokasi Toko / Gabung Seller */
.v1-cta {
  background: #f7f7fc;
  border-top: 1px solid #eef2f7;
}

.v1-cta-card {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s;
}

.v1-cta-card:hover {
  transform: translateY(-3px);
}

.v1-cta-icon {
  width: 60px;
  height: 60px;
}

/* Tile caption second line (Highlight Top label, category product count) */
.v1-tile-caption-sub {
  font-size: 0.75rem;
}

/* Join-seller banner copy and button */
.v1-join-lead {
  max-width: 600px;
}

.v1-join-btn {
  transition: transform 0.2s;
}

.v1-join-btn:hover {
  transform: scale(1.05);
}

.v1-popup-title {
  font-size: 1.3rem;
}

/* claimed popup voucher: the same pale pink as a claimed voucher on the product list (click again to unclaim) */
.v1-claim-btn.is-claimed {
  --bs-btn-bg: var(--brand-secondary);
  --bs-btn-color: var(--brand-primary-hover);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-bg: #fbcfe8;
  --bs-btn-hover-color: var(--brand-primary-hover);
  --bs-btn-hover-border-color: var(--brand-primary-hover);
  --bs-btn-active-bg: #fbcfe8;
  --bs-btn-active-color: var(--brand-primary-hover);
  --bs-btn-active-border-color: var(--brand-primary-hover);
}

/* the popup's voucher code */
.v1-popup-code {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--brand-primary-hover);
  background: var(--brand-secondary);
  border: 1px dashed var(--brand-primary);
  border-radius: 6px;
}

/* Loading placeholders, replaced once the JS renders */
.v1-skeleton-tile {
  aspect-ratio: 4 / 3;
}

.v1-skeleton-article {
  height: 320px;
  border-radius: 12px;
}
