/* ============================================================
   AGADIRYOU — Premium Date Picker
   Replaces native browser date inputs with a custom calendar
   ============================================================ */

.ay-dp-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.ay-dp-wrap input[type=date] {
  /* Keep native input accessible but visually hidden */
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Trigger button (replaces the date input visually) */
.ay-dp-trigger {
  display: flex;
  flex-direction: column;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: var(--font);
  width: 100%;
  text-align: left;
}
.ay-dp-trigger-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ay-dp-trigger-label svg {
  width: 11px; height: 11px;
  stroke: currentColor; fill: none; stroke-width: 2;
}
.ay-dp-trigger-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.ay-dp-trigger-val.placeholder {
  color: var(--muted);
  font-weight: 400;
}

/* Dropdown calendar panel */
.ay-cal-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 9999;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 48px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06);
  padding: 0;
  min-width: 320px;
  overflow: hidden;
  transform-origin: top left;
  animation: ay-dp-in .18s cubic-bezier(.4,0,.2,1);
}
@keyframes ay-dp-in {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
/* Align right if near right edge */
.ay-cal-panel.align-right { left: auto; right: 0; transform-origin: top right; }

/* Calendar header */
.ay-dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  background: var(--sidebar);
}
.ay-dp-month-label {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .02em;
}
.ay-dp-nav {
  display: flex;
  gap: 4px;
}
.ay-dp-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.7);
  transition: background .15s, color .15s;
}
.ay-dp-nav-btn:hover {
  background: rgba(201,162,39,.2);
  border-color: rgba(201,162,39,.4);
  color: var(--gold);
}
.ay-dp-nav-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round;
}

/* Weekday headers */
.ay-dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 10px 16px 4px;
  background: var(--sidebar);
}
.ay-dp-wd {
  text-align: center;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 4px 0;
}

/* Days grid */
.ay-dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 12px 12px 14px;
  background: #fff;
}
.ay-dp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, color .12s, transform .1s;
  border: none;
  background: transparent;
  font-family: var(--font);
  position: relative;
}
.ay-dp-day:hover:not(.disabled):not(.other-month) {
  background: var(--gold-light);
  color: var(--gold-dk);
  transform: scale(1.05);
}
.ay-dp-day.today {
  font-weight: 900;
  color: var(--gold-dk);
}
.ay-dp-day.today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}
.ay-dp-day.selected {
  background: var(--gold);
  color: #000;
  font-weight: 800;
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(201,162,39,.35);
}
.ay-dp-day.in-range {
  background: var(--gold-light);
  color: var(--gold-dk);
  border-radius: 0;
}
.ay-dp-day.range-start {
  background: var(--gold);
  color: #000;
  border-radius: 8px 0 0 8px;
}
.ay-dp-day.range-end {
  background: var(--gold);
  color: #000;
  border-radius: 0 8px 8px 0;
}
.ay-dp-day.range-start.range-end {
  border-radius: 8px;
}
.ay-dp-day.disabled {
  color: #ddd;
  cursor: not-allowed;
  text-decoration: line-through;
}
.ay-dp-day.other-month {
  color: #ccc;
  cursor: default;
}
.ay-dp-day.blocked {
  background: #fee2e2;
  color: #ef4444;
  cursor: not-allowed;
}
.ay-dp-day.blocked::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 4px;
  background: rgba(239,68,68,.1);
}

/* Footer with quick selects */
.ay-dp-footer {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: #fafbfd;
}
.ay-dp-quick {
  padding: 5px 10px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  transition: all .15s;
}
.ay-dp-quick:hover {
  border-color: var(--gold);
  color: var(--gold-dk);
  background: var(--gold-light);
}

/* Range indicator strip */
.ay-dp-range-info {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--gold-dk), var(--gold));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #000;
}
.ay-dp-range-info.hidden { display: none; }
.ay-dp-range-from, .ay-dp-range-to {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ay-dp-range-from small, .ay-dp-range-to small {
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  opacity: .6;
}
.ay-dp-range-days {
  background: rgba(0,0,0,.15);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
}
.ay-dp-range-arrow {
  opacity: .5;
}

/* Overlay to close on outside click */
.ay-dp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: transparent;
  display: none;
  pointer-events: none;
}
.ay-dp-overlay[style*="display: block"],
.ay-dp-overlay[style*="display:block"] {
  pointer-events: auto;
}

/* Mobile: full screen panel */
@media (max-width: 640px) {
  .ay-cal-panel[style*="display: block"],
  .ay-cal-panel[style*="display:block"] {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    border-radius: 20px 20px 0 0;
    min-width: unset;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 -8px 40px rgba(0,0,0,.2);
    animation: ay-dp-slide-up .25s cubic-bezier(.4,0,.2,1);
  }
  @keyframes ay-dp-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .ay-dp-overlay { background: rgba(0,0,0,.4); }
  .ay-dp-days { gap: 3px; padding: 12px; }
  .ay-dp-day { font-size: 14px; }
  .ay-cal-panel.align-right { right: 0; left: 0; }
}

/* Search bar — use trigger instead of native input */
.ay-search-field .ay-dp-trigger-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ay-search-field .ay-dp-trigger-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.ay-search-field .ay-dp-trigger-val.placeholder {
  color: var(--muted);
  font-weight: 400;
}

/* ── Datepicker input text — always readable ── */
.ay-cal-trigger,
.ay-dp-input,
[data-dpstart],
[data-dpend] {
  color: inherit !important;
}
/* Force white text on dark/gold backgrounds */
.ay-dp-day.selected,
.ay-dp-day.range-start,
.ay-dp-day.range-end {
  color: #000 !important;
}
.ay-dp-day.in-range {
  color: #92400e !important;
}

/* ── Datepicker inside dark booking-widget ── */
.booking-widget .ay-dp-trigger-val,
.booking-form .ay-dp-trigger-val {
  color: #fff !important;
}
.booking-widget .ay-dp-trigger-val.placeholder,
.booking-form .ay-dp-trigger-val.placeholder {
  color: rgba(255,255,255,.35) !important;
}
.booking-widget .ay-dp-trigger-label,
.booking-form .ay-dp-trigger-label {
  color: var(--gold) !important;
}
/* Calendar panel always white, regardless of container */
.ay-cal-panel {
  background: #fff !important;
  color: #1e293b !important;
}
.ay-dp-days {
  background: #fff !important;
}
.ay-dp-day {
  color: #1e293b !important;
}
.ay-dp-day.selected,
.ay-dp-day.range-start,
.ay-dp-day.range-end {
  background: var(--gold, #c9a227) !important;
  color: #000 !important;
}
.ay-dp-day.in-range {
  background: #fef9ec !important;
  color: #92400e !important;
}
.ay-dp-day.disabled,
.ay-dp-day.other-month {
  color: #ccc !important;
}
