/* =================================================================
   KM BEAUTY - CONFIGURATEUR
   Styles du configurateur d'ongles sur-mesure
   Chargé UNIQUEMENT sur la page /sur-mesure
   =================================================================== */

/* =================================================================
   22. LONGUEURS (POP-UP CONFIGURATEUR)
   =================================================================== */
.km-lengths-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.km-length-btn {
  background: var(--white, #ffffff);
  border: 2px solid #f2e8e8;
  color: var(--dark-text, #2c2c2c);
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  flex: 1;
  min-width: 100px;
  text-align: center;
}

.km-length-btn:hover {
  border-color: var(--rose-gold, #b76e79);
  background: var(--rose-gold-light, #f7ebe8);
  color: var(--rose-gold-dark, #8e4a54);
}

.km-length-btn.active {
  background: var(--rose-gold, #b76e79);
  color: var(--white, #ffffff);
  border-color: var(--rose-gold, #b76e79);
  box-shadow: 0 4px 12px rgba(183, 110, 121, 0.3);
}

/* Image d'aperçu */
.km-preview-image {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid #f2e8e8;
}

.km-preview-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.km-preview-caption {
  text-align: center;
  font-size: 11px;
  color: #888;
  font-style: italic;
  margin-top: 8px;
  margin-bottom: 0;
}

/* Bloc guide de mesure */
.km-guide-info {
  background: var(--rose-gold-light, #f7ebe8);
  border-left: 3px solid var(--rose-gold, #b76e79);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.km-guide-info .km-kit-icon {
  font-size: 28px;
  line-height: 1;
}

.km-guide-info .km-kit-text {
  font-size: 13px;
  color: var(--rose-gold-dark, #8e4a54);
  line-height: 1.5;
}

.km-guide-info .km-kit-text strong {
  color: var(--rose-gold-dark, #8e4a54);
  font-weight: 700;
}

.km-guide-info .km-kit-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--rose-gold-dark, #8e4a54);
  font-weight: 600;
  text-decoration: underline;
}

.km-guide-info .km-kit-link:hover {
  color: var(--rose-gold, #b76e79);
}

/* =================================================================
   25. GUIDE DE MESURE INTERACTIF
   =================================================================== */
.km-guide-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  box-sizing: border-box;
}

.km-guide-popup {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: kmGuideFadeIn 0.3s ease;
}

@keyframes kmGuideFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.km-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px;
  border-bottom: 1px solid #f0e6e6;
  background: linear-gradient(135deg, #f7ebe8 0%, #ffffff 100%);
}

.km-guide-header h3 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  color: #0f172a;
}

.km-guide-close {
  background: none;
  border: none;
  font-size: 26px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0 5px;
  transition: color 0.2s;
}

.km-guide-close:hover {
  color: #b76e79;
}

.km-guide-body {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
}

.km-guide-step {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #f8fafc;
}

.km-guide-step:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.km-guide-step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #b76e79;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  font-family: 'Montserrat', Arial, sans-serif;
}

.km-guide-step-content {
  flex: 1;
  min-width: 0;
}

.km-guide-step-content h4 {
  margin: 0 0 8px 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  color: #0f172a;
}

.km-guide-step-content p {
  margin: 0 0 10px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
}

.km-guide-step-content strong {
  color: #b76e79;
  font-weight: 700;
}

.km-guide-list {
  margin: 0 0 12px 0;
  padding: 0;
  list-style: none;
}

.km-guide-list li {
  font-size: 14px;
  line-height: 1.8;
  color: #475569;
}

.km-guide-tip {
  background: #faf8f5;
  border-left: 3px solid #b76e79;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px !important;
  color: #8e4a54 !important;
  margin-top: 10px !important;
}

.km-guide-image {
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #f0e6e6;
}

.km-guide-image img {
  width: 100%;
  height: auto;
  display: block;
}

.km-guide-footer {
  padding: 20px 25px;
  border-top: 1px solid #f0e6e6;
  background: #faf8f5;
}

.km-guide-close-btn {
  width: 100%;
  padding: 15px;
  background: #b76e79;
  color: #ffffff;
  border: none;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: 'Montserrat', Arial, sans-serif;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(183, 110, 121, 0.25);
}

.km-guide-close-btn:hover {
  background: #8e4a54;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(183, 110, 121, 0.35);
}

@media (max-width: 600px) {
  .km-guide-popup { max-height: 95vh; }
  .km-guide-body { padding: 20px 18px; }
  .km-guide-header h3 { font-size: 17px; }
  .km-guide-step-content h4 { font-size: 15px; }
  .km-guide-step-content p { font-size: 13px; }
}

/* =================================================================
   26. APERÇU EN TEMPS RÉEL DU SET
   =================================================================== */
.km-preview-wrapper {
  background: linear-gradient(135deg, #fdf6f5 0%, #faf8f5 50%, #ffffff 100%);
  border: 1px solid #f2e8e8;
  border-radius: 20px;
  padding: 30px 20px;
  margin-bottom: 25px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(183, 110, 121, 0.08);
}

.km-preview-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.km-preview-hands {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
}

.km-preview-hand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.km-preview-hand-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #b76e79;
  margin-bottom: 15px;
}

.km-preview-fingers {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: flex-end;
}

.km-preview-finger {
  width: 55px;
  height: 90px;
  background: #ffffff;
  border: 2px solid #e2bcbf;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  box-sizing: border-box;
  padding: 3px;
  border-radius: 50% 50% 40% 40% / 60% 60% 25% 25%;
}

.km-preview-finger.shape-amande {
  border-radius: 50% 50% 45% 45% / 65% 65% 20% 20%;
}

.km-preview-finger.shape-coffin {
  border-radius: 30% 30% 10% 10% / 40% 40% 5% 5%;
}

.km-preview-finger.shape-carre {
  border-radius: 25% 25% 8% 8% / 30% 30% 5% 5%;
}

.km-preview-finger.shape-carre_arrondi {
  border-radius: 35% 35% 15% 15% / 40% 40% 10% 10%;
}

.km-preview-finger.shape-rond {
  border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
}

.km-preview-finger.shape-stiletto {
  border-radius: 50% 50% 5% 5% / 70% 70% 2% 2%;
}

.km-preview-finger.empty::before {
  content: "+";
  font-size: 20px;
  color: #d4b5b8;
  font-weight: 300;
}

.km-preview-finger.filled {
  border-color: #b76e79;
  box-shadow: 0 6px 16px rgba(183, 110, 121, 0.25);
}

.km-preview-finger svg,
.km-preview-finger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transition: all 0.3s ease;
}

.km-preview-finger[data-finger*="pouce"] { height: 75px; }
.km-preview-finger[data-finger*="index"] { height: 95px; }
.km-preview-finger[data-finger*="majeur"] { height: 100px; }
.km-preview-finger[data-finger*="annulaire"] { height: 95px; }
.km-preview-finger[data-finger*="auriculaire"] { height: 80px; }

/* =================================================================
   RESPONSIVE CONFIGURATEUR
   =================================================================== */
@media (max-width: 768px) {
  .km-builder-body,
  .sm-main-layout { flex-direction: column; }

  .km-sidebar-categories,
  .sm-sidebar-categories {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .km-cat-tab,
  .sm-cat-item { white-space: nowrap; }

  .km-hands-wrapper {
    padding: 15px 10px;
    gap: 15px;
  }

  .km-hand { min-width: 100%; }
  .km-fingers-row { gap: 6px; }
  .km-finger-circle { width: 48px; }
  .km-finger-inner { width: 44px; height: 44px; }

  .km-lengths-grid {
    flex-direction: column;
    width: 100%;
  }
  .km-length-btn {
    width: 100%;
    min-width: auto;
  }
  .km-preview-image {
    max-width: 100%;
  }

  .km-preview-hands { gap: 25px; }
  .km-preview-finger { width: 42px; }
  .km-preview-finger[data-finger*="pouce"] { height: 60px; }
  .km-preview-finger[data-finger*="index"],
  .km-preview-finger[data-finger*="annulaire"] { height: 75px; }
  .km-preview-finger[data-finger*="majeur"] { height: 80px; }
  .km-preview-finger[data-finger*="auriculaire"] { height: 65px; }
  .km-preview-title { font-size: 15px; }
}