/* =========================
   GENERAL FORM STYLES
   ========================= */

.booking-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  color-scheme: light;
}

.booking-container label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.booking-container input,
.booking-container select {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  box-sizing: border-box;
  background-color: #fff;
  color: #000;
}

.booking-container select {
  cursor: pointer;
}

.booking-container button {
  width: 100%;
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
}

/* =========================
   VISIBILITY
   ========================= */

.hidden {
  display: none !important;
}

#booking-details {
  max-height: 2000px;
  opacity: 1;
}

/* =========================
   FORM GROUPS
   ========================= */

.form-group {
  margin-bottom: 14px;
}

/* =========================
   AVAILABILITY / STAY INFO
   ========================= */

#availabilityMessage {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
}

/* FIX label size inside availability message */
#availabilityMessage label {
  font-size: 13px !important;
  font-weight: 400;
  margin-bottom: 0;
}

/* Catch-all safety */
#availabilityMessage *,
#nights-display {
  font-size: 13px !important;
}

/* =========================
   TOTAL DISPLAY
   ========================= */

#total {
  font-weight: bold;
}

/* =========================
   GUEST SECTION
   ========================= */

.guest-section {
  margin: 12px 0;
}

.guest-select {
  display: flex;
  gap: 12px;
}

.guest-field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.guest-field label {
  margin-bottom: 4px;
}

.guest-field select {
  padding: 8px;
  font-size: 14px;
}

/* =========================
   STRIPE CARD ELEMENT
   ========================= */

#card-element {
  margin-top: 12px;
  padding: 10px;
  background-color: #fff;
}

/* =========================
   MESSAGE TEXT
   ========================= */

#message {
  margin-top: 12px;
  font-size: 14px;
}

/* =========================
   BUTTON STATES
   ========================= */

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================
   ROUNDED CORNERS
   ========================= */

.booking-container input,
.booking-container select,
.booking-container textarea,
#card-element {
  border-radius: 6px;
}

.booking-container button {
  border-radius: 6px;
}

/* =========================
   UNIFIED BORDER STYLE
   ========================= */

.booking-container input,
.booking-container select,
.booking-container textarea,
#card-element,
.booking-container button {
  border: 1px solid #d1d5db;
}

/* =========================
   GOOGLE PLACE AUTOCOMPLETE
   ========================= */

gmp-place-autocomplete {
  display: block;
  width: 100%;
  min-height: 48px;
  background-color: #ffffff;
  color: #000000;

  --gmp-place-autocomplete-background-color: #ffffff;
  --gmp-place-autocomplete-text-color: #000000;
  --gmp-place-autocomplete-placeholder-color: #666666;
  --gmp-place-autocomplete-border-color: #d1d5db;
}

/* =========================
   GOOGLE AUTOFILL FIX
   ========================= */

.booking-container input:-webkit-autofill,
.booking-container input:-webkit-autofill:hover,
.booking-container input:-webkit-autofill:focus,
.booking-container textarea:-webkit-autofill,
.booking-container textarea:-webkit-autofill:hover,
.booking-container textarea:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #000000 !important;
  caret-color: #000000;
}

/* =======================
   Booking Form & Checkout Styles
   ======================= */

.booking-container,
#checkout-section {
  max-width: 500px;       /* same width as booking form */
  margin: 0 auto;      /* center on page */
  background: #fff;       /* white background */
  border: 1px solid #ddd; /* subtle border */
  border-radius: 10px;    /* rounded corners */
  box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* soft shadow */
  font-family: Arial, sans-serif;
  padding: 20px;
}

#checkout-section.hidden {
  display: none;
}

#checkout-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2rem;
  color: #333;
}

.booking-summary {
  margin-bottom: 20px;
}

.booking-summary .summary-pitch {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

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

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

/* Left-align the values in the summary list */
.booking-summary .summary-list li span:last-child {
  text-align: left;  /* force values to align left */
  min-width: auto;   /* remove extra spacing */
}

.booking-summary .summary-total {
  font-size: 1.05rem;
  font-weight: bold;
  margin-bottom: 15px;
  text-align: right;
}

/* Match Edit booking button to Check availability */
#edit-booking {
  width: 100%;                 /* full width like booking form buttons */
  display: block;
  padding: 10px 16px;          /* same padding as other buttons */
  font-size: 14px;             /* same font size */
  background-color: #26d07c;   /* same primary color as proceed button */
  border: 1px solid #26d07c;   /* same border */
  color: #ffffff;              /* white text */
  border-radius: 6px;          /* same rounded corners */
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.2px;
  text-align: center;
}

#edit-booking:hover {
  background-color: #22bd70;   /* same hover effect */
  border-color: #22bd70;
}


#booking-details .form-group {
  margin-bottom: 12px;
}

#booking-details label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 0.95rem;
}

#booking-details input {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

#booking-details #pay-button {
  margin-top: 10px;
  width: 100%;
  padding: 10px 0;
  font-size: 1rem;
  background-color: #26d07c;  /* match Edit booking */
  border: 1px solid #26d07c;  /* same border color */
  color: #ffffff;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.2px;
}

