/* ═══ CUSTOM DATE PICKER — Apple-Style ═══ */
.dp-wrapper { position: relative; }
.dp-display { width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--font-body); font-size: 0.9rem; color: var(--text); background: var(--surface); cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: space-between; -webkit-user-select: none; user-select: none; }
.dp-display:hover { border-color: var(--accent); }
.dp-display.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,169,110,0.15); }
.dp-display .dp-icon { font-size: 1rem; opacity: 0.5; }
.dp-display .dp-text { color: var(--text); }
.dp-display .dp-placeholder { color: var(--text-muted); }

/* Overlay — covers entire screen, sits at body level */
.dp-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 9998; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.dp-overlay.open { display: block; }

/* Dropdown — lives at body level, positioned by JS on desktop */
.dp-dropdown { position: absolute; z-index: 9999; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04); padding: 20px; min-width: 320px; opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.98); pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s; }
.dp-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }

/* Header, Nav, Weekdays, Days */
.dp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dp-month-year { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 600; color: var(--primary); }
.dp-nav { display: flex; gap: 4px; }
.dp-nav button { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--surface); cursor: pointer; font-size: 0.9rem; color: var(--primary); transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.dp-nav button:hover { background: var(--accent); color: var(--primary); }
.dp-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; margin-bottom: 4px; }
.dp-weekday { text-align: center; font-size: 0.65rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); padding: 8px 0; }
.dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.85rem; cursor: pointer; transition: all 0.2s ease; color: var(--text); font-weight: 500; position: relative; }
.dp-day:hover:not(.disabled):not(.selected) { background: var(--surface); }
.dp-day.today { color: var(--accent); font-weight: 700; }
.dp-day.today::after { content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.dp-day.selected { background: var(--primary); color: #fff; font-weight: 600; }
.dp-day.in-range { background: rgba(27,58,75,0.08); border-radius: 0; }
.dp-day.range-start { background: var(--primary); color: #fff; border-radius: 50% 0 0 50%; }
.dp-day.range-end { background: var(--primary); color: #fff; border-radius: 0 50% 50% 0; }
.dp-day.disabled { color: var(--border); cursor: not-allowed; opacity: 0.4; }
.dp-day.other-month { color: var(--text-muted); opacity: 0.3; }

/* ═══ MOBILE — Bottom Sheet Style ═══ */
@media (max-width: 768px) {
  .dp-dropdown {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 36px;
    max-height: 75vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    /* Override desktop transition with bottom-sheet slide */
    opacity: 1;
    transform: translateY(100%);
  }
  .dp-dropdown.open {
    transform: translateY(0) !important;
  }

  /* Bigger tap targets on mobile */
  .dp-day { font-size: 0.95rem; min-height: 44px; }
  .dp-nav button { width: 44px; height: 44px; font-size: 1.1rem; }
  .dp-month-year { font-size: 1.3rem; }
  .dp-weekday { font-size: 0.7rem; padding: 10px 0; }

  /* Handle bar indicator for bottom sheet */
  .dp-dropdown::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
  }
}
