/* Add-on styles: New Arrivals slider + per-card mini image nav + Quick View */

.section-title {
  display: flex;
  text-align: center;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 40px;
}

.section-title .view-all {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: underline;
  color: #b06a5a;
}

.new-arrivals-slider {
  position: relative;
  padding: 0 40px;
}

.slider-viewport {
  overflow: hidden;
}

.product-grid {
  display: flex;
  gap: 20px;
  transition: transform 0.4s ease;
  will-change: transform;
}

.product-card {
  position: relative;
  flex: 0 0 300px;
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Outer prev/next arrows for the whole row */
.slider-arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 6;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-arrow:hover {
  background: #fff;
}

.slider-prev {
  left: 0;
}

.slider-next {
  right: 0;
}

/* Product image + mini carousel arrows + Quick View */
.product-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

.product-image-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.product-card:hover .product-image-wrap::before {
  opacity: 1;
}

.product-image-wrap .product-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1);
  transition: opacity 0.35s ease, transform 0.6s ease;
  pointer-events: none;
  cursor: pointer;
}

.product-image-wrap .product-image.active {
  opacity: 1;
  pointer-events: auto;
}

.product-card:hover .product-image-wrap .product-image.active {
  transform: scale(1.06);
}

.mini-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.25s ease;
}

.mini-arrow:hover {
  background: rgba(255, 255, 255, 0.95);
}

.mini-prev {
  left: 12px;
}

.mini-next {
  right: 12px;
}

.product-card:hover .mini-arrow {
  opacity: 1;
}

.quick-view {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 10px);
  opacity: 0;
  z-index: 3;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 24px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-card:hover .quick-view {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Static wrapping grid (category pages: Formals, Bridals, etc.) ---------- */
.section-title.centered {
  justify-content: center;
  text-align: center;
  padding: 30px 40px;
}

.section-title.centered h3 {
  font-family: "Playfair Display", serif;
  text-align: center;
  font-size: 22px;
  font-weight: 400;
}

.product-grid.static-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0 40px 60px;
  transform: none !important;
}

.sold-out-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  background: #fff;
  color: #333;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 12px;
}

@media (max-width: 900px) {
  .product-grid.static-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 16px 40px;
  }
}

@media (max-width: 480px) {
  .product-grid.static-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .section-title,
  .new-arrivals-slider {
    padding: 0 16px;
  }

  .product-card {
    flex: 0 0 220px;
    min-width: 220px;
  }

  .slider-arrow {
    width: 34px;
    height: 34px;
  }

  .slider-prev {
    left: 8px;
  }

  .slider-next {
    right: 8px;
  }

  .product-grid {
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .section-title,
  .new-arrivals-slider {
    padding: 0 12px;
  }

  .product-card {
    flex: 0 0 180px;
    min-width: 180px;
  }

  .slider-arrow {
    width: 30px;
    height: 30px;
    top: auto;
    bottom: 14px;
    transform: none;
  }

  .slider-prev {
    left: 6px;
  }

  .slider-next {
    right: 6px;
  }

  .product-grid.static-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 40px;
  }
}

/* ---------- Image preview modal (opens on image click) ---------- */
.iv-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}

.iv-backdrop.open {
  display: flex;
}

.iv-box {
  position: relative;
  background: #fff;
  width: min(450px, 92vw);
  max-height: 90vh;
  padding: 0 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}

.iv-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 3;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #333;
}

.iv-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 70vh;
  background: #f4f4f4;
  overflow: hidden;
}

.iv-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.iv-img.active {
  opacity: 1;
}

.iv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(23, 22, 22, 0.85);
  cursor: pointer;
  font-size: 14px;
}

.iv-nav:hover {
  background: #fff;
}

.iv-prev {
  left: 12px;
}

.iv-next {
  right: 12px;
}

.iv-name {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  margin-top: 20px;
}

.iv-price {
  font-size: 15px;
  color: #555;
  margin-top: 4px;
}

@media (max-width: 600px) {
  .iv-box {
    max-height: 95vh;
  }
}