/*
 * Mystic Hotel Booking Widget — Stylesheet v1.1
 */

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

:root {
  --hbw-black:      #0a0a0a;
  --hbw-charcoal:   #1c1c1c;
  --hbw-border:     #2e2e2e;
  --hbw-light:      #888;
  --hbw-white:      #ffffff;
  --hbw-off-white:  #f5f3ef;
  --hbw-gold:       #c9a84c;
  --hbw-gold-dark:  #a8872e;
  --hbw-gold-light: #e8c97a;
  --hbw-radius:     4px;
  --hbw-font-head:  'Cormorant Garamond', serif;
  --hbw-font-body:  'DM Sans', sans-serif;
}

/* ── Widget Shell ──────────────────────────── */
.hbw-wrap {
  width: 100%;
  background: var(--hbw-black);
  border-bottom: 1px solid var(--hbw-border);
  position: relative;
  font-family: var(--hbw-font-body);
}

/* ── Bar ───────────────────────────────────── */
.hbw-bar {
  display: flex; align-items: stretch;
  width: 100%; min-height: 72px; flex-wrap: wrap;
}
.hbw-field {
  flex: 1 1 0; min-width: 140px;
  padding: 10px 18px;
  border-right: 1px solid var(--hbw-border);
  cursor: pointer; position: relative;
  transition: background .18s;
  display: flex; flex-direction: column; justify-content: center;
}
.hbw-field:hover,
.hbw-field.active { background: var(--hbw-charcoal); }
.hbw-field-label {
  font-size: 9px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--hbw-light);
  margin-bottom: 4px; user-select: none; pointer-events: none;
}
.hbw-field-value {
  font-size: 13px; font-weight: 500; color: var(--hbw-white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.hbw-field-value svg { flex-shrink: 0; opacity: .5; }
.hbw-field-value.placeholder { color: #555; }

.hbw-field-input {
  background: transparent; border: none; outline: none;
  font-family: var(--hbw-font-body); font-size: 13px; font-weight: 500;
  color: var(--hbw-white); width: 100%; cursor: text;
  caret-color: var(--hbw-gold);
}
.hbw-field-input::placeholder { color: #555; }

/* ── Date field bar display ────────────────── */
.hbw-field-date { flex: 1.7 1 0; min-width: 210px; }
.hbw-date-display { display: flex; align-items: center; width: 100%; }
.hbw-date-half { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hbw-date-half-label { font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #555; margin-bottom: 2px; }
.hbw-date-half-val   { font-size: 13px; font-weight: 500; color: var(--hbw-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbw-date-half-val.empty { color: #555; }
.hbw-date-sep { color: #3a3a3a; font-size: 16px; margin: 0 10px; padding-top: 10px; flex-shrink: 0; font-weight: 300; }

/* ── Shared Panels ─────────────────────────── */
.hbw-panel {
  display: none; position: absolute;
  top: calc(100% + 2px); left: 0; z-index: 9999;
  background: var(--hbw-white);
  border: 1px solid #e0e0e0;
  box-shadow: 0 16px 48px rgba(0,0,0,.15);
  min-width: 300px;
  border-radius: 0 0 6px 6px;
}
.hbw-panel.open { display: block; }

/* ── Destination panel ─────────────────────── */
#panel-dest { min-width: 340px; }
.hbw-dest-search { padding: 13px 15px; border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 8px; }
.hbw-dest-search input { width: 100%; border: none; outline: none; font-family: var(--hbw-font-body); font-size: 14px; color: var(--hbw-black); background: transparent; }
.hbw-dest-search input::placeholder { color: #bbb; }
.hbw-dest-list { max-height: 260px; overflow-y: auto; }
.hbw-dest-group-label { font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: #bbb; padding: 10px 15px 3px; }
.hbw-dest-item { display: flex; align-items: center; gap: 11px; padding: 9px 15px; cursor: pointer; transition: background .13s; }
.hbw-dest-item:hover { background: #f7f7f7; }
.hbw-dest-icon { width: 30px; height: 30px; background: #f0f0f0; border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #888; }
.hbw-dest-name { font-size: 13.5px; font-weight: 500; color: var(--hbw-black); }
.hbw-dest-name b { font-weight: 700; }
.hbw-dest-type { font-size: 9.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: #bbb; margin-top: 1px; }

/* ══════════════════════════════════════════════
   CALENDAR PANEL
══════════════════════════════════════════════ */
.hbw-cal-panel {
  min-width: 620px;
  padding: 0;
  user-select: none;
}

/* nav row: arrow | months | arrow */
.hbw-cal-nav {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 16px 14px 8px;
}
.hbw-cal-arrow {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: none; border: 1.5px solid #ddd;
  border-radius: 50%; cursor: pointer;
  font-size: 20px; line-height: 1;
  color: #555;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s;
  margin-top: 26px; /* align with month rows */
}
.hbw-cal-arrow:hover:not(:disabled) { border-color: var(--hbw-gold-dark); color: var(--hbw-gold-dark); }
.hbw-cal-arrow:disabled { opacity: .25; cursor: default; }

.hbw-cal-months-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
}

/* individual month block */
.hbw-cal-month { padding: 0 6px; }
.hbw-cal-month-hd {
  text-align: center;
  font-family: var(--hbw-font-head);
  font-size: 15px; font-weight: 600;
  color: var(--hbw-black);
  margin-bottom: 10px;
  letter-spacing: .02em;
}
.hbw-cal-daynames {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.hbw-cal-daynames span {
  text-align: center;
  font-size: 9px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: #aaa;
  padding: 3px 0;
}
.hbw-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px 0;
}

/* cell base */
.hbw-cal-cell {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 36px;
  font-size: 12.5px; font-weight: 500;
  color: var(--hbw-black);
  cursor: pointer;
  transition: background .12s;
}
.hbw-cal-cell span {
  position: relative; z-index: 2;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.hbw-cal-cell:hover:not(.hbw-cal-disabled) span { background: #f0f0f0; }

.hbw-cal-empty  { cursor: default; }
.hbw-cal-disabled { color: #ccc; cursor: default; }

/* today ring */
.hbw-cal-today span { outline: 1.5px solid var(--hbw-gold-dark); outline-offset: 1px; }

/* in-range band */
.hbw-cal-inrange { background: #fdf3d8; }
.hbw-cal-inrange span { color: var(--hbw-black); }

/* start / end circle */
.hbw-cal-start span,
.hbw-cal-end   span {
  background: var(--hbw-gold) !important;
  color: var(--hbw-black) !important;
  font-weight: 700;
}
/* half-band on range edges */
.hbw-cal-start.hbw-cal-range-edge-l::before,
.hbw-cal-end.hbw-cal-range-edge-r::before {
  content: '';
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 50%; height: 28px;
  background: #fdf3d8;
  z-index: 1;
}
.hbw-cal-start.hbw-cal-range-edge-l::before { right: 0; }
.hbw-cal-end.hbw-cal-range-edge-r::before   { left:  0; }

/* footer row */
.hbw-cal-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px 14px;
  border-top: 1px solid #f0f0f0;
}
.hbw-cal-hint {
  font-size: 11.5px; color: #888; font-style: italic;
}
.hbw-cal-nights {
  font-size: 11px !important;
}
.hbw-cal-clear {
  margin-left: auto;
  background: none; border: none;
  font-family: var(--hbw-font-body); font-size: 11.5px;
  color: #aaa; text-decoration: underline; cursor: pointer;
  transition: color .15s;
}
.hbw-cal-clear:hover { color: #e74c3c; }

/* nights badge (used in bar and calendar) */
.hbw-nights-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--hbw-black); color: var(--hbw-gold);
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  padding: 5px 13px; border-radius: 20px;
}

/* ── Guests panel ──────────────────────────── */
#panel-guests { min-width: 300px; }
.hbw-room-block { padding: 16px 18px 12px; border-bottom: 1px solid #f0f0f0; }
.hbw-room-label { font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #bbb; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.hbw-remove-room { color: #e74c3c; cursor: pointer; text-decoration: underline; font-size: 9px; }
.hbw-guest-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hbw-guest-row:last-child { margin-bottom: 0; }
.hbw-guest-info strong { display: block; font-size: 12px; font-weight: 700; color: var(--hbw-black); text-transform: uppercase; letter-spacing: .04em; }
.hbw-guest-info span   { font-size: 10.5px; color: #999; }
.hbw-counter { display: flex; align-items: center; gap: 10px; }
.hbw-counter-val { font-size: 15px; font-weight: 600; color: var(--hbw-black); min-width: 18px; text-align: center; }
.hbw-counter-btn { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--hbw-black); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 400; color: var(--hbw-black); line-height: 1; padding: 0; transition: background .14s, color .14s; }
.hbw-counter-btn:hover:not(:disabled) { background: var(--hbw-black); color: var(--hbw-white); }
.hbw-counter-btn:disabled { opacity: .2; cursor: default; }
.hbw-add-room { padding: 10px 18px; text-align: right; }
.hbw-add-room-btn { background: none; border: none; font-family: var(--hbw-font-body); font-size: 12.5px; font-weight: 500; color: var(--hbw-black); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.hbw-add-room-btn:hover { color: var(--hbw-gold-dark); }

/* ── Book Now ──────────────────────────────── */
.hbw-book-btn {
  flex: 0 0 auto; padding: 0 32px;
  background: var(--hbw-gold); color: var(--hbw-black);
  font-family: var(--hbw-font-body); font-size: 11.5px; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase;
  border: none; cursor: pointer;
  transition: background .2s, letter-spacing .25s;
  min-height: 72px; white-space: nowrap;
}
.hbw-book-btn:hover { background: var(--hbw-gold-light); letter-spacing: .2em; }

/* ── Modal ─────────────────────────────────── */
.hbw-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 99999;
  align-items: center; justify-content: center; padding: 16px;
}
.hbw-modal-overlay.open { display: flex; }
.hbw-modal {
  background: var(--hbw-white); width: 100%; max-width: 520px;
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 28px 80px rgba(0,0,0,.35);
  animation: hbwSlideUp .28s ease;
}
@keyframes hbwSlideUp {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.hbw-modal-head {
  background: var(--hbw-black); padding: 22px 26px;
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid var(--hbw-gold);
}
.hbw-modal-head h2 { font-family: var(--hbw-font-head); font-size: 22px; font-weight: 600; color: var(--hbw-white); letter-spacing: .02em; }
.hbw-modal-head p  { font-size: 11px; color: #666; margin-top: 3px; }
.hbw-modal-close   { background: none; border: none; cursor: pointer; color: #555; font-size: 20px; padding: 2px; transition: color .2s; line-height: 1; }
.hbw-modal-close:hover { color: var(--hbw-white); }
.hbw-modal-body { padding: 24px 26px; }

.hbw-summary { background: var(--hbw-off-white); border-radius: var(--hbw-radius); padding: 12px 15px; margin-bottom: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.hbw-summary-item .lbl { font-size: 8.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #999; }
.hbw-summary-item .val { font-size: 12.5px; font-weight: 600; color: var(--hbw-black); margin-top: 2px; }

.hbw-form-row        { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.hbw-form-row.single { grid-template-columns: 1fr; }
.hbw-input-wrap      { display: flex; flex-direction: column; gap: 4px; }
.hbw-input-wrap label { font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #999; }
.hbw-input-wrap input,
.hbw-input-wrap select { padding: 9px 12px; border: 1.5px solid #ddd; border-radius: var(--hbw-radius); font-family: var(--hbw-font-body); font-size: 13.5px; color: var(--hbw-black); outline: none; transition: border-color .2s; background: var(--hbw-white); width: 100%; }
.hbw-input-wrap input:focus,
.hbw-input-wrap select:focus { border-color: var(--hbw-gold-dark); }
.hbw-input-wrap input.error  { border-color: #e74c3c; }
.hbw-err      { font-size: 10.5px; color: #e74c3c; display: none; }
.hbw-err.show { display: block; }
.hbw-phone-row                { display: flex; gap: 7px; align-items: center; }
.hbw-phone-row select         { flex: 0 0 108px !important; width: 108px !important; min-width: 0; }
.hbw-phone-row input[type="tel"] { flex: 1 1 auto !important; width: 0 !important; min-width: 0; }

.hbw-submit-btn { width: 100%; padding: 13px; background: var(--hbw-gold); color: var(--hbw-black); border: none; font-family: var(--hbw-font-body); font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; border-radius: var(--hbw-radius); transition: background .2s; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.hbw-submit-btn:hover:not(:disabled) { background: var(--hbw-gold-light); }
.hbw-submit-btn:disabled { background: #ddd; cursor: not-allowed; color: #999; }

.hbw-success { display: none; text-align: center; padding: 40px 26px; }
.hbw-success.show { display: block; }
.hbw-success-icon { width: 58px; height: 58px; background: #fdf7e8; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 26px; color: var(--hbw-gold-dark); border: 2px solid var(--hbw-gold); }
.hbw-success h3 { font-family: var(--hbw-font-head); font-size: 24px; font-weight: 600; color: var(--hbw-black); margin-bottom: 8px; }
.hbw-success p  { font-size: 13.5px; color: #666; line-height: 1.6; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.2); border-top-color: var(--hbw-black); border-radius: 50%; animation: hbwSpin .7s linear infinite; display: none; }
.spinner.show { display: block; }
@keyframes hbwSpin { to { transform: rotate(360deg); } }

/* ── Responsive ────────────────────────────── */
@media (max-width: 900px) {
  .hbw-field     { flex: 1 1 46%; border-bottom: 1px solid var(--hbw-border); }
  .hbw-book-btn  { flex: 1 1 100%; min-height: 50px; }
  .hbw-cal-panel { min-width: unset !important; width: 100vw; max-width: 100vw; left: 0 !important; right: 0; }
  .hbw-cal-months-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .hbw-field     { flex: 1 1 100%; }
  .hbw-modal-body { padding: 18px; }
  .hbw-form-row  { grid-template-columns: 1fr; }
  .hbw-cal-panel { min-width: unset !important; }
}
