/*
 * Maison 1887 — Widget Appartements CSS v2
 * Remplace le <style> inline injecté par functions.php dans wp_head
 * Inclut TOUT le CSS : base existant + nouveaux composants v2
 */

*, *::before, *::after { box-sizing: border-box; }

/* ── WRAPPER GLOBAL ── */
#ap-wrap {
  font-family: 'Montserrat', sans-serif;
  background: #f7f4ee;
  padding: 52px 20px 80px;
}

/* ── LAYOUT DEUX COLONNES ── */
.ap-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 860px) { .ap-inner { grid-template-columns: 1fr; } }

/* ── SECTIONS ── */
.ap-sec { margin-bottom: 28px; }

.ap-sec-lbl {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: #8a7a5a;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(212,175,55,.22);
}
.ap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d4af37;
  display: inline-block;
  flex-shrink: 0;
}

/* ── GRILLE ROOMS ── */
.ap-rooms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 540px) { .ap-rooms { grid-template-columns: 1fr; } }

/* ── CARTE CHAMBRE ── */
.ap-room {
  background: #fff;
  border: 1px solid rgba(212,175,55,.3);
  padding: 15px 16px;
  cursor: pointer;
  transition: border-color .22s, background .22s;
  position: relative;
  overflow: hidden;
}
.ap-room::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(212,175,55,.04);
  opacity: 0;
  transition: opacity .22s;
  pointer-events: none;
}
.ap-room:hover { border-color: rgba(212,175,55,.65); }
.ap-room:hover::after { opacity: 1; }
.ap-room.sel {
  border-color: #d4af37 !important;
  background: #fdfaf3 !important;
}
.ap-room.sel::after { opacity: 1 !important; }

/* Animation shake si click date sans chambre */
@keyframes ap-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX( 6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX( 4px); }
}
.ap-shake { animation: ap-shake .5s ease; }

