/* ═══════════════════════════════════════════════════════════════
   ALMA HOTEL — Booking Calendar Widget
   ═══════════════════════════════════════════════════════════════ */

/* ── Modal Overlay ──────────────────────────────────────────── */
.cal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.cal-overlay.active { opacity: 1; pointer-events: auto; }

/* ── Modal Container ────────────────────────────────────────── */
.cal-modal {
  background: #fff; border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
  width: 94vw; max-width: 780px;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: transform .3s ease;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  color: #1a1a1a;
}
.cal-overlay.active .cal-modal {
  transform: translateY(0) scale(1);
}

/* ── Header ──────────────────────────────────────────────────── */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 12px; border-bottom: 1px solid #eee;
}
.cal-header h3 {
  font-size: 20px; font-weight: 700; margin: 0;
  letter-spacing: -.02em;
}
.cal-close {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #e0e0e0; background: #fff;
  cursor: pointer; font-size: 18px; color: #666;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.cal-close:hover { background: #f5f5f5; }

/* ── Date Tabs ───────────────────────────────────────────────── */
.cal-tabs {
  display: flex; gap: 12px; padding: 16px 24px 0;
}
.cal-tab {
  flex: 1; padding: 10px 16px; border-radius: 8px;
  border: 2px solid #e0e0e0; background: #fff;
  cursor: pointer; text-align: left;
  font-size: 14px; font-weight: 500; color: #666;
  transition: all .2s;
}
.cal-tab.active {
  border-color: #1a1a1a; color: #1a1a1a; font-weight: 600;
}
.cal-tab .cal-tab-label { font-size: 12px; color: #999; display: block; margin-bottom: 2px; }
.cal-tab .cal-tab-date  { font-size: 15px; font-weight: 600; }

/* ── Room Selector ───────────────────────────────────────────── */
.cal-room-selector {
  padding: 12px 24px 0;
}
.cal-room-select {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  border: 1px solid #ddd; font-size: 14px; font-weight: 500;
  background: #fafafa; appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* ── Calendar Grid ───────────────────────────────────────────── */
.cal-months {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; padding: 16px 24px;
}
.cal-month { }
.cal-month-title {
  text-align: center; font-size: 16px; font-weight: 700;
  padding: 8px 0 12px; letter-spacing: -.01em;
}
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 11px; font-weight: 600;
  color: #999; text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 4px;
}
.cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

/* ── Day Cell ────────────────────────────────────────────────── */
.cal-day {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 6px 2px; min-height: 48px;
  border-radius: 6px; cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
}
.cal-day:hover:not(.cal-day--disabled):not(.cal-day--empty) {
  background: #f0f0f0;
}
.cal-day--empty { cursor: default; }
.cal-day--disabled {
  cursor: default; opacity: .35;
}
.cal-day .cal-day-num {
  font-size: 15px; font-weight: 600; line-height: 1.2;
}
.cal-day .cal-day-price {
  font-size: 10px; font-weight: 500; color: #888; line-height: 1.2;
  margin-top: 1px;
}

/* ── Selected States ─────────────────────────────────────────── */
.cal-day--checkin {
  background: #1a1a1a !important; color: #fff !important; border-radius: 6px 0 0 6px;
}
.cal-day--checkin .cal-day-price { color: rgba(255,255,255,.7); }
.cal-day--checkout {
  background: #1a1a1a !important; color: #fff !important; border-radius: 0 6px 6px 0;
}
.cal-day--checkout .cal-day-price { color: rgba(255,255,255,.7); }
.cal-day--range {
  background: #f0f0f0 !important;
}
.cal-day--checkin.cal-day--checkout {
  border-radius: 6px;
}

/* ── Footer ──────────────────────────────────────────────────── */
.cal-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px 20px; border-top: 1px solid #eee;
  flex-wrap: wrap; gap: 8px;
}
.cal-footer-info {
  font-size: 13px; color: #666;
}
.cal-footer-info strong { color: #1a1a1a; font-size: 18px; }
.cal-footer-actions { display: flex; gap: 10px; }
.cal-btn {
  padding: 10px 24px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; border: 1px solid #ddd;
  background: #fff; color: #666; transition: all .2s;
}
.cal-btn:hover { background: #f5f5f5; }
.cal-btn--primary {
  background: #1a1a1a; color: #fff; border-color: #1a1a1a;
}
.cal-btn--primary:hover { background: #333; }
.cal-btn--primary:disabled {
  background: #ccc; border-color: #ccc; cursor: not-allowed;
}

/* ── Booking Form (inside modal) ─────────────────────────────── */
.cal-booking-form { padding: 20px 24px; }
.cal-booking-form h4 { font-size: 18px; margin: 0 0 16px; font-weight: 700; }
.cal-form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 12px;
}
.cal-form-row.full { grid-template-columns: 1fr; }
.cal-form-field label {
  display: block; font-size: 12px; font-weight: 600; color: #888;
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em;
}
.cal-form-field input, .cal-form-field textarea, .cal-form-field select {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid #ddd; font-size: 14px; font-family: inherit;
  transition: border-color .2s;
}
.cal-form-field input:focus, .cal-form-field textarea:focus {
  border-color: #1a1a1a; outline: none;
}
.cal-form-summary {
  background: #f8f8f8; border-radius: 10px; padding: 14px 16px;
  margin-bottom: 16px; font-size: 14px;
}
.cal-form-summary .sum-row {
  display: flex; justify-content: space-between; padding: 3px 0;
}
.cal-form-summary .sum-total {
  font-weight: 700; font-size: 16px; border-top: 1px solid #ddd;
  padding-top: 8px; margin-top: 6px;
}

/* ── Loading Spinner ─────────────────────────────────────────── */
.cal-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; color: #999; font-size: 14px;
}
.cal-spinner {
  width: 24px; height: 24px; border: 3px solid #eee;
  border-top-color: #1a1a1a; border-radius: 50%;
  animation: cal-spin .7s linear infinite; margin-right: 10px;
}
@keyframes cal-spin { to { transform: rotate(360deg); } }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .cal-modal { width: 100vw; max-width: 100vw; border-radius: 16px 16px 0 0;
    max-height: 95vh; align-self: flex-end; }
  .cal-months { grid-template-columns: 1fr; }
  .cal-form-row { grid-template-columns: 1fr; }
  .cal-header { padding: 16px 16px 10px; }
  .cal-tabs { padding: 12px 16px 0; }
  .cal-months { padding: 12px 16px; }
  .cal-footer { padding: 12px 16px 16px; }
  .cal-booking-form { padding: 16px; }
  .cal-room-selector { padding: 10px 16px 0; }
}
