/* ==========================================================================
   MIKVÉLIB - FRONT UI (Version Finale Parfaite - Luxe / Apple)
   ========================================================================== */

.mkl-widget,
.mkl-widget * {
  box-sizing: border-box;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.mkl-widget {
  --mkl-primary: #6f4e37;
  --mkl-secondary: #b38b59;
  --mkl-bg: #f8f3ee;
  --mkl-ink: #1c1c1e;
  --mkl-muted: #8e8e93;
  --mkl-line: rgba(111, 78, 55, 0.15);
  --mkl-radius: 16px;
  color: var(--mkl-ink);
}

.mkl-widget button, .mkl-widget input, .mkl-widget textarea { font-family: inherit; outline: none !important; }

/* BADGES & PRIX */
.mkl-badge {
  display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 8px;
  background: rgba(111, 78, 55, 0.08) !important; color: var(--mkl-primary) !important;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.mkl-price, .mkl-price * { font-size: 22px; font-weight: 600; color: var(--mkl-ink); }

/* BOUTONS ACTIONS */
.mkl-open-button, .mkl-open-service, .mkl-primary-btn, .mkl-submit {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border: none !important; border-radius: 10px;
  background: var(--mkl-primary) !important; color: #fff !important; font-size: 15px !important;
  font-weight: 600 !important; cursor: pointer; transition: all 0.3s ease; text-align: center;
}
.mkl-open-button:hover, .mkl-open-service:hover, .mkl-primary-btn:hover, .mkl-submit:hover {
  background: var(--mkl-secondary) !important; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(111, 78, 55, 0.25) !important;
}

/* État désactivé (Grisé) pour le bouton Continuer */
.mkl-primary-btn[disabled], .mkl-submit[disabled] {
  background: #d1d1d6 !important; 
  color: #8e8e93 !important;
  cursor: not-allowed;
  opacity: 1 !important;
  transform: none !important;
  box-shadow: none !important;
}

.mkl-secondary-btn {
  display: inline-flex !important; align-items: center; justify-content: center; min-height: 48px;
  padding: 12px 24px; border-radius: 10px; border: 1px solid var(--mkl-line) !important;
  background: #fff !important; color: var(--mkl-ink) !important; font-size: 15px !important;
  font-weight: 600 !important; cursor: pointer; transition: all 0.3s ease; text-align: center;
}
.mkl-secondary-btn:hover { background: var(--mkl-bg) !important; border-color: var(--mkl-primary) !important; color: var(--mkl-primary) !important; }

/* ==========================================================================
   CAROUSEL CLASSIQUE
   ========================================================================== */
.mkl-service-grid {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 360px);
  gap: 20px; overflow-x: auto; overflow-y: hidden; padding: 10px 4px 24px;
  -webkit-overflow-scrolling: touch; cursor: grab;
}
.mkl-service-grid::-webkit-scrollbar { display: none; }
.mkl-service-grid.is-dragging { cursor: grabbing; }

.mkl-service-card, .mkl-launch-card {
  position: relative; border-radius: var(--mkl-radius); overflow: hidden;
  background: var(--mkl-ink); border: 1px solid var(--mkl-line);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15); display: flex; flex-direction: column;
  min-height: 460px;
}
.mkl-service-card__media, .mkl-launch-card__media { position: absolute; inset: 0; z-index: 1; }
.mkl-service-card__media img, .mkl-launch-card__media img { width: 100%; height: 100%; object-fit: cover; }
.mkl-service-card::after, .mkl-launch-card::after {
  content: ''; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(111,78,55,0.6) 50%, rgba(54,34,20,0.95) 100%);
}

.mkl-service-card__body, .mkl-launch-card__content { position: relative; z-index: 3; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; flex-grow: 1; color: #fff; }

/* STICKER / BADGE BLANC SUR CAROUSEL */
.mkl-service-card .mkl-badge, .mkl-launch-card .mkl-badge {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.2) !important;
  align-self: flex-start;
  margin-bottom: 12px;
}

