/* ===========================================================================
   BOEKINGSWIDGET — 1:1 port uit revisions/round 0/booking-widget.html
   ===========================================================================
   Alles hieronder tot "WIDGET — end" komt letterlijk uit het prototype.
   NIET met de hand bijwerken: pas het prototype aan en port opnieuw, anders is
   het prototype geen referentie meer.

   De stijlen zijn allemaal gescoped onder `.atw`, dus ze raken de rest van het
   thema niet en het thema raakt hen niet. `.atw--on-light` zet de kaart wit met
   een randje in plaats van crème met een slagschaduw; die klasse zet
   inc/booking-panel.php erop wanneer het widget op een lichte sectie staat.
   --------------------------------------------------------------------------- */

/* ================= WIDGET — start (ports 1:1) ================= */
.atw {
  --atw-ink:#2c2620; --atw-accent:#7a5230; --atw-accent-dark:#61401f;
  --atw-card:#f7f3ea; --atw-free:#ffffff; --atw-busy:#dccfbb; --atw-busy-ink:#8b7b67;
  --atw-range:#d8c5a6; --atw-line:rgba(44,38,32,.12); --atw-muted:rgba(44,38,32,.58);
  --atw-warn:#7a3328; --atw-ok:#3f6b3a; --atw-display:"Fraunces", Georgia, serif;
  --atw-cols: 2;
  max-width: 680px; margin: 0 auto; background: var(--atw-card); color: var(--atw-ink);
  border-radius: 18px; padding: 18px 20px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.22);
  font: inherit; font-size: 13.5px; line-height: 1.4;
}
.atw--on-light { --atw-card:#ffffff; box-shadow: 0 8px 28px rgba(44,38,32,.08); border: 1px solid var(--atw-line); }
.atw [hidden] { display: none !important; }
.atw :focus-visible { outline: 2px solid var(--atw-accent); outline-offset: 2px; }
.atw button { font: inherit; }

.atw-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.atw-nav { display: flex; gap: 6px; }
.atw-nav button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--atw-line); background: var(--atw-free); color: var(--atw-ink); cursor: pointer; font-size: 16px; line-height: 1; display: grid; place-items: center; padding: 0; }
.atw-nav button:hover:not([disabled]) { border-color: var(--atw-accent); color: var(--atw-accent); }
.atw-nav button[disabled] { opacity: .35; cursor: default; }
.atw-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--atw-muted); }
.atw-legend span { display: inline-flex; align-items: center; gap: 6px; }
.atw-legend i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--atw-line); background: var(--atw-free); }
.atw-legend .l-busy { background: var(--atw-busy); }
.atw-legend .l-sel { background: var(--atw-accent); border-color: var(--atw-accent); }

