/* === PAGE LAYOUT (Blue only under header) === */
.appointments-page {
  background-color: #083b4c; /* Blue background under header */
  color: #ffffff;
  min-height: auto;
  width: 100%;
  margin: 0 auto;
  padding: 80px 0; /* Space from top */
  display: flex;
  flex-direction: column;
  align-items: center; /* Center content */
  justify-content: flex-start;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Extend blue background only for scrollable area (not header) */

main.appointments-page {
  flex: 1;
  background-color: #083b4c; /* Ensure blue stays behind scroll */
}

/* === INTRO SECTION === */
.intro {
  text-align: center;
  margin-bottom: 40px;
}

.intro h1 {
  font-size: 2.2rem;
  color: #ffffff;
}

.intro p {
  color: #d4d4d4;
}

/* === SERVICES GRID === */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* Create responsive even columns */
  gap: 40px; /* Adjust spacing between cards */
  justify-items: center; /* Center each card */
  align-items: start;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
  box-sizing: border-box;
}

.service-card {
  background-color: #0f495c;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.service-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.card-content {
  padding: 25px;
  text-align: center;
}

.card-content h2 {
  color: #fff;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.card-content p {
  color: #ffffff;
}

.card-content p.duration {
  font-weight: bold;
  color: #a6e1f5;
  margin-bottom: 10px;
}

/* === BOOKING FORM === */
.booking-form {
  background-color: #ffffff;
  color: #083b4c;
  max-width: 700px;
  margin: 60px auto;
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.25);
}

.booking-form h2 {
  margin-bottom: 15px;
  color: #083b4c;
}

.booking-form p {
  color: #555;
  margin-bottom: 30px;
}

.form-group {
  text-align: left;
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #083b4c;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

.submit-btn {
  background-color: #0f495c;
  color: #ffffff;
  padding: 12px 30px;
  border: none;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.submit-btn:hover {
  background-color: #a6e1f5;
  color: #083b4c;
}

/* === FOOTER FIX === */
html,
body {
  height: auto;
  background-color: #083b4c;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

html.booking-overlay-open,
body.booking-overlay-open {
  overflow: hidden;
  height: 100%;
}

main {
  flex: 1;
}

footer {
  margin-top: auto;
}

.appointments-full-bg {
  width: 100%;
  background-color: #083b4c;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

.appointments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  justify-items: center;
  align-items: stretch;
  width: 100%;
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
  box-sizing: border-box;
}

.grid-intro {
  grid-column: 1 / -1;
  text-align: center;
  color: #d4d4d4;
  font-size: 1rem;
  margin-bottom: 10px;
}

.service-card[role="button"] {
  cursor: pointer;
  position: relative;
  outline: none;
}

.service-card[role="button"]:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}

.service-card[role="button"]::after {
  content: "Book this service";
  position: absolute;
  inset: auto 20px 20px 20px;
  background-color: rgba(8, 59, 76, 0.9);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform: translateY(10px);
  opacity: 0;
}

.service-card[role="button"]:hover::after,
.service-card[role="button"]:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.booking-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 22, 32, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 3000;
}

.booking-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.booking-modal {
  width: min(1100px, 95vw);
  max-height: 95vh;
  background: #ffffff;
  color: #083b4c;
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.booking-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border: none;
  background: transparent;
  font-size: 28px;
  color: #083b4c;
  cursor: pointer;
  padding: 0;
}

.booking-modal__header {
  padding: 40px 40px 20px;
  border-bottom: 1px solid #eef2f6;
}

.booking-modal__header .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: #5f7f91;
  margin-bottom: 0.4rem;
}

.booking-modal__header h3 {
  color: #083b4c;
  margin-bottom: 6px;
}

.booking-modal__header .selected-service {
  color: #1e5067;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.booking-modal__body {
  display: flex;
  gap: 30px;
  padding: 30px 40px 20px;
  flex: 1 1 auto;
  overflow-y: auto;
}

.booking-steps {
  flex: 2 1 60%;
}

.booking-summary {
  flex: 1 1 40%;
  background: #f6fbff;
  border: 1px solid #d7e5f0;
  border-radius: 16px;
  padding: 24px;
  height: fit-content;
}

.booking-summary h4 {
  margin-bottom: 6px;
  color: #083b4c;
}

.summary-block {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #d7e5f0;
  font-size: 0.95rem;
}

.summary-block.total {
  border-bottom: none;
  font-size: 1.05rem;
  font-weight: 600;
}

.booking-step {
  display: none;
}

.booking-step.active {
  display: block;
}

.booking-step h4 {
  margin-bottom: 10px;
  color: #083b4c;
}