#booking-details #pay-button:hover {
  background-color: #22bd70;  /* same hover as Edit booking */
  border-color: #22bd70;
}

#booking-details #pay-button:disabled {
  background-color: #aaa;
  border-color: #aaa;
  cursor: not-allowed;
}



/* =========================
   MOBILE STYLES (≤ 480px)
   ========================= */

@media (max-width: 480px) {

  .booking-container {
    padding: 12px;
  }

  .guest-select {
    flex-direction: column;
    gap: 16px;
  }

  .guest-field select {
    min-height: 44px;
    padding: 10px;
    font-size: 16px;
  }

  .booking-container input,
  .booking-container select {
    font-size: 16px;
  }

  .booking-container button {
    font-size: 16px;
  }
}

#payment-message:not(:empty) {
  padding-bottom: 24px;
}


/* =========================
   STAY NOTE – MATCH 13px
   ========================= */

.stay-note {
  font-size: 13px;
  line-height: 1.4;
}

.stay-note strong {
  font-size: 13px;
  font-weight: 600;
}

/* =========================
   STAY LENGTH – MATCH 13px
   ========================= */

.form-group p {
  font-size: 13px;
  line-height: 1.4;
}

.form-group p strong,
.form-group p span {
  font-size: 13px;
  font-weight: 600;
}

/* =========================
   PRIMARY ACTION BUTTONS
   ========================= */

#proceed-booking,
#pay-button {
  background-color: #26d07c;
  border-color: #26d07c;
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.2px;
}

#proceed-booking:hover,
#pay-button:hover {
  background-color: #22bd70; /* slightly darker on hover */
  border-color: #22bd70;
}

/* =========================
   MOBILE STAY TEXT FIX
   ========================= */

@media (max-width: 480px) {
  .stay-note,
  .stay-note *,
  #nights-display,
  #nights-display * {
    font-size: 13px !important;
    line-height: 1.4;
  }
}

/* =======================
   Responsive / Mobile Styling
   ======================= */
@media (max-width: 480px) {

  .booking-container,
  #checkout-section {
    margin: 15px 10px;
  }

  #checkout-section h3,
  .booking-summary .summary-pitch {
    font-size: 1rem;
  }

  .booking-summary .summary-list li {
    font-size: 0.9rem;
    padding: 4px 0;
  }

  .booking-summary .summary-total {
    font-size: 1rem;
  }

  #booking-details label,
  #booking-details input {
    font-size: 0.9rem;
  }

  #booking-details #pay-button {
    font-size: 0.95rem;
    padding: 8px 0;
  }
}


#booking-details {
  border-top: 1px solid #e5e7eb;
}

.form-group.total {
  margin-top: 16px;
  padding: 12px;
  background-color: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-weight: 600;
}

.booking-container input:focus,
.booking-container select:focus {
  outline: none;
  border-color: #26d07c;
  box-shadow: 0 0 0 2px rgba(38, 208, 124, 0.15);
}

.stay-length {
    font-size: 13px;
}

/* =========================
   CHECKOUT SUMMARY FLEX LAYOUT
   ========================= */

.booking-summary .summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.booking-summary .summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 8px;
  min-width: 0;
}

.booking-summary .summary-item span:first-child {
  font-weight: 500;
  font-size: 0.95rem;
}

.booking-summary .summary-item span:last-child {
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 2px;
}

.booking-summary .summary-total {
  font-size: 1.05rem;
  font-weight: bold;
  text-align: right;
  margin-top: 10px;
}

/* =========================
   FORCE PERFECT MOBILE FIT ≤480px
   ========================= */

@media (max-width: 480px) {

  /* Keep everything inside screen */
  html, body {
    overflow-x: hidden;
  }

  .booking-container,
  #checkout-section {
    width: 100%;
    max-width: 100%;
    margin: 10px auto;
    border-radius: 8px;
  }

  /* Prevent anything stretching wider */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Inputs + selects fit perfectly */
  .booking-container input,
  .booking-container select,
  .booking-container textarea {
    width: 100%;
    font-size: 16px;     /* prevents iPhone zoom */
    padding: 10px;
    min-height: 44px;
  }

  /* Buttons */
  .booking-container button,
  #proceed-booking,
  #pay-button,
  #edit-booking {
    width: 100%;
    font-size: 16px;
    padding: 12px;
    min-height: 48px;
  }

  /* Guest row stack nicely */
  .guest-select {
    flex-direction: column;
    gap: 12px;
  }

  /* Summary rows stack clean */
  .booking-summary .summary-row {
    flex-direction: column;
    gap: 6px;
  }

  /* Reduce font sizes slightly */
  label {
    font-size: 13px;
  }

  .booking-summary .summary-item span:first-child {
    font-size: 0.9rem;
  }

  .booking-summary .summary-item span:last-child {
    font-size: 0.95rem;
  }

  /* Stripe box */
  #card-element {
    padding: 12px;
  }

  /* Fix spacing around booking details */
  #booking-details {
    padding-top: 16px;
  }
}