.ap-ri {}
.ap-rtop { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3px; }
.ap-rname { font-size: 13px; font-weight: 600; color: #1a1a1a; }

/* BADGES */
.ap-rbadge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
  padding: 2px 7px;
  border-radius: 2px;
  white-space: nowrap;
}
.ap-rbadge.prm { background: rgba(212,175,55,.15); color: #8a6a20; border: 1px solid rgba(212,175,55,.4); }
.ap-rbadge.dlx { background: rgba(26,92,58,.08);  color: #1a5c3a;  border: 1px solid rgba(26,92,58,.25); }
.ap-rbadge.std { background: rgba(100,100,100,.07); color: #666;   border: 1px solid rgba(100,100,100,.2); }

.ap-rtype {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #8a7a5a;
  margin-bottom: 4px;
}

/* SURFACE + CAPACITÉ (nouveau v2) */
.ap-rfacts {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  color: #8a7a5a;
  margin-bottom: 7px;
  letter-spacing: .03em;
}
.ap-rfacts-sep { opacity: .4; }

.ap-rprice {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: #1a5c3a;
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.ap-rprice small { font-family: 'Montserrat', sans-serif; font-size: 10px; color: #8a7a5a; font-style: normal; }

/* ── PREVIEW CHAMBRE (nouveau v2) ── */
.ap-room-preview {
  display: none;
  margin-top: 12px;
  border: 1px solid rgba(212,175,55,.25);
  background: #fff;
  overflow: hidden;
  animation: ap-fadein .25s ease;
}
.ap-room-preview.visible { display: flex; }
@keyframes ap-fadein { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }

.ap-preview-body { padding: 13px 16px; flex: 1; }
.ap-preview-name {
  font-size: 11px;
  font-weight: 600;
  color: #153d4b;
  margin-bottom: 7px;
}
.ap-preview-feats { display: flex; flex-wrap: wrap; gap: 5px; }
.ap-preview-feats span {
  font-size: 8px;
  letter-spacing: .05em;
  color: #8a7a5a;
  padding: 3px 8px;
  border: 1px solid rgba(212,175,55,.22);
  background: rgba(212,175,55,.04);
}

/* ── CALENDRIER ── */
.ap-cal-card {
  background: #fff;
  border: 1px solid rgba(212,175,55,.25);
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  padding: 18px 22px 22px;
}
.ap-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ap-cal-month {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: #1a1a1a;
}
.ap-cal-arr {
  background: none;
  border: 1px solid rgba(212,175,55,.35);
  color: #8a7a5a;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: all .18s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ap-cal-arr:hover { background: rgba(212,175,55,.1); border-color: #d4af37; color: #1a1a1a; }

.ap-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.ap-dow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a7a5a;
  text-align: center;
  padding: 6px 0 8px;
}
.ap-day {
  font-size: 11px;
  color: #ccc;
  padding: 4px 2px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 2px;
  transition: all .18s;
  cursor: default;
  user-select: none;
}
.ap-day.av  { color: #1a1a1a; cursor: pointer; }
.ap-day.av:hover { background: rgba(26,92,58,.06); color: #1a5c3a; }
.ap-day.past { opacity: .25; cursor: default; }

/* États de sélection */
.ap-day.sci {
  background: #1a5c3a !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 4px 0 0 4px;
}
.ap-day.sci .ap-dp { color: rgba(212,175,55,.75) !important; }
.ap-day.sco {
  background: rgba(26,92,58,.18);
  color: #1a5c3a;
  font-weight: 500;
  border-radius: 0 4px 4px 0;
}
.ap-day.rng { background: rgba(26,92,58,.07); color: #1a5c3a; }

.ap-dp {
  font-size: 8px;
  color: #d4af37;
  font-weight: 600;
  line-height: 1;
}

/* ── DURÉE DU SÉJOUR ── */
.ap-nw {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid rgba(212,175,55,.15);
}
.ap-nlbl {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #8a7a5a;
}
.ap-nc { display: flex; align-items: center; gap: 10px; }
.ap-nb {
  background: #fff;
  border: 1px solid rgba(212,175,55,.4);
  color: #8a7a5a;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all .18s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ap-nb:hover { border-color: #d4af37; color: #1a5c3a; background: rgba(212,175,55,.07); }
.ap-nv {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: #1a5c3a;
  min-width: 28px;
  text-align: center;
}
.ap-nu { font-size: 11px; color: #8a7a5a; }

/* ── DATE DE DÉPART CALCULÉE (nouveau v2) ── */
.ap-checkout-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(212,175,55,.07);
  border: 1px solid rgba(212,175,55,.25);
  margin-top: 12px;
}
.ap-cdlbl {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #8a7a5a;
  flex-shrink: 0;
}
.ap-checkout-date {
  font-size: 11px;
  color: #153d4b;
  font-weight: 500;
}

/* ── MESSAGE INFO ── */
.ap-info {
  padding: 10px 14px;
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.6;
  border-width: 1px 1px 1px 3px;
  border-style: solid;
}
.ap-info-ok      { background: rgba(26,92,58,.05);   border-color: rgba(26,92,58,.14) rgba(26,92,58,.14) rgba(26,92,58,.14) #1a5c3a; color: #3a6a4a; }
.ap-info-warn    { background: rgba(180,120,0,.05);   border-color: rgba(180,120,0,.14) rgba(180,120,0,.14) rgba(180,120,0,.14) #b47800; color: #7a5a00; }
.ap-info-neutral { background: rgba(26,92,58,.05);   border-color: rgba(26,92,58,.14) rgba(26,92,58,.14) rgba(26,92,58,.14) #1a5c3a; color: #6a7a6a; }

/* ── OPTIONS ── */
.ap-opts {
  background: #fff;
  border: 1px solid rgba(212,175,55,.22);
  padding: 0 22px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.ap-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,.05);
  cursor: pointer;
  transition: padding-left .15s;
}
.ap-opt:last-child { border-bottom: none; }
.ap-opt:hover { padding-left: 5px; }
.ap-opt.checked .ap-chk { background: #1a5c3a; border-color: #1a5c3a; }
.ap-opt.checked .ap-chk::after { opacity: 1; }

.ap-chk {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(26,92,58,.35);
  border-radius: 3px;
  flex-shrink: 0;
  position: relative;
  transition: all .18s;
}
.ap-chk::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  opacity: 0;
  transition: opacity .18s;
}
.ap-oi { font-size: 20px; flex-shrink: 0; }
.ap-otext { flex: 1; min-width: 0; }
.ap-on { font-size: 11px; font-weight: 600; color: #1a1a1a; }
.ap-od { font-size: 10px; color: #8a7a5a; margin-top: 2px; }
.ap-op { font-size: 11px; font-weight: 600; color: #1a5c3a; white-space: nowrap; }

/* ── BANNIÈRE RASSURANCE (nouveau v2) ── */
.ap-trust-bar {
  display: flex;
  margin-top: 12px;
  border: 1px solid rgba(212,175,55,.2);
  background: rgba(212,175,55,.04);
}
.ap-trust-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .1em;
  color: #6a7a6a;
  text-transform: uppercase;
  border-right: 1px solid rgba(212,175,55,.15);
}
.ap-trust-item:last-child { border-right: none; }
.ap-trust-icon { font-size: 13px; }

/* ── SIDEBAR ── */
.ap-sidebar { position: sticky; top: 24px; }
.ap-recap {
  background: #fff;
  border: 1px solid rgba(212,175,55,.25);
  box-shadow: 0 6px 32px rgba(0,0,0,.07);
  position: relative;
}
.ap-recap::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 20px; height: 20px;
  border-top: 1px solid #d4af37;
  border-left: 1px solid #d4af37;
  z-index: 1;
}
.ap-recap::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 20px; height: 20px;
  border-bottom: 1px solid #d4af37;
  border-right: 1px solid #d4af37;
  z-index: 1;
}
.ap-rhead {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(212,175,55,.15);
  text-align: center;
}
.ap-rlogo { width: 72px; filter: brightness(.12); display: block; margin: 0 auto 10px; }
.ap-rtitle {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.ap-rsub {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #d4af37;
}
.ap-rbody { padding: 16px 22px; }
.ap-rlbl {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #8a7a5a;
  margin-bottom: 7px;
}
.ap-rrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  padding: 4px 0;
  color: #3a3a3a;
}
.ap-rrow .k { color: #8a7a5a; }
.ap-rrow .v { font-weight: 600; color: #1a1a1a; }
.ap-rempty { font-size: 11px; color: #aaa; font-style: italic; margin: 0 0 6px; }
.ap-rdiv { height: 1px; background: rgba(212,175,55,.18); margin: 10px 0; }
.ap-rtot-row { padding-top: 6px; }
.ap-rtot-l {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #8a7a5a;
}
.ap-rtot-v {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: #1a5c3a;
  font-weight: 400;
}

/* ── CTA ── */
.ap-rfoot { padding: 0 22px 22px; }
.ap-cta {
  width: 100%;
  padding: 14px;
  background: #1a5c3a;
  color: #d4af37;
  border: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .22s;
  margin-bottom: 12px;
}
.ap-cta:hover:not(:disabled) { background: #144a2e; }
.ap-cta:disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── BADGES DE CONFIANCE (sidebar) ── */
.ap-trust {
  display: flex;
  justify-content: space-around;
  gap: 4px;
}
.ap-ti {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #8a7a5a;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 860px) {
  .ap-sidebar { position: static; order: -1; }
  .ap-trust-bar { flex-wrap: wrap; }
  .ap-trust-item {
    flex: 1 1 45%;
    border-right: none;
    border-bottom: 1px solid rgba(212,175,55,.15);
    min-width: 120px;
  }
  .ap-trust-item:last-child { border-bottom: none; }
}
@media (max-width: 480px) {
  #ap-wrap { padding: 32px 14px 60px; }
  .ap-rooms { grid-template-columns: 1fr; }
  .ap-room-preview { flex-direction: column; }
  .ap-trust-bar { flex-direction: column; }
  .ap-trust-item { border-right: none; border-bottom: 1px solid rgba(212,175,55,.15); }
}
