/* ═══════════════════════════════════════════════════════════════════
   Dewberry Hideout — Pricing Calendar Widget Styles
   Matches site brand: purple #5E2D8A, gold #D4A843, cream/linen backgrounds
   ═══════════════════════════════════════════════════════════════════ */

.dhpc-loading, .dhpc-error {
  text-align: center;
  padding: 48px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #957860;
  background: #FAF5EB;
  border-radius: 10px;
}
.dhpc-error a { color: #5E2D8A; font-weight: 600; }

.dhpc {
  font-family: 'Inter', sans-serif;
  background: #fff;
  border: 1px solid #E4D4B0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(36,20,8,.08);
}

.dhpc-header {
  background: linear-gradient(135deg, #241408 0%, #3d2154 100%);
  color: #fff;
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.dhpc-cabin-label {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
}
.dhpc-legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  letter-spacing: .5px;
  color: rgba(255,255,255,.75);
}
.dhpc-legend span { display: flex; align-items: center; gap: 6px; }
.dhpc-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dhpc-dot-avail { background: #4A6038; }
.dhpc-dot-booked { background: #957860; opacity: .5; }
.dhpc-dot-selected { background: #D4A843; }

/* ── Month grid layout ─────────────────────────────────────────── */
.dhpc-months {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  padding: 24px 28px;
  max-height: 620px;
  overflow-y: auto;
}
@media (max-width: 700px) {
  .dhpc-months { grid-template-columns: 1fr; max-height: 480px; }
}

.dhpc-month { padding: 8px 10px 20px; }
.dhpc-month-label {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: #241408;
  margin-bottom: 10px;
  text-align: center;
}

.dhpc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.dhpc-grid-dow { margin-bottom: 4px; }
.dhpc-dow {
  text-align: center;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #957860;
  font-weight: 600;
  padding-bottom: 4px;
}

.dhpc-day {
  aspect-ratio: 1;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all .12s;
  font-size: 12px;
  background: #FAF5EB;
}
.dhpc-day-blank { background: transparent; cursor: default; }
.dhpc-day-past { background: transparent; color: #ddd; cursor: default; }

.dhpc-day-avail { background: #fff; border: 1px solid #E4D4B0; }
/* Hover lift only on real pointer devices — on iOS an unguarded :hover
   sticks to the last-tapped cell and looks like a stuck selection. */
@media (hover: hover) and (pointer: fine) {
  .dhpc-day-avail:hover { border-color: #5E2D8A; box-shadow: 0 2px 8px rgba(94,45,138,.15); transform: translateY(-1px); }
}

.dhpc-day-booked {
  background: repeating-linear-gradient(45deg, #f0e6ce, #f0e6ce 4px, #e4d4b0 4px, #e4d4b0 8px);
  color: #957860;
  cursor: not-allowed;
  opacity: .6;
}

/* Before opening day — unbookable, but not "booked". Flat and quiet rather
   than hatched, so it reads as "not yet open" instead of "someone took it". */
.dhpc-day-preopening {
  background: #f7f2e6;
  border: 1px dashed #e4d4b0;
  color: #b8a894;
  cursor: not-allowed;
}
.dhpc-day-preopening .dhpc-price { display: none; }
.dhpc-dot-preopening { background: #d8cbb4; }

.dhpc-day-inrange { background: #F3E8FF; border-color: #5E2D8A; }
.dhpc-day-start, .dhpc-day-end {
  background: #5E2D8A !important;
  border-color: #5E2D8A !important;
  color: #fff;
}
.dhpc-day-start .dhpc-daynum, .dhpc-day-end .dhpc-daynum,
.dhpc-day-start .dhpc-price, .dhpc-day-end .dhpc-price { color: #fff; }

.dhpc-daynum {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 14px;
  color: #241408;
  line-height: 1.1;
}
.dhpc-price {
  font-size: 10px;
  color: #5E2D8A;
  font-weight: 600;
  margin-top: 1px;
}
.dhpc-price-booked { color: #957860; opacity: .6; }
.dhpc-day-inrange .dhpc-price { color: #5E2D8A; }

/* ── Summary / running total bar ──────────────────────────────── */
.dhpc-summary {
  border-top: 1px solid #E4D4B0;
  padding: 20px 28px;
  background: #FAF5EB;
}
.dhpc-summary-empty {
  text-align: center;
  color: #957860;
  font-size: 13px;
  font-style: italic;
}
.dhpc-summary-partial {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: #56341A;
  flex-wrap: wrap;
  gap: 10px;
}

.dhpc-summary-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}
.dhpc-summary-dates {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  font-weight: 700;
  color: #241408;
}
.dhpc-summary-nights {
  font-size: 12px;
  color: #957860;
  letter-spacing: .5px;
  margin-top: 3px;
}
.dhpc-summary-total { text-align: right; }
.dhpc-total-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #957860;
  font-weight: 600;
}
.dhpc-total-amount {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: #5E2D8A;
  line-height: 1;
}

.dhpc-breakdown {
  margin: 12px 0;
  font-size: 12.5px;
}
.dhpc-breakdown summary {
  cursor: pointer;
  color: #5E2D8A;
  font-weight: 600;
  letter-spacing: .3px;
}
.dhpc-breakdown-lines { margin-top: 10px; }
.dhpc-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #E4D4B0;
  color: #56341A;
}
.dhpc-line:last-child { border-bottom: none; }
.dhpc-line em { color: #957860; font-style: italic; font-size: 11px; }

.dhpc-tier-tag {
  display: inline-block;
  font-size: 9px;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  margin-left: 8px;
  background: #F0E6CE;
  color: #957860;
}
.dhpc-tier-weekend { background: #F3E8FF; color: #5E2D8A; }
.dhpc-tier-peak { background: #FEF3C7; color: #92400e; }
.dhpc-tier-f1, .dhpc-tier-motogp { background: #FEE2E2; color: #C4283C; }

.dhpc-summary-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}
.dhpc-clear, .dhpc-clear-btn {
  background: transparent;
  border: 1px solid #E4D4B0;
  color: #957860;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.dhpc-clear:hover, .dhpc-clear-btn:hover { border-color: #C4283C; color: #C4283C; }

.dhpc-book-btn {
  background: #D4A843;
  color: #241408;
  border: none;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  box-shadow: 0 8px 20px -6px rgba(212,168,67,.45);
}
@media (hover: hover) and (pointer: fine) {
  .dhpc-book-btn:hover {
    background: #E0B85A;
    transform: translateY(-1px);
  }
}
.dhpc-book-btn[disabled] {
  background: #E4D4B0;
  color: #957860;
  cursor: not-allowed;
  box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════════
   v2 — TOUCH / iOS BEHAVIOUR
   ═══════════════════════════════════════════════════════════════════ */

.dhpc-months {
  /* Allow vertical page scroll, but let JS claim horizontal drag-select. */
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.dhpc-months:focus-visible { box-shadow: inset 0 0 0 2px #5E2D8A; border-radius: 8px; }

.dhpc-day {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation; /* kills the iOS 300ms tap delay */
}
/* iOS needs a genuine 44pt target. Shrink the price label, not the box. */
@media (max-width: 480px) {
  .dhpc-day { min-height: 46px; aspect-ratio: auto; padding: 4px 0; }
  .dhpc-daynum { font-size: 15px; }
  .dhpc-price { font-size: 9.5px; }
  .dhpc-months { padding: 16px 12px; }
  .dhpc-summary { padding: 16px 16px; }
  .dhpc-header { padding: 16px 18px; }
  .dhpc-summary-actions { flex-direction: column-reverse; }
  .dhpc-summary-actions button { width: 100%; }
}

.dhpc-day-focus { box-shadow: 0 0 0 2px #5E2D8A; z-index: 2; }

.dhpc-hint {
  margin: 0;
  padding: 12px 28px 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #957860;
  font-family: 'Inter', sans-serif;
}
@media (max-width: 480px) { .dhpc-hint { padding: 12px 16px 0; font-size: 12px; } }

.dhpc-blocked { color: #C4283C; font-weight: 600; }

.dhpc-minstay {
  background: #FEF3C7;
  border-left: 3px solid #D4A843;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #92400e;
  margin-bottom: 12px;
}

/* ── Itemised totals table ─────────────────────────────────────────── */
.dhpc-totals {
  background: #fff;
  border: 1px solid #E4D4B0;
  border-radius: 8px;
  padding: 6px 14px;
  margin: 4px 0 12px;
}
.dhpc-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  font-size: 13px;
  color: #56341A;
  border-bottom: 1px solid #F0E6CE;
}
.dhpc-total-row:last-child { border-bottom: none; }
.dhpc-total-row span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.dhpc-total-discount { color: #4A6038; }
.dhpc-total-discount span:last-child { color: #4A6038; }
.dhpc-total-grand {
  border-top: 2px solid #241408;
  margin-top: 2px;
  padding-top: 11px;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 700;
  color: #241408;
}
.dhpc-total-grand span:last-child { font-size: 19px; color: #5E2D8A; }
.dhpc-total-deposit {
  background: #F3E8FF;
  margin: 0 -14px;
  padding: 10px 14px;
  color: #5E2D8A;
  font-weight: 600;
}
.dhpc-total-muted { color: #957860; font-size: 12px; }
.dhpc-total-muted span:last-child { color: #957860; font-weight: 500; }

.dhpc-founder-toggle {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: #56341A;
  line-height: 1.5;
  cursor: pointer;
  padding: 4px 0 2px;
}
.dhpc-founder-toggle input {
  width: 17px; height: 17px;
  margin: 1px 0 0;
  accent-color: #5E2D8A;
  flex-shrink: 0;
}
.dhpc-founder-toggle a { color: #5E2D8A; font-weight: 600; }

.dhpc-disclaimer {
  font-size: 11px;
  line-height: 1.6;
  color: #957860;
  margin: 10px 0 0;
}

/* ═══════════════════════════════════════════════════════════════════
   v2 — BOOKING POPUP MODAL
   ═══════════════════════════════════════════════════════════════════ */

body.dhpc-modal-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

.dhpc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(36, 20, 8, .62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: dhpcFade .18s ease-out;
  font-family: 'Inter', sans-serif;
}
@keyframes dhpcFade { from { opacity: 0; } to { opacity: 1; } }

.dhpc-modal {
  position: relative;
  background: #FAF5EB;
  border-radius: 16px;
  width: 100%;
  max-width: 940px;
  margin: auto;
  box-shadow: 0 30px 80px -20px rgba(36,20,8,.5);
  overflow: hidden;
  animation: dhpcRise .22s cubic-bezier(.22,1,.36,1);
}
@keyframes dhpcRise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.dhpc-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 3;
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.dhpc-modal-close:hover { background: rgba(255,255,255,.3); }

.dhpc-modal-head {
  background: linear-gradient(135deg, #241408 0%, #3d2154 100%);
  color: #fff;
  padding: 26px 30px 24px;
}
.dhpc-modal-eyebrow {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #D4A843;
  font-weight: 700;
  margin-bottom: 8px;
}
.dhpc-modal-dates {
  font-family: 'Playfair Display', serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
}
.dhpc-modal-sub {
  font-size: 12.5px;
  color: rgba(255,255,255,.72);
  margin-top: 5px;
  letter-spacing: .4px;
}

.dhpc-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0;
}
@media (max-width: 760px) {
  .dhpc-modal-body { grid-template-columns: 1fr; }
}

.dhpc-modal-quote {
  padding: 24px 26px;
  border-right: 1px solid #E4D4B0;
  background: #FAF5EB;
}
.dhpc-modal-form {
  padding: 24px 26px;
  background: #fff;
}
@media (max-width: 760px) {
  .dhpc-modal-quote { border-right: none; border-bottom: 1px solid #E4D4B0; }
  .dhpc-modal-quote, .dhpc-modal-form { padding: 20px 18px; }
  .dhpc-modal-dates { font-size: 21px; }
  .dhpc-modal-head { padding: 22px 20px 20px; }
}

.dhpc-modal-section-label {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #957860;
  font-weight: 700;
  margin-bottom: 12px;
}
.dhpc-modal-form iframe { display: block; border: 0; width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .dhpc-modal-overlay, .dhpc-modal { animation: none; }
  .dhpc-day, .dhpc-book-btn { transition: none; }
}
