/* ============================================================
   Clear Choice Services — modal-estimate.css
   Overlay modals for quick callback + full estimate request
   ============================================================ */

/* ---- Overlay ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

/* ---- Modal card ---- */
.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px 32px;
  width: 100%;
  max-width: 480px;
  position: relative;
  margin: auto 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  overflow-x: hidden;
}

.modal-content-lg {
  max-width: 620px;
}

/* ---- Close button ---- */
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: #1e3a8a;
  background: #f1f5f9;
}

/* ---- Modal headings ---- */
.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e3a8a;
  margin: 0 0 6px;
  padding-right: 36px;
}

.modal-subtitle {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ---- Success state ---- */
.modal-success {
  text-align: center;
  padding: 20px 0 8px;
}

.modal-success .form-success-icon {
  width: 52px;
  height: 52px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.modal-success h3 {
  font-size: 1.15rem;
  color: #1e3a8a;
  margin: 0 0 8px;
}

.modal-success p {
  color: #475569;
  font-size: 0.92rem;
  margin: 0 0 20px;
}

/* ---- Service checkboxes ---- */
.service-item {
  display: flex;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
}

.service-item:last-of-type {
  border-bottom: none;
}

.service-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.service-info label {
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  font-size: 0.95rem;
}

.service-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.trust-sentence {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 10px 0 0;
  font-style: italic;
}

/* ---- Detail panels ---- */
.detail-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-top: 12px;
}

.detail-section h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e3a8a;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-section-note {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.detail-section-note p {
  font-size: 0.9rem;
  color: #1e40af;
  margin: 0;
}

.detail-row {
  margin-bottom: 10px;
}

.detail-row:last-child {
  margin-bottom: 0;
}

.detail-label {
  display: block;
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 4px;
  font-weight: 500;
}

.modal-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
  background: #fff;
  color: #1e293b;
  font-family: inherit;
}

.modal-input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #2563eb;
}

.modal-select {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
  color: #374151;
  font-family: inherit;
  cursor: pointer;
}

/* ---- Extras grid (window yes/no selects) ---- */
.extras-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.extras-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.extras-label {
  font-size: 0.82rem;
  color: #374151;
  flex: 1;
}

/* -----------------------------------------------------
   Calendar & Slots Base Wrapper
----------------------------------------------------- */
#orderCalendar {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
  min-width: 0;
}

#orderCalendar .calendar-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.75rem;
  margin-top: 0;
}

#orderCalendar .calendar-preference-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0 0 0.85rem 0;
  color: #374151;
  font-size: 0.92rem;
  line-height: 1.45;
}

#orderCalendar .calendar-preference-toggle input[type="checkbox"] {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  accent-color: #2563eb;
}

/* -----------------------------------------------------
   Horizontal Scrollable Days Wrapper
----------------------------------------------------- */
#orderCalendar .days-wrapper {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

#orderCalendar .days-wrapper::-webkit-scrollbar {
  height: 6px;
}

#orderCalendar .days-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

#orderCalendar .days-wrapper::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 20px;
}

/* -----------------------------------------------------
   Day Buttons
----------------------------------------------------- */
#orderCalendar .day-btn {
  flex: 0 0 auto;
  padding: 0.625rem 1rem;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out, color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  white-space: nowrap;
  outline: none;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

#orderCalendar .day-btn:hover:not(:disabled) {
  border-color: #3b82f6;
  color: #1d4ed8;
  background-color: #eff6ff;
}

#orderCalendar .day-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
  border-color: #3b82f6;
}

#orderCalendar .day-btn.active {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

#orderCalendar .day-btn.disabled-day,
#orderCalendar .day-btn:disabled {
  opacity: 0.55;
  background-color: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
  text-decoration: line-through;
  box-shadow: none;
}

/* -----------------------------------------------------
   Date Carousel Layout
----------------------------------------------------- */
#orderCalendar .date-carousel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

#orderCalendar .date-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  flex-wrap: wrap;
}

#orderCalendar .date-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

#orderCalendar .date-nav:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
  color: #1d4ed8;
}