.calendar-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

#bookingDate,
.flatpickr-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #cddae4;
  font-size: 1rem;
  margin-bottom: 16px;
}

.flatpickr-input {
  background: #fff;
  cursor: pointer;
}

.flatpickr-calendar {
  font-size: 1rem;
  padding: 14px;
}

.flatpickr-day {
  width: 42px;
  height: 36px;
  line-height: 36px;
  font-size: 1rem;
}

.muted {
  color: #6c8596;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

.time-slot {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #c8d8e2;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-slot.active,
.time-slot:hover {
  background: #083b4c;
  color: #fff;
  border-color: #083b4c;
}

.time-slot.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f1f4f7;
  color: #7f8c94;
}

.property-details-card {
  margin-top: 26px;
  border: 1px solid #d7e5f0;
  border-radius: 16px;
  padding: 20px 22px;
  background: #fff;
}

.property-details-card h5 {
  margin: 0 0 6px;
  color: #083b4c;
}

.property-details-hint {
  margin-bottom: 18px;
}

.property-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 18px;
}

.property-details-grid .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.property-details-grid .form-field.full {
  grid-column: 1 / -1;
}

.property-details-grid label {
  font-weight: 600;
  color: #083b4c;
}

.property-details-grid input,
.property-details-grid textarea,
.property-details-grid select {
  border: 1px solid #cddae4;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  color: #083b4c;
  background: #fff;
}

.property-details-grid textarea {
  resize: vertical;
}

.addon-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 18px;
}

.addon-category {
  border: 1px solid #d7e5f0;
  border-radius: 14px;
  background: #fff;
  padding: 16px 20px;
}

.addon-category h5 {
  margin: 0 0 10px;
  color: #083b4c;
  font-size: 1.05rem;
}

.addon-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid #eef2f6;
}

.addon-item:first-of-type {
  border-top: none;
  padding-top: 4px;
}

.addon-item-info strong {
  color: #083b4c;
}

.addon-item-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.addon-price {
  font-weight: 700;
  min-width: 70px;
  text-align: right;
}

.addon-qty-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f3f7fa;
  padding: 4px 10px;
  border-radius: 999px;
}

.qty-btn {
  border: none;
  background: transparent;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 600;
  color: #083b4c;
  cursor: pointer;
  transition: background 0.2s ease;
}

.qty-btn:hover {
  background: #dfeaf2;
}

.addon-qty {
  width: 48px;
  border: none;
  background: transparent;
  text-align: center;
  font-weight: 600;
  color: #083b4c;
  font-size: 1rem;
}

.addon-qty:focus {
  outline: none;
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f6;
  font-size: 0.95rem;
}

.summary-note {
  font-size: 0.85rem;
  color: #5f7f91;
  margin: 10px 0 0;
  font-style: italic;
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-options label {
  border: 1px solid #d7e5f0;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  cursor: pointer;
}

.payment-options input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #083b4c;
  margin-top: 4px;
}

.payment-options label strong {
  color: #083b4c;
}

.payment-options label p {
  color: #1e5067;
  margin-bottom: 0;
}

.square-payment-panel {
  margin-top: 20px;
  padding: 18px;
  border: 1px dashed #9bb8c8;
  border-radius: 14px;
  background: #f6fbff;
  display: none;
}

.square-payment-panel.active {
  display: block;
}

.square-payment-note {
  font-size: 0.9rem;
  color: #5b7283;
  margin-bottom: 12px;
}

#card-container {
  min-height: 120px;
  border: 1px solid #d7e5f0;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  margin-bottom: 12px;
}

.square-pay-btn {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.square-pay-btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.square-pay-btn.loading::after {
  content: 'Processing...';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
}

.square-pay-btn.loading span {
  visibility: hidden;
}

.booking-modal__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 40px 35px;
  border-top: 1px solid #eef2f6;
}

.booking-modal__footer button {
  flex: 1;
  padding: 14px;
  font-size: 1rem;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline {
  background: transparent;
  border: 2px solid #083b4c !important;
  color: #083b4c;
}

.btn-primary {
  background: #083b4c;
  color: #fff;
  border: none;
}

.btn-primary.hidden-pay-full {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.booking-feedback {
  text-align: center;
  padding: 15px 25px 25px;
  font-weight: 600;
  color: #0d815d;
}

.booking-feedback.error {
  color: #b0213b;
}

@media (max-width: 992px) {
  .booking-modal__body {
    flex-direction: column;
  }

  .booking-summary {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .booking-modal__footer {
    flex-direction: column;
  }

  .booking-overlay {
    padding: 10px;
  }
}