.atw-months { display: grid; grid-template-columns: repeat(var(--atw-cols), minmax(0,1fr)); gap: 22px; }
.atw-month h3 { font-family: var(--atw-display); font-weight: 500; font-size: 16px; margin: 0 0 8px; text-align: center; letter-spacing: .01em; }
.atw-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 3px; }
.atw-wd { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--atw-muted); text-align: center; padding: 2px 0 4px; }
.atw-day { aspect-ratio: 1; min-height: 32px; border-radius: 7px; border: 1px solid transparent; background: transparent; font-size: 13px; color: var(--atw-ink); display: grid; place-items: center; padding: 0; cursor: pointer; transition: background .12s, box-shadow .12s;
  touch-action: manipulation;                        /* geen dubbeltik-zoom die de click annuleert */
  -webkit-tap-highlight-color: rgba(122,82,48,.18);  /* iOS: zichtbaar dat de tik aankwam */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.atw-day.is-empty { visibility: hidden; }
.atw-day.is-free { background: var(--atw-free); border-color: var(--atw-line); }
.atw-day.is-busy { background: var(--atw-busy); color: var(--atw-busy-ink); text-decoration: line-through; cursor: not-allowed; }
.atw-day.is-busy.can-end { cursor: pointer; }            /* first busy day after a free stretch = allowed departure day */
.atw-day.is-past { color: rgba(44,38,32,.28); cursor: default; }
.atw-day.is-mid { background: var(--atw-range); border-color: var(--atw-range); color: var(--atw-ink); text-decoration: none; }
.atw-day.is-start, .atw-day.is-end { background: var(--atw-accent); border-color: var(--atw-accent); color: #fff; font-weight: 600; text-decoration: none; }
.atw-day.is-preview { opacity: .7; }
/* De ring is een muis-affordance. iOS laat :hover op de laatst aangeraakte cel
   staan; dan lijkt een niet-geregistreerde tik alsnog gelukt. */
@media (hover: hover) {
  .atw-day.is-free:hover { box-shadow: inset 0 0 0 2px var(--atw-accent); }
  .atw-day.is-busy.can-end:hover { box-shadow: inset 0 0 0 2px var(--atw-accent); }
}
.atw-day.is-free:active, .atw-day.is-busy.can-end:active { box-shadow: inset 0 0 0 2px var(--atw-accent); }

.atw-status { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 8px; background: rgba(122,82,48,.08); border-left: 3px solid var(--atw-accent); font-size: 13px; }
.atw-status.is-warn { background: rgba(160,70,50,.08); border-left-color: #a0463a; color: var(--atw-warn); }
.atw-status button { background: none; border: 0; font-size: 12px; color: var(--atw-accent); text-decoration: underline; cursor: pointer; padding: 0; white-space: nowrap; }

.atw-controls { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; margin-top: 14px; }
.atw-field label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--atw-muted); margin-bottom: 4px; }
.atw-field select { width: 100%; height: 34px; border-radius: 8px; border: 1px solid var(--atw-line); background: var(--atw-free); font: inherit; font-size: 13px; color: var(--atw-ink); padding: 0 8px; }
.atw-hint { font-size: 11.5px; color: var(--atw-muted); margin: 6px 0 0; }

.atw-price { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--atw-line); }
.atw-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.atw-price-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--atw-muted); }
.atw-price-label button { margin-left: 8px; background: none; border: 0; font-size: 11.5px; text-transform: none; letter-spacing: 0; color: var(--atw-accent); text-decoration: underline; cursor: pointer; padding: 0; }
.atw-amount { font-family: var(--atw-display); font-weight: 500; font-size: 28px; line-height: 1; color: var(--atw-accent); white-space: nowrap; }
.atw-lines { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.atw-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: rgba(44,38,32,.82); }
.atw-lines li.is-total { border-top: 1px solid var(--atw-line); margin-top: 4px; padding-top: 6px; color: var(--atw-ink); font-weight: 600; }
.atw-lines .is-minus { color: var(--atw-ok); }
.atw-note { font-size: 11.5px; color: var(--atw-muted); margin: 8px 0 0; }
.atw-note.is-warn { color: var(--atw-warn); }
.atw-price-empty { margin: 0; font-size: 13px; color: var(--atw-muted); }

.atw-btn { width: 100%; height: 42px; border-radius: 999px; border: 0; background: var(--atw-accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 14px; transition: background .12s; }
.atw-btn:hover:not([disabled]) { background: var(--atw-accent-dark); }
.atw-btn[disabled] { opacity: .5; cursor: not-allowed; }

.atw-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--atw-line); }
.atw-summary { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: rgba(122,82,48,.08); font-size: 12.5px; }
.atw-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.atw-form label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--atw-muted); }
.atw-form input, .atw-form textarea { display: block; width: 100%; margin-top: 4px; border-radius: 8px; border: 1px solid var(--atw-line); background: var(--atw-free); font: inherit; font-size: 13.5px; color: var(--atw-ink); padding: 8px 10px; }
.atw-form textarea { resize: vertical; min-height: 56px; }
.atw-field-full { margin-top: 10px; }
.atw-form-actions { display: flex; align-items: center; gap: 16px; }
.atw-form-actions .atw-btn { width: auto; padding: 0 22px; margin-top: 12px; }
.atw-link { background: none; border: 0; font-size: 12.5px; color: var(--atw-muted); text-decoration: underline; cursor: pointer; padding: 0; margin-top: 12px; }
.atw-fine { font-size: 11.5px; color: var(--atw-muted); margin: 12px 0 0; }
.atw-fine a { color: var(--atw-accent); }
.atw-error { color: var(--atw-warn); font-size: 12px; margin: 8px 0 0; }
.atw-sent { margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: rgba(63,107,58,.1); font-size: 13.5px; }
.atw-sent strong { font-family: var(--atw-display); font-weight: 500; font-size: 18px; display: block; margin-bottom: 4px; }

@media (max-width: 520px) {
  .atw { padding: 14px; border-radius: 14px; }
  .atw-controls { grid-template-columns: 1fr 1fr; }
  .atw-controls .atw-field:last-child { grid-column: 1 / -1; }
  .atw-grid3 { grid-template-columns: 1fr; }
  .atw-legend { gap: 10px; }
  .atw-day { min-height: 40px; }   /* Apple mikt op 44px; 40 is wat er past */
  .atw-status { flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .atw * { transition: none !important; } }
/* ================= WIDGET — end ================= */