#orderCalendar .date-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#orderCalendar .date-nav-status {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 180px;
}

#orderCalendar .date-nav-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2937;
}

#orderCalendar .date-nav-meta {
  font-size: 0.75rem;
  color: #64748b;
}

#orderCalendar .date-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#orderCalendar .month-jump {
  position: relative;
}

#orderCalendar .month-jump-menu {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: 6px;
  min-width: min(220px, calc(100vw - 32px));
  max-width: min(320px, 88vw);
  box-sizing: border-box;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

#orderCalendar .month-jump-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  text-align: left;
  cursor: pointer;
}

#orderCalendar .month-jump-item:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

#orderCalendar .month-jump-item.active {
  border-color: #2563eb;
  background: #dbeafe;
}

#orderCalendar .month-jump-item.is-unavailable,
#orderCalendar .month-summary-btn.is-unavailable {
  color: #64748b;
}

#orderCalendar .month-jump-item-label,
#orderCalendar .month-summary-label {
  font-size: 0.87rem;
  font-weight: 700;
}

#orderCalendar .month-jump-item-meta,
#orderCalendar .month-summary-date {
  font-size: 0.76rem;
  color: inherit;
  opacity: 0.9;
}

/* Desktop / tablet: 4-column grid */
#orderCalendar .date-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

/* Mobile: 1-column, 8 rows visible with scroll */
@media (max-width: 767px) {
  #orderCalendar .date-strip {
    grid-template-columns: 1fr;
    max-height: 536px; /* 8 × 60px buttons + 7 × 8px gaps */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }
}

#orderCalendar .date-strip.date-strip-month-overview {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

#orderCalendar .month-summary-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 92px;
  padding: 14px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2937;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#orderCalendar .month-summary-btn:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

#orderCalendar .month-summary-btn.active {
  border-color: #2563eb;
  background: #dbeafe;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

@media (max-width: 767px) {
  #orderCalendar .date-strip.date-strip-month-overview {
    grid-template-columns: 1fr;
  }
}

@supports (view-transition-name: modal-calendar) {
  #orderCalendar .date-carousel {
    view-transition-name: modal-calendar;
  }
}

/* Day button — desktop column card */
#orderCalendar .date-strip .day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  gap: 3px;
  white-space: normal;
  width: 100%;
  margin: 0;
  flex: none;
}

#orderCalendar .date-strip .day-btn.is-placeholder {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

/* Day button — mobile horizontal row */
@media (max-width: 767px) {
  #orderCalendar .date-strip .day-btn {
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    height: 60px;
  }

  #orderCalendar .date-strip .day-btn.is-placeholder {
    display: none;
  }
}

#orderCalendar .date-strip .day-btn .day-weekday {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  color: inherit;
}

#orderCalendar .date-strip .day-btn .day-number {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
  color: inherit;
}

#orderCalendar .date-strip .day-btn .day-month {
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1;
  color: inherit;
  opacity: 0.75;
}

@media (max-width: 767px) {
  #orderCalendar .date-strip .day-btn .day-weekday,
  #orderCalendar .date-strip .day-btn .day-month {
    font-size: 0.8rem;
    opacity: 1;
    min-width: 32px;
  }

  #orderCalendar .date-strip .day-btn .day-number {
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
  }
}

/* -----------------------------------------------------
   Month Calendar Overrides
----------------------------------------------------- */
#orderCalendar .date-nav-meta {
  display: none;
}

#orderCalendar .month-overview-toggle {
  display: none !important;
}

#orderCalendar .calendar-weekday-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

#orderCalendar .calendar-weekday-cell {
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  color: #64748b;
}

#orderCalendar .date-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-height: none;
  overflow: hidden;
  overflow-y: visible;
  scrollbar-width: auto;
}

#orderCalendar .date-strip .day-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  flex: none;
  height: auto;
  aspect-ratio: 1 / 1;
  min-width: 0;
  padding: 0.35rem;
  gap: 0;
  white-space: normal;
  overflow: hidden;
}