/* =========================
   SMALLER DATE FIELDS (MOBILE)
   ========================= */
@media (max-width: 480px) {

  input[type="date"] {
    min-height: 36px !important;
    padding: 6px 8px !important;
    font-size: 15px !important;
  }

}

/* =========================
   FIX DATE INPUT OVERFLOW MOBILE
   ========================= */
@media (max-width: 480px) {

  input[type="date"] {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    box-sizing: border-box;
  }

  /* stop container causing overflow */
  .booking-container,
  #checkout-section {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

}

@media (max-width: 480px) {

  .form-group {
    width: 100%;
    overflow: hidden;
  }

  input[type="date"] {
    width: 100%;
    max-width: 100%;
  }

}

/* =========================
   NUCLEAR MOBILE WIDTH FIX
   Stops ANY right overflow
   ========================= */

@media (max-width: 480px) {

  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  .booking-container,
  #checkout-section,
  form,
  .form-group {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
  }

  /* Fix ALL inputs including date */
  input,
  select,
  textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Specifically date inputs */
  input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100% !important;
    max-width: 100% !important;
  }

}

/* =========================
   BOOKING SUMMARY 3-COLUMN MOBILE FIX
   ========================= */
@media (max-width: 480px) {

  .booking-summary .summary-row {
    display: flex;
    flex-direction: row !important;  
    justify-content: space-between;
    gap: 6px;
  }

  .booking-summary .summary-item {
    flex: 1;
    min-width: 0;
    padding: 6px 4px;
  }

  .booking-summary .summary-item span:first-child {
    font-size: 0.8rem;
  }

  .booking-summary .summary-item span:last-child {
    font-size: 0.9rem;
    font-weight: 600;
  }

}

/* =========================
   PREMIUM MOBILE BOOKING SUMMARY
   ========================= */
@media (max-width: 480px) {

  /* Card look */
  .booking-summary {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 18px;
  }

  /* 3-column layout */
  .booking-summary .summary-row {
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    gap: 8px;
  }

  .booking-summary .summary-item {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    border-right: 1px solid #e5e7eb;
  }

  /* remove last divider */
  .booking-summary .summary-item:last-child {
    border-right: none;
  }

  /* LABEL (Arrive, Nights, Depart) */
  .booking-summary .summary-item span:first-child {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: #6b7280; /* subtle grey */
    margin-bottom: 2px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
  }

  /* VALUE (dates/numbers) */
  .booking-summary .summary-item span:last-child {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
  }

  /* total line */
  .booking-summary .summary-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
    font-size: 1.05rem;
    font-weight: 700;
  }

}

.summary-row.row-3cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
  gap: 12px; /* optional spacing */
}


#confirmation-section.hidden {
  display: none;
}

#confirmation-section {
  text-align: center;
  padding: 20px;
  border: 2px solid #4CAF50;
  border-radius: 10px;
  background-color: #f9fff9;
  color: #2e7d32;
  margin-top: 20px;
}


#confirmation-section h2 {
  margin-bottom: 15px;
}

.booking-container textarea {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 16px;
    padding: 10px;
    min-height: 44px;
}

#special-requirements {
  width: 100%;                 /* full width like other inputs */
  box-sizing: border-box;      /* include padding/border in width */
  padding: 8px 10px;           /* same padding as #booking-details inputs */
  font-size: 0.95rem;          /* match other inputs */
  border: 1px solid #ccc;      /* same border color as other inputs */
  border-radius: 6px;          /* same rounded corners */
  background-color: #fff;      /* match background */
  line-height: 1.4;            /* match input line-height */
  height: 110px;                /* fixed height like other inputs */
  min-height:110px;
  resize: none;                /* prevent user resizing */
  display: block;              /* ensure it fills its container */
  font-family: 'Raleway', sans-serif;
}

@media (max-width: 480px) {
  #special-requirements {
    font-size: 16px;
    padding: 10px;
    height: 44px;              /* same as mobile input fields */
    min-height: 44px;
  }
}

/* =========================
   Checkout Section - Green Focus Styling
   ========================= */

/* Apply green border & subtle shadow on focus */
#checkout-section input:focus,
#checkout-section textarea:focus,
#checkout-section select:focus {
  outline: none; /* remove default outline */
  border-color: #26d07c; /* green border */
  box-shadow: 0 0 0 2px rgba(38, 208, 124, 0.15); /* subtle glow */
}

/* Remove black background / text-fill from webkit autofill */
#checkout-section input:-webkit-autofill,
#checkout-section input:-webkit-autofill:hover,
#checkout-section input:-webkit-autofill:focus,
#checkout-section textarea:-webkit-autofill,
#checkout-section textarea:-webkit-autofill:hover,
#checkout-section textarea:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #000000 !important;
  caret-color: #000000;
}

/* Optional: make select arrows consistent on some browsers */
#checkout-section select {
  -webkit-appearance: none; /* iOS Safari */
  -moz-appearance: none;    /* Firefox */
  appearance: none;         /* standard */
}
