/* ============================================================
   Auto Perfectionnement – Réservation v1.6.0
   Design amélioré : plus moderne, plus lisible, plus soigné
   ============================================================ */

.ap-reservation,
.ap-reservation * {
  box-sizing: border-box;
}

.ap-reservation {
  --ap-red:        #e8292d;
  --ap-red-hover:  #c4191d;
  --ap-red-soft:   #fff0f0;
  --ap-red-border: #ffc8c8;
  --ap-border:     #e4e8ef;
  --ap-muted:      #64748b;
  --ap-text:       #0f172a;
  --ap-bg:         #f8fafc;
  --ap-white:      #ffffff;
  --ap-shadow-sm:  0 1px 3px rgba(15,23,42,.08);
  --ap-shadow-md:  0 4px 16px rgba(15,23,42,.10);
  --ap-shadow-red: 0 4px 18px rgba(232,41,45,.18);
  --ap-radius:     14px;
  --ap-radius-sm:  9px;
  --ap-transition: .18s ease;

  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
  width: 100%;
  color: var(--ap-text);
  font-family: inherit;
}

/* ── Cards ── */
.ap-card {
  background: var(--ap-white);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  box-shadow: var(--ap-shadow-md);
  padding: 28px;
}

.ap-section + .ap-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--ap-border);
}

/* ── Labels ── */
.ap-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ap-muted);
}

.ap-label--icon span:first-child {
  width: 18px;
  font-size: 16px;
  color: var(--ap-red);
  line-height: 1;
}

/* ── Select ── */
.ap-select-wrap {
  position: relative;
}

.ap-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ap-muted);
  font-size: 13px;
}

.ap-select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-white);
  box-shadow: var(--ap-shadow-sm);
  padding: 0 36px 0 14px;
  font-size: 14px;
  color: var(--ap-text);
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color var(--ap-transition), box-shadow var(--ap-transition);
}

.ap-select:focus {
  border-color: var(--ap-red);
  box-shadow: 0 0 0 3px rgba(232,41,45,.12);
}

/* ── Calendar ── */
.ap-calendar {
  width: 100%;
  max-width: 290px;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  padding: 20px;
  background: var(--ap-bg);
}

.ap-calendar__head {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  margin-bottom: 18px;
}

.ap-calendar__month {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ap-text);
  text-transform: capitalize;
}

.ap-cal-nav {
  appearance: none;
  border: 1px solid var(--ap-border);
  background: var(--ap-white);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ap-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--ap-transition), border-color var(--ap-transition);
}

.ap-cal-nav:hover {
  background: var(--ap-red-soft);
  border-color: var(--ap-red-border);
  color: var(--ap-red);
}

.ap-calendar__weekdays,
.ap-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px 4px;
  text-align: center;
}

.ap-calendar__weekdays {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ap-muted);
}

.ap-day {
  appearance: none;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ap-text);
  font-size: 13px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  transition: background var(--ap-transition), color var(--ap-transition);
}

.ap-day:hover:not(:disabled):not(.is-other-month) {
  background: var(--ap-red-soft);
  color: var(--ap-red);
}

.ap-day.is-other-month {
  color: #cbd5e1;
  pointer-events: none;
}

.ap-day.is-today:not(.is-selected) {
  background: var(--ap-red-soft);
  color: var(--ap-red);
  font-weight: 700;
}

.ap-day.is-selected {
  background: var(--ap-red);
  color: var(--ap-white);
  font-weight: 700;
  box-shadow: var(--ap-shadow-red);
}

/* ── Slots ── */
.ap-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}

.ap-slot {
  appearance: none;
  min-height: 40px;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-white);
  box-shadow: var(--ap-shadow-sm);
  color: var(--ap-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ap-transition), color var(--ap-transition), border-color var(--ap-transition), transform var(--ap-transition);
}

.ap-slot:hover:not(:disabled):not(.is-unavailable) {
  background: var(--ap-red-soft);
  border-color: var(--ap-red-border);
  color: var(--ap-red);
  transform: translateY(-1px);
}

.ap-slot.is-selected {
  background: var(--ap-red);
  border-color: var(--ap-red);
  color: var(--ap-white);
  box-shadow: var(--ap-shadow-red);
  transform: translateY(-1px);
}

.ap-slot.is-unavailable,
.ap-slot:disabled {
  opacity: .45;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
  border-color: var(--ap-border);
  box-shadow: none;
  transform: none;
}

.ap-slot.is-unavailable {
  font-size: 10px;
  line-height: 1.2;
  padding: 4px 6px;
}

/* ── Notes ── */
.ap-notes {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ap-text);
  outline: none;
  box-shadow: var(--ap-shadow-sm);
  transition: border-color var(--ap-transition), box-shadow var(--ap-transition);
  font-family: inherit;
}

.ap-notes:focus {
  border-color: var(--ap-red);
  box-shadow: 0 0 0 3px rgba(232,41,45,.12);
}

.ap-notes::placeholder {
  color: #94a3b8;
}