.mkl-service-card__body h3, .mkl-launch-card__content h3 { margin: 0 0 8px; font-size: 26px; font-weight: 700; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.mkl-service-card__body p, .mkl-launch-card__content p { margin: 0 0 20px; color: rgba(255,255,255,0.85); font-size: 14px; line-height: 1.5; }

/* FILET ENLEVÉ */
.mkl-service-card__footer, .mkl-launch-card__footer { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; margin-top: auto; }

/* PRIX BLANC FORCÉ POUR WOOCOMMERCE */
.mkl-service-card__footer .mkl-price, .mkl-service-card__footer .mkl-price *,
.mkl-launch-card__footer .mkl-price, .mkl-launch-card__footer .mkl-price * { color: #fff !important; }

/* ==========================================================================
   MODAL / POPUP
   ========================================================================== */
.mkl-modal { position: fixed; inset: 0; z-index: 999999; }
.mkl-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); }
.mkl-modal__dialog {
  position: relative; z-index: 2; width: min(1100px, calc(100vw - 32px)); height: min(760px, calc(100vh - 32px));
  margin: 16px auto; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.mkl-modal__inner { display: grid; grid-template-columns: 340px 1fr; height: 100%; }

/* CROIX DE FERMETURE ÉNORME */
.mkl-modal__close {
  position: absolute; top: 16px; right: 16px; z-index: 9999999; width: 48px; height: 48px; border-radius: 50%;
  background: #fff !important; border: 1px solid var(--mkl-line) !important; display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important; transition: all 0.2s ease;
}
.mkl-modal__close svg { width: 22px; height: 22px; stroke: var(--mkl-ink) !important; stroke-width: 2.5px !important; fill: none !important; }
.mkl-modal__close:hover { background: var(--mkl-bg) !important; transform: translateY(-1px); }

/* HERO GAUCHE */
.mkl-modal__hero { position: relative; background: var(--mkl-primary); border-right: 1px solid var(--mkl-line); height: 100%; overflow: hidden; }
.mkl-stage { height: 100%; }
.mkl-stage-card { position: relative; height: 100%; display: flex; flex-direction: column; }
.mkl-stage-media { position: absolute; inset: 0; z-index: 1; }
.mkl-stage-media__image { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s ease; }
.mkl-stage-media__image.is-active { opacity: 1; }
.mkl-stage-media__image img { width: 100%; height: 100%; object-fit: cover; }
.mkl-stage-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.8) 100%); z-index: 2; }
.mkl-stage-summary { position: absolute; bottom: 0; left: 0; right: 0; padding: 24px; z-index: 3; color: #fff; }
.mkl-stage-summary h3 { font-size: 26px; font-weight: 700; margin: 10px 0; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.mkl-stage-summary p { font-size: 13px; color: rgba(255,255,255,0.8); margin-bottom: 16px; line-height: 1.4; }
.mkl-stage-summary .mkl-price * { color: #fff !important; }
.mkl-stage-mini__row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.2); font-size: 12px; }
.mkl-stage-mini__row span { color: rgba(255,255,255,0.6); }
.mkl-stage-mini__row strong { font-weight: 500; color: #fff; text-align: right; max-width: 60%; }

/* CONTENU DROITE (Aéré) */
.mkl-modal__body { display: flex; flex-direction: column; padding: 24px; background: #fafafa; height: 100%; overflow: hidden; }
.mkl-modal__title { margin: 0 0 16px 0; font-size: 24px; font-weight: 700; color: var(--mkl-ink); line-height: 1.1; }

/* BARRE DE PROGRESSION */
.mkl-steps { display: flex; gap: 8px; margin-bottom: 16px; }
.mkl-step-pill {
  flex: 1; display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  background: #fff !important; border: 1px solid var(--mkl-line) !important; border-radius: 8px;
  color: var(--mkl-muted) !important; font-size: 13px; font-weight: 500 !important; box-shadow: none !important;
}
.mkl-step-pill strong { font-weight: 500 !important; }
.mkl-step-pill.is-active { background: var(--mkl-bg) !important; border-color: var(--mkl-primary) !important; color: var(--mkl-primary) !important; }

/* ANIMATIONS & PANNEAUX */
.mkl-step-shell { flex: 1; overflow: hidden; position: relative; }
.mkl-step-track { height: 100%; }
.mkl-step-panel { display: none; height: 100%; overflow-y: auto; overflow-x: hidden; padding-right: 10px; flex-direction: column; padding-bottom: 10px; }

@keyframes mklStepFadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.mkl-step-panel.is-active { display: flex; animation: mklStepFadeIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* BOUTONS ACTIONS FIXES EN BAS (Espace libéré + Fond Opaque) */
.mkl-step-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding: 16px 0; border-top: 1px solid var(--mkl-line);
  position: sticky; bottom: -2px; background: #fafafa !important; z-index: 10;
}
.mkl-step-actions--end { justify-content: flex-end; }

/* ÉTAPE 1 : OFFRES */
.mkl-inline-service-grid { display: flex; flex-direction: column; gap: 10px; width: 100%; padding-bottom: 60px; }
.mkl-inline-service {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 20px;
  background: #fff !important; border: 1px solid var(--mkl-line) !important; border-radius: 12px;
  cursor: pointer; transition: all 0.2s; text-align: left; width: 100%;
}
.mkl-inline-service:hover { border-color: var(--mkl-primary) !important; box-shadow: 0 4px 12px rgba(111,78,55,0.06) !important; }
.mkl-inline-service.is-selected { border-color: var(--mkl-primary) !important; background: var(--mkl-bg) !important; box-shadow: 0 0 0 2px rgba(111,78,55,0.1) !important; }
.mkl-inline-service__meta { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; gap: 12px; flex-wrap: wrap; }
.mkl-inline-service__meta strong { font-size: 16px; font-weight: 700; color: var(--mkl-ink) !important; margin: 0; white-space: normal !important; overflow-wrap: anywhere !important; word-break: break-word !important; line-height: 1.3; flex: 1; }
.mkl-inline-service__meta small, .mkl-inline-service__meta small * { font-size: 15px; font-weight: 600; color: var(--mkl-ink) !important; white-space: nowrap; flex-shrink: 0; }
.mkl-inline-service-bottom { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; gap: 12px; }
.mkl-inline-service p { margin: 0; font-size: 13px; color: var(--mkl-muted) !important; line-height: 1.5; flex-grow: 1; white-space: normal !important; overflow-wrap: anywhere; word-break: normal; }
.mkl-inline-service .mkl-badge { flex-shrink: 0; margin-top: 2px; }

/* ÉTAPE 2 : CALENDRIER */
.mkl-calendar-layout { display: flex; flex-direction: column; gap: 16px; padding-bottom: 20px; }
.mkl-calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mkl-month-nav { display: flex; align-items: center; gap: 16px; }
.mkl-month-title { font-size: 16px; font-weight: 600; color: var(--mkl-ink) !important; text-transform: capitalize; }

/* FLÈCHES PUR CSS */
.mkl-month-btn { 
  background: #fff !important; border: 1px solid var(--mkl-line) !important; border-radius: 6px; 
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; 
  position: relative !important; overflow: visible !important; visibility: visible !important; opacity: 1 !important;
}
.mkl-month-btn svg { display: none !important; }
.mkl-month-btn[data-month-nav="prev"]::after {
  content: "" !important; display: block !important; width: 9px !important; height: 9px !important;
  border-left: 2.5px solid var(--mkl-primary) !important; border-bottom: 2.5px solid var(--mkl-primary) !important;
  transform: rotate(45deg) !important; position: absolute !important; top: 50% !important; left: 50% !important;
  margin-top: -5px !important; margin-left: -2px !important; visibility: visible !important;
}
.mkl-month-btn[data-month-nav="next"]::after {
  content: "" !important; display: block !important; width: 9px !important; height: 9px !important;
  border-right: 2.5px solid var(--mkl-primary) !important; border-bottom: 2.5px solid var(--mkl-primary) !important;
  transform: rotate(-45deg) !important; position: absolute !important; top: 50% !important; left: 50% !important;
  margin-top: -5px !important; margin-left: -6px !important; visibility: visible !important;
}

.mkl-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 10px; font-weight: 600; color: var(--mkl-muted); margin-bottom: 4px; }
.mkl-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mkl-day-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff !important; border: 1px solid var(--mkl-line) !important; border-radius: 6px;
  padding: 4px 2px; min-height: 48px; cursor: pointer; transition: all 0.2s; color: var(--mkl-ink) !important;
}
.mkl-day-card:hover:not(.is-disabled) { border-color: var(--mkl-primary) !important; background: var(--mkl-bg) !important; }
.mkl-day-card.is-selected { background: var(--mkl-primary) !important; border-color: var(--mkl-primary) !important; }
.mkl-day-card.is-selected .mkl-day-card__day, .mkl-day-card.is-selected .mkl-day-card__meta { color: #fff !important; }
.mkl-day-card.is-disabled { opacity: 0.4; cursor: not-allowed; background: #f5f5f5 !important; }
.mkl-day-card__weekday, .mkl-day-card__status { display: none; }
.mkl-day-card__day { font-size: 16px; font-weight: 600; }
.mkl-day-card__meta { font-size: 9px; color: var(--mkl-muted); text-align: center; margin-top: 2px; }

/* SLOTS */
.mkl-slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin-top: 4px; }
.mkl-slot-chip {
  padding: 10px; text-align: center; border-radius: 8px; border: 1px solid var(--mkl-line) !important;
  background: #fff !important; font-size: 13px !important; font-weight: 600 !important; color: var(--mkl-ink) !important; cursor: pointer;
}
.mkl-slot-chip:hover { border-color: var(--mkl-primary) !important; }
.mkl-slot-chip.is-selected { background: var(--mkl-primary) !important; color: #fff !important; border-color: var(--mkl-primary) !important; }

/* ÉTAPE 3 : FINALISATION */
.mkl-summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; background: #fff; border: 1px solid var(--mkl-line); border-radius: var(--mkl-radius); padding: 20px; margin-bottom: 20px; }
.mkl-summary-tile { padding: 0; border: none; background: transparent; }
.mkl-summary-tile span { display: block; margin-bottom: 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mkl-muted); }
.mkl-summary-tile strong, .mkl-summary-tile strong * { display: block; font-size: 15px !important; font-weight: 600 !important; color: var(--mkl-ink) !important; display: inline !important; line-height: 1.4; }
.mkl-payment-box { background: #fff; border: 1px solid var(--mkl-line); border-radius: var(--mkl-radius); padding: 20px; margin-bottom: 20px; }
.mkl-payment-box h4 { margin: 0 0 10px 0; font-size: 16px; font-weight: 600; color: var(--mkl-ink) !important; }
.mkl-payment-note { padding: 12px; border-radius: 8px; background: var(--mkl-bg); color: var(--mkl-ink); font-size: 12px; line-height: 1.5; margin-bottom: 12px; border: none; }
.mkl-payment-toggle { display: flex; flex-direction: column; gap: 8px; }
.mkl-payment-toggle label { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 8px; background: #fff; border: 1px solid var(--mkl-line); font-weight: 600; font-size: 13px; cursor: pointer; color: var(--mkl-ink); transition: all 0.2s; }
.mkl-payment-toggle label:hover { border-color: var(--mkl-primary); }
.mkl-payment-toggle input { accent-color: var(--mkl-primary); }
.mkl-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; padding-bottom: 40px; }
.mkl-field span { font-size: 12px; font-weight: 600; color: var(--mkl-ink) !important; }
.mkl-field textarea { min-height: 80px; padding: 12px; border-radius: 8px; border: 1px solid var(--mkl-line) !important; background: #fff !important; color: var(--mkl-ink) !important; resize: vertical; font-size: 13px; }
.mkl-field textarea:focus { border-color: var(--mkl-primary) !important; box-shadow: 0 0 0 2px rgba(111,78,55,0.1) !important; outline: none; }

/* MESSAGES */
.mkl-message, .mkl-callback-banner, .mkl-empty-state, .mkl-loading { padding: 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; text-align: center; }
.mkl-message.is-error { background: #fff0f0 !important; color: #d32f2f !important; border: 1px solid rgba(211,47,47,0.2); }
.mkl-message.is-info, .mkl-empty-state, .mkl-loading { background: var(--mkl-bg) !important; color: var(--mkl-muted) !important; }

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .mkl-modal__dialog { width: calc(100vw - 16px); height: calc(100vh - 16px); margin: 8px auto; border-radius: 20px; }
  .mkl-modal__inner { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  
  .mkl-modal__hero { height: 180px; border-right: none; border-bottom: 1px solid var(--mkl-line); }
  .mkl-stage-summary .mkl-badge { display: none !important; } 
  
  /* Croix de fermeture ÉNORME SUR MOBILE */
  .mkl-modal__close { width: 52px; height: 52px; top: 12px; right: 12px; }
  .mkl-modal__close svg { width: 24px; height: 24px; stroke-width: 3px !important; }
  
  .mkl-stage-summary { padding: 16px; }
  .mkl-stage-summary h3 { font-size: 22px; margin: 0; }
  .mkl-stage-mini { display: none; }
  .mkl-modal__body { padding: 16px; }
  .mkl-modal__title { font-size: 22px; margin-bottom: 12px; }
  
  .mkl-inline-service__meta { flex-direction: column !important; align-items: flex-start !important; gap: 4px !important; }
  .mkl-inline-service__meta strong { font-size: 15px; width: 100% !important; flex: none !important; }
  .mkl-inline-service__meta small { align-self: flex-start !important; }
  
  .mkl-inline-service-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
  
  .mkl-summary-grid { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  
  .mkl-step-actions { flex-direction: column; gap: 12px; padding-top: 12px; }
  .mkl-step-actions button { width: 100%; min-height: 52px; }
}