/* KIRA - Product Color Selector Styles */

.product-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}

.color-selector-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
}

.color-selector-btn:hover {
  border-color: #0d0d0d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-selector-btn.active {
  border-color: #0d0d0d;
  background: #0d0d0d;
  color: #fff;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.color-selector-btn.active .color-dot {
  border-color: rgba(255, 255, 255, 0.3);
}

.color-name {
  white-space: nowrap;
}

/* ── Product Gallery ─────────────────────────────────── */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Conteneur image principale — ratio fixe via padding-top */
.product-main-image {
  position: relative;
  width: 100%;
  padding-top: 125%;   /* ratio 4:5 → stable sur tous les navigateurs */
  overflow: hidden;
  background: #f5f4f0;
}

/* L'image remplit exactement le cadre — jamais de déformation */
.product-main-image img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ── Thumbnails ──────────────────────────────────────── */
.product-thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 4px;
  scrollbar-width: none;
}
.product-thumbnails::-webkit-scrollbar { display: none; }

.thumbnail {
  flex-shrink: 0;
  width: 64px;
  height: 80px;
  border: 1.5px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #f5f4f0;
  padding: 0;
  transition: border-color 0.2s;
}
.thumbnail:hover  { border-color: rgba(0,0,0,.35); }
.thumbnail.active { border-color: #1F1D1B; }

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .product-colors   { gap: 8px; }
  .color-selector-btn { padding: 8px 12px; font-size: 13px; }
  .color-dot        { width: 20px; height: 20px; }

  /* Ratio légèrement plus court sur mobile (4:5) — déjà défini */
  .product-main-image { padding-top: 125%; }

  .thumbnail { width: 54px; height: 72px; }
}

/* Animation pour le changement d'image */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.product-main-image.changing img {
  animation: fadeIn 0.3s ease;
}
/* PRODUCT GALLERY: keep layout stable */
.pdp{
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

@media (max-width: 980px){
  .pdp{ grid-template-columns: 1fr; }
}

/* Main image box never grows because of thumbnails */
.pdp .gallery,
.pdp .pdp-gallery{
  max-width: 560px;         /* fixe la colonne image */
  width: 100%;
}

.pdp .main-media,
.pdp .pdp-main,
.pdp .gallery-main{
  width: 100%;
  aspect-ratio: 4 / 5;      /* même ratio que tes photos */
  overflow: hidden;
  border-radius: 18px;
  background: #f6f6f6;
}

.pdp .main-media img,
.pdp .pdp-main img,
.pdp .gallery-main img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Right column must not shrink too much */
.pdp .details,
.pdp .pdp-info{
  min-width: 320px;
}/* Thumbnails strip under main image */
.thumbs-wrap{
  margin-top: 12px;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 10px;
}

.thumbs{
  display: flex;
  gap: 10px;
  overflow: hidden; /* on masque le surplus, on scroll en JS */
}

.thumb{
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
}

.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb.is-active{
  outline: 2px solid rgba(0,0,0,.25);
  outline-offset: 2px;
}

.thumb-nav{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.thumb-nav[disabled]{
  opacity: .35;
  cursor: default;
}
