/* =========================================================
   Villa Calendar — villa-calendar.css
   Reusable terracotta/cream availability calendar card.
   Replaces the old daterangepicker styling.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Cairo:wght@500;600;700&display=swap');

:root {
  --terracotta: #C97A4C;
  --terracotta-dark: #A85E33;
  --cream: #F8F3EC;
  --cream-deep: #EFE6D6;
  --olive: #3D4A2E;
  --olive-soft: #5A6B43;
  --gold: #B8893A;
  --charcoal: #2C2520;
  --soft-white: #FBF8F3;
  --line: #E5DCC9;
  --shadow: 0 18px 60px -20px rgba(44, 37, 32, .25);
  --shadow-sm: 0 8px 24px -10px rgba(44, 37, 32, .18);
  --radius: 14px;
  --radius-lg: 22px;
}

.cal-card {
  max-width: 1020px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--soft-white);
}

.cal-toolbar .cal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  color: var(--charcoal);
  font-weight: 600;
}

[dir="rtl"] .cal-toolbar .cal-title { font-family: 'Cairo', serif; }

.cal-nav {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--charcoal);
  transition: all .25s;
  font-family: inherit;
  line-height: 1;
}

.cal-nav:hover { background: var(--terracotta); color: #fff; border-color: var(--terracotta); }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-nav:disabled:hover { background: #fff; color: var(--charcoal); border-color: var(--line); }

.cal-months { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.cal-month { padding: 24px 28px; }
.cal-month + .cal-month { border-left: 1px solid var(--line); }
[dir="rtl"] .cal-month + .cal-month { border-left: none; border-right: 1px solid var(--line); }

.cal-month h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  text-align: center;
  margin-bottom: 14px;
  color: var(--charcoal);
  font-weight: 600;
}

[dir="rtl"] .cal-month h3 { font-family: 'Cairo', serif; }

.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-weekdays span {
  text-align: center;
  font-size: .68rem;
  color: #9a8c7d;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 0;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.cal-day {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: .9rem;
  color: var(--charcoal);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  padding: 0;
  position: relative;
}

.cal-day:hover:not(:disabled):not(.empty) { background: var(--cream-deep); transform: scale(1.06); }
.cal-day.empty { cursor: default; visibility: hidden; }
.cal-day.past { color: #cbbfae; cursor: not-allowed; }
.cal-day.past:hover { background: transparent; transform: none; }

.cal-day.booked {
  color: #bfae95;
  text-decoration: line-through;
  cursor: not-allowed;
  background: repeating-linear-gradient(45deg, transparent, transparent 3px, #F3EAD7 3px, #F3EAD7 5px);
}
.cal-day.booked:hover {
  background: repeating-linear-gradient(45deg, transparent, transparent 3px, #F3EAD7 3px, #F3EAD7 5px);
  transform: none;
}

.cal-day.today { font-weight: 700; color: var(--terracotta); border: 2px solid var(--terracotta); }
.cal-day.in-range { background: var(--cream-deep); border-radius: 0; color: var(--terracotta-dark); font-weight: 600; }
.cal-day.selected { background: var(--terracotta); color: #fff; font-weight: 600; border: none; }
.cal-day.range-start { border-radius: 50% 0 0 50%; }
.cal-day.range-end { border-radius: 0 50% 50% 0; }
[dir="rtl"] .cal-day.range-start { border-radius: 0 50% 50% 0; }
[dir="rtl"] .cal-day.range-end { border-radius: 50% 0 0 50%; }
.cal-day.range-start.range-end { border-radius: 50%; }

.cal-legend {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 14px 26px;
  border-top: 1px solid var(--line);
  background: var(--soft-white);
  font-size: .82rem;
  color: #5a4f44;
  flex-wrap: wrap;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cal-legend .dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.cal-legend .dot.available { background: #fff; border: 1px solid var(--line); }
.cal-legend .dot.booked {
  background: repeating-linear-gradient(45deg, transparent, transparent 2px, #F3EAD7 2px, #F3EAD7 4px);
  border: 1px solid var(--line);
}
.cal-legend .dot.selected { background: var(--terracotta); }
.cal-legend .dot.today { background: #fff; border: 2px solid var(--terracotta); }

.cal-summary {
  padding: 22px 28px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 20px;
  align-items: center;
}
.cal-summary .info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-right: 1px solid var(--line);
  padding-right: 20px;
}
[dir="rtl"] .cal-summary .info { border-right: none; border-left: 1px solid var(--line); padding-right: 0; padding-left: 20px; }
.cal-summary .info:nth-child(3) { border-right: none; }
[dir="rtl"] .cal-summary .info:nth-child(3) { border-left: none; }
.cal-summary .info .label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #9a8c7d;
  font-weight: 600;
}
.cal-summary .info .val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: var(--charcoal);
  font-weight: 600;
}
[dir="rtl"] .cal-summary .info .val { font-family: 'Cairo', serif; }
.cal-summary .info .placeholder { font-style: italic; color: #bfae95; font-size: 1rem; font-weight: 400; }

.cal-summary .cal-action {
  margin-left: auto;
  white-space: nowrap;
  display: inline-block;
  background: var(--terracotta);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 30px;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .25s;
}
.cal-summary .cal-action:hover { background: var(--terracotta-dark); }

@media (max-width: 720px) {
  .cal-months { grid-template-columns: 1fr; }
  .cal-month + .cal-month { border-left: none; border-top: 1px solid var(--line); }
  [dir="rtl"] .cal-month + .cal-month { border-right: none; border-top: 1px solid var(--line); }
  .cal-summary { grid-template-columns: 1fr 1fr; }
  .cal-summary .cal-action { grid-column: 1 / -1; width: 100%; text-align: center; }
  .cal-summary .info { border-right: none !important; border-left: none !important; padding: 0 !important; }
}