#orderCalendar .date-strip .day-btn.day-disabled,
#orderCalendar .date-strip .day-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
  text-decoration: none;
}

#orderCalendar .day-disabled {
  opacity: 0.4;
  pointer-events: none;
}

#orderCalendar .date-strip .day-btn .day-weekday,
#orderCalendar .date-strip .day-btn .day-month {
  display: none;
}

#orderCalendar .date-strip .day-btn .day-number {
  display: block;
  min-width: 0;
  font-size: clamp(0.9rem, 2.6vw, 1.05rem);
  font-weight: 700;
  line-height: 1;
  color: inherit;
  text-align: center;
}

@media (max-width: 767px) {
  #orderCalendar .calendar-weekday-row,
  #orderCalendar .date-strip {
    gap: 6px;
  }

  #orderCalendar .date-strip .day-btn .day-number {
    font-size: clamp(0.85rem, 3.5vw, 1rem);
  }
}

/* -----------------------------------------------------
   Slots Wrapper & Slot Radios
----------------------------------------------------- */
#orderCalendar .slots-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 15px;
}

#orderCalendar .slot-radio-label {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, opacity 0.2s ease-in-out;
  background-color: #ffffff;
  margin-bottom: 0;
}

#orderCalendar .slot-radio-label:hover:not(.disabled-slot) {
  border-color: #3b82f6;
  background-color: #f8fafc;
}

#orderCalendar .slot-radio-label.selected-slot {
  border-color: #2563eb;
  background-color: #eff6ff;
  box-shadow: 0 1px 3px 0 rgba(37, 99, 235, 0.1);
}

/* Progressive enhancement for modern browsers */
#orderCalendar .slot-radio-label:has(input[type="radio"]:checked) {
  border-color: #2563eb;
  background-color: #eff6ff;
  box-shadow: 0 1px 3px 0 rgba(37, 99, 235, 0.1);
}

#orderCalendar .slot-radio-label input[type="radio"] {
  margin-right: 0.75rem;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: #2563eb;
  cursor: inherit;
  margin-top: 0;
}

#orderCalendar .slot-radio-label span {
  font-size: 0.95rem;
  color: #1f2937;
  font-weight: 500;
}

#orderCalendar .slot-radio-label.disabled-slot,
#orderCalendar .slot-radio-label:has(input[type="radio"]:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f9fafb;
  border-color: #e5e7eb;
}

#orderCalendar .slot-radio-label.disabled-slot span,
#orderCalendar .slot-radio-label input[type="radio"]:disabled ~ span {
  text-decoration: line-through;
  color: #6b7280;
}

/* -----------------------------------------------------
   Trust / Warning Sentence
----------------------------------------------------- */
#orderCalendar .trust-sentence {
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.5;
  margin-top: 0.5rem;
}

#orderCalendar .availability-warning {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 0 0 0.75rem 0;
}

/* ---- Total message ---- */
.modal-total-msg {
  font-size: 0.85rem;
  color: #64748b;
  margin: 12px 0 6px;
  font-style: italic;
}

/* ---- Address detail row (city / state / zip) ---- */
.address-detail {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 8px;
}

.address-detail .form-input {
  flex: 1;
  min-width: 80px;
}

/* ---- Ensure <button> elements using .btn inherit page font ---- */
button.btn {
  font-family: inherit;
  font-size: inherit;
}

/* ---- Page CTA triggers ---- */
.modal-cta-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
}

.modal-cta-group .btn {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-outline-blue {
  background: transparent;
  color: #2563eb;
  border: 2px solid #2563eb;
}

.btn-outline-blue:hover {
  background: #eff6ff;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--blue, #2563eb);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
  line-height: 1.5;
}

.btn-text-link:hover {
  color: #1d4ed8;
}

/* ---- Error message ---- */
.form-error-summary,
#orderErrorMsg {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .modal-overlay {
    padding: 12px 10px 32px;
    align-items: flex-start;
  }

  .modal-content {
    padding: 20px 16px 24px;
    border-radius: 12px;
  }

  .extras-grid {
    grid-template-columns: 1fr;
  }

  .modal-cta-group {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}
