.hac-calendar {
  --hac-border: #d7dde4;
  --hac-text: #1c2430;
  --hac-muted: #697586;
  --hac-bg: #ffffff;
  --hac-soft: #f5f7fa;
  --hac-available: #92400e;
  --hac-available-bg: #dcfce7;
  --hac-unavailable: #b8c0cc;
  --hac-selected: #16324f;
  --hac-range: #d9e8f7;
  --hac-checkout-green: #15803d;
  --hac-checkout-green-bg: #dcfce7;
  box-sizing: border-box;
  max-width: 920px;
  color: var(--hac-text);
  font-family: inherit;
}

.hac-calendar *,
.hac-calendar *::before,
.hac-calendar *::after {
  box-sizing: border-box;
}

.hac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.hac-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.hac-nav {
  display: flex;
  gap: 8px;
}

.hac-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--hac-border);
  border-radius: 8px;
  background: var(--hac-bg);
  color: var(--hac-text);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.hac-icon-button:hover:not(:disabled),
.hac-day:hover:not(:disabled) {
  border-color: var(--hac-selected);
}

.hac-icon-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hac-panel,
.hac-month,
.hac-footer {
  border: 1px solid var(--hac-border);
  border-radius: 8px;
  background: var(--hac-bg);
}

.hac-state {
  padding: 18px;
}

.hac-error {
  border-color: #d85151;
  color: #8a2424;
  background: #fff6f6;
}

.hac-months {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.hac-month {
  padding: 16px;
}

.hac-month-title {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 700;
}

.hac-weekdays,
.hac-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
}

.hac-weekdays {
  margin-bottom: 8px;
  color: var(--hac-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.hac-day {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--hac-soft);
  color: var(--hac-text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1;
}

.hac-day.is-muted {
  opacity: 0.35;
}

.hac-day.is-available {
  background: var(--hac-available-bg);
  color: var(--hac-available);
}

.hac-day.is-checkout-only {
  background-image: linear-gradient(
    135deg,
    var(--hac-available-bg) 50%,
    #fff6ed 50%
  );
}

.hac-day.is-valid-checkout {
  background: var(--hac-checkout-green-bg);
  color: var(--hac-checkout-green);
  border-color: var(--hac-checkout-green);
  font-weight: 700;
}

.hac-day.is-unavailable {
  background: #edf0f4;
  color: var(--hac-unavailable);
  cursor: not-allowed;
  text-decoration: line-through;
}

.hac-day.is-checkin-unavailable {
  background: #fff7ed;
  color: #9a5a12;
  cursor: not-allowed;
  text-decoration: none;
}

.hac-day.is-range {
  background: var(--hac-range);
  color: var(--hac-selected);
}

.hac-day.is-selected {
  background: var(--hac-selected);
  color: #ffffff;
}

.hac-day.is-too-short {
  border-color: #2e6fad;
  background: #f8fbff;
  color: var(--hac-selected);
}

.hac-footer {
  /* display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--hac-border);
  border-radius: 8px;
  background: var(--hac-bg); */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-end;
  margin-top: 16px;
  padding: 14px;
}

.hac-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.hac-selection span {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--hac-border);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--hac-soft);
  color: var(--hac-text);
  font-size: 14px;
}

.hac-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.hac-guests {
  display: grid;
  gap: 4px;
  color: var(--hac-muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 0;
}

.hac-guests input {
  width: 82px;
  min-height: 38px;
  border: 1px solid var(--hac-border);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--hac-text);
}

.hac-clear,
.hac-inquire,
.hac-booknow {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.hac-clear {
  border: 1px solid #2e6fad;
  background: #ffffff;
  color: #16324f;
}

.hac-clear:disabled {
  border-color: #c8d0da;
  color: #9aa4b2;
  cursor: not-allowed;
}

.hac-inquire {
  border: 2px solid var(--hac-selected);
  background: #ffffff;
  color: var(--hac-selected);
}

.hac-inquire:hover:not(:disabled) {
  background: #f0f4f8;
}

.hac-inquire:disabled {
  border-color: #c8d0da;
  color: #9aa4b2;
  cursor: not-allowed;
}

.hac-booknow {
  border: 0;
  background: var(--hac-selected);
  color: #ffffff;
}

.hac-booknow:hover:not(:disabled) {
  background: #0f2338;
}

.hac-booknow:disabled {
  background: #aab3c0;
  cursor: not-allowed;
}

.hac-hint {
  grid-column: 1 / -1;
  color: var(--hac-muted);
  font-size: 13px;
}

.hac-warning {
  color: #8a5a00;
}

.hac-notice {
  border: 1px solid #d7dde4;
  border-radius: 8px;
  padding: 12px;
  background: #fff8e8;
  color: #6d4b00;
}

@media (max-width: 759px) {
  .hac-months {
    grid-template-columns: 1fr;
  }

  .hac-footer {
    display: block;
  }

  .hac-controls {
    width: 100%;
    justify-content: space-between;
    margin-top: 10px;
  }

  .hac-inquire,
  .hac-booknow {
    flex: 1;
  }
}

/* ── CSS Popover tooltip ────────────────────────────────────── */
.hac-day {
  position: relative;
  overflow: visible;
}

.hac-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  z-index: 100;
  pointer-events: none;

  background: #1c2430;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);

  opacity: 0;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

/* Arrow pointing down */
.hac-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-width: 0;
  border-top-color: #1c2430;
}

.hac-day:hover .hac-tip,
.hac-day:focus-visible .hac-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