/* ── Summary Card ── */
.ap-summary-card {
  background: var(--ap-white);
  border: 1px solid var(--ap-red-border);
  border-radius: var(--ap-radius);
  box-shadow: var(--ap-shadow-red);
  padding: 28px 24px 24px;
  position: sticky;
  top: 24px;
}

.ap-summary-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
  color: var(--ap-text);
  letter-spacing: -.01em;
}

.ap-summary-divider {
  height: 1px;
  background: var(--ap-border);
  margin: 14px 0 18px;
}

.ap-summary-row,
.ap-summary-total {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 14px;
}

.ap-summary-row span {
  color: var(--ap-muted);
  white-space: nowrap;
}

.ap-summary-row strong {
  font-weight: 500;
  text-align: right;
  line-height: 1.4;
}

.ap-summary-total {
  border-top: 2px solid var(--ap-red-soft);
  padding-top: 14px;
  margin-top: 8px;
  font-size: 17px;
  font-weight: 800;
}

.ap-summary-total span {
  color: var(--ap-text);
}

.ap-summary-total strong {
  color: var(--ap-red);
  font-size: 20px;
}

/* ── Inclusions ── */
.ap-inclusions {
  list-style: none;
  margin: 18px 0;
  padding: 0;
  background: var(--ap-bg);
  border-radius: var(--ap-radius-sm);
  padding: 12px 14px;
}

.ap-inclusions li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 7px 0;
  font-size: 12.5px;
  color: #334155;
}

.ap-inclusions li:first-child { margin-top: 0; }
.ap-inclusions li:last-child  { margin-bottom: 0; }

.ap-inclusions span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ap-red-soft);
  color: var(--ap-red);
  font-size: 10px;
  font-weight: 700;
}

/* ── Caution Box ── */
.ap-caution-box {
  margin: 0 0 18px;
  padding: 14px 14px;
  border: 1px solid var(--ap-red-border);
  border-left: 4px solid var(--ap-red);
  border-radius: var(--ap-radius-sm);
  background: #fff9f9;
}

.ap-caution-box strong {
  display: block;
  color: var(--ap-red);
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.ap-caution-box p {
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 5px;
  color: #374151;
}

.ap-caution-box small {
  font-size: 11px;
  color: var(--ap-muted);
}

/* ── Confirm Button ── */
.ap-confirm {
  appearance: none;
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: var(--ap-radius-sm);
  background: var(--ap-red);
  color: var(--ap-white);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: var(--ap-shadow-red);
  cursor: pointer;
  transition: background var(--ap-transition), transform var(--ap-transition), box-shadow var(--ap-transition);
}

.ap-confirm:hover:not(:disabled) {
  background: var(--ap-red-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(232,41,45,.28);
}

.ap-confirm:active:not(:disabled) {
  transform: translateY(0);
}

.ap-confirm:disabled {
  cursor: not-allowed;
  opacity: .6;
}

/* ── Register ── */
.ap-register {
  margin: 12px 0 0;
  text-align: center;
  color: var(--ap-muted);
  font-size: 12.5px;
}

.ap-register a {
  color: var(--ap-red);
  text-decoration: none;
  font-weight: 600;
}

.ap-register a:hover {
  text-decoration: underline;
}

/* ── Messages ── */
.ap-message {
  display: none;
  margin-top: 14px;
  border-radius: var(--ap-radius-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.5;
}

.ap-message.is-error {
  display: block;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.ap-message.is-success {
  display: block;
  color: #14532d;
  background: #dcfce7;
  border: 1px solid #86efac;
}

/* ── Loading state for slots ── */
.ap-slots-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ap-muted);
  padding: 8px 0;
}

.ap-slots-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid var(--ap-border);
  border-top-color: var(--ap-red);
  border-radius: 50%;
  animation: ap-spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes ap-spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .ap-reservation {
    grid-template-columns: 1fr;
  }

  .ap-summary-card {
    max-width: 480px;
    position: static;
  }
}

@media (max-width: 640px) {
  .ap-card,
  .ap-summary-card {
    padding: 18px 16px;
  }

  .ap-calendar {
    max-width: 100%;
  }

  .ap-slots {
    grid-template-columns: repeat(3, 1fr);
  }

  .ap-confirm {
    height: 48px;
    font-size: 16px;
  }
}

/* ── Overlay "Acheter un forfait" v1.7.0 ── */
.ap-reservation.is-locked .ap-reservation__main {
  position: relative;
}
.ap-reservation.is-locked .ap-form {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}
.ap-reservation.is-locked .ap-summary-card {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}
.ap-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  padding: 24px;
  text-align: center;
}
.ap-lock-overlay p {
  font-size: 16px;
  font-weight: 600;
  color: var(--ap-text);
  margin: 0;
}
.ap-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--ap-radius-sm);
  background: var(--ap-red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(232,41,45,.3);
  transition: background var(--ap-transition), transform var(--ap-transition);
}
.ap-lock-btn:hover {
  background: var(--ap-red-hover);
  transform: translateY(-2px);
  color: #fff;
  text-decoration: none;
}

/* Options forfait désactivées */
.ap-select option:disabled {
  color: #cbd5e1;
}
