/*
  Styles for Booking Page (book.php)
*/

:root {
    --theme-color: #cc5800;
    --theme-color-light: #fff8ed;
}

* {
    box-sizing: border-box;
}

/* General Form & Layout */
.form-step { margin-bottom: 20px; }
.form-group { margin-bottom: 1rem; padding: 15px; }
.form-group label { display: block; margin-bottom: .5rem; font-weight: bold; }
.checkbox-group { display: flex; align-items: center; margin-bottom: 10px; }
.checkbox-group input { margin-right: 10px; }

/* Mobile Price Header */
.mobile-price-header { display: none; transform: translateY(-100%); transition: transform 0.3s ease; }
.mobile-price-header.visible { transform: translateY(0); }
@media (max-width: 768px) {
    .mobile-price-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; background: #fff; border-bottom: 1px solid #eee; position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
    .mobile-price-header .price-summary .price { font-size: 1.2em; font-weight: bold; color: #333; }
    .calculated-price-section { display: none; }
    body.booking-page { padding-top: 75px; overflow-x: hidden; }
    .container {
        width: 100%;
        padding: 0 15px;
    }
}

/* Tour Type & Participant Cards */
.participant-card, .tour-type-card {
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    border-radius: 12px;
    background-color: #fff;
    transition: all 0.2s ease;
}

.tour-type-card.selected {
    border-width: 2px;
    border-color: var(--theme-color);
    background-color: var(--theme-color-light);
}

.participant-card.selected {
    border-width: 2px;
    border-color: var(--theme-color);
    background-color: #cc5800;
    color: #fff;
}

/* Tour Type Card */
.tour-type-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: default; /* Not clickable */
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    margin-bottom: 20px; /* Space below the card */
}

.tour-type-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.4);
    background-color: #fcf4e6; /* Light orange background for selected */
}

.tour-type-card .tour-type-title { font-weight: bold; font-size: 1.2em; margin-bottom: 10px; }
.tour-type-card .inclusions-list { list-style: none; padding: 0; margin: 0; text-align: left; font-size: 0.9em; color: #555; }
.tour-type-card .inclusions-list li { margin-bottom: 5px; position: relative; padding-left: 15px; line-height: 1.2em;}
.tour-type-card .inclusions-list li::before { content: '\2713'; color: var(--theme-color); position: absolute; left: 0; }
.card-footnote { font-size: 0.8em; color: #777; margin-top: 15px; text-align: left; }

/* Participant Card Layout Fix */
.participant-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 120px; }
.person-icons-container { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; }
.person-icon { width: 16px; height: 16px; background-color: #ccc; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: #fff; }
.person-icon.selected { color: #000;}
.participant-card.selected .person-icon { background-color: #fff; color: #000;}
.participant-card p, .participant-card .price-display { margin: 0; padding: 0; line-height: 1.2; }
/*participant-card.selected p, .participant-card { color: #fff; margin: 0; padding: 0; line-height: 1.2; }*/
.participant-card.selected p, .participant-card { color: #fff; }


/* Calendar */
.calendar { width: 100%; border-collapse: collapse; margin-bottom: 20px; border: none; }
.calendar th { border: none; padding: 10px; text-align: center; font-weight: normal; color: #666; }
.calendar td { border: none; padding: 2px; text-align: center; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.calendar-header button { background: var(--theme-color); color: white; border: none; padding: 10px 15px; cursor: pointer; border-radius: 4px; }
.calendar-day-container { width: 40px; height: 40px; line-height: 40px; margin: auto; cursor: pointer; border-radius: 50%; border: 2px solid transparent; }
.calendar-day:not(.disabled):not(.fully-booked) .calendar-day-container { border-color: var(--theme-color); }
.calendar-day:not(.disabled):not(.fully-booked):hover .calendar-day-container { background-color: #cc5800; color: #fff}
.calendar-day.selected .calendar-day-container { background-color: #cc5800; color: #fff; border-color: var(--theme-color); }

/* Disabled/Booked Styles */
.calendar-day.disabled .calendar-day-container { color: #ccc; cursor: not-allowed; border-color: #eee !important; }
.calendar-day.fully-booked .calendar-day-container { background-color: #f8f9fa; color: #ccc; border-color: #eee !important; text-decoration: line-through; cursor: not-allowed; }
.time-slot.disabled { background-color: #f8f9fa; color: #ccc; border-color: #eee; cursor: not-allowed; text-decoration: line-through; }

/* Time Slots & Time Zone */
.time-slots { display: none; margin-bottom: 20px; text-align: center; }
.time-slot { display: inline-block; padding: 10px 20px; border: 2px solid var(--theme-color); color: #333; border-radius: 12px; margin: 0 10px; cursor: pointer; font-weight: normal; }
.time-slot.selected { background-color: #cc5800; color: #fff; border-color: var(--theme-color); }
.timezone-display { text-align: center; color: #777; font-size: 0.9em; margin-bottom: 15px; }

/* Phone Number Input Group */
.phone-input-group { display: flex; }
.country-code-select {
    flex: 0 0 auto; /* Do not grow, take minimum space */
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0; /* Remove right border to merge with input */
    font-family: inherit;
    font-size: 1rem;
    padding: .375rem .75rem;
    background-color: #fff;
    border: 1px solid #ced4da;
    line-height: 1.5;
    -webkit-appearance: none; /* Remove default arrow on some browsers */
    -moz-appearance: none;
    appearance: none;
    padding-right: 25px; /* Make space for custom arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.6-3.6%205.4-7.9%205.4-12.9%200-5-1.8-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 8px 10px;
}
.phone-input-group input[type="tel"] {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Step 2: Price Configurator */
.booking-form-container { display: none; }
.price-configurator { display: flex; flex-wrap: wrap; gap: 30px; }
.price-options { flex: 2; min-width: 300px; }
.price-sidebar { flex: 1; min-width: 250px; position: -webkit-sticky; position: sticky; top: 100px; align-self: flex-start; }
.calculated-price-section { background: #f9f9f9; padding: 20px; border-radius: 12px; }
.participant-selection-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 15px; margin-bottom: 20px; }
.price-display { font-weight: bold; color: #333; }
.calculated-price-section .price { font-size: 2.5rem; font-weight: 700; color: #333; margin-bottom: 5px; }
.calculated-price-section .price-detail { display: block; font-size: 0.9rem; color: #888; margin-bottom: 20px; }
.calculated-price-section .note { font-size: 0.85rem; color: #888; margin-top: 15px; }
.calculated-price-section .button-primary { border-radius: 8px; }



/* === booking_fix_v2.css: mobile overflow & iPhone SE fixes === */

/* 1) Prevent any horizontal overflow globally */
html, body {
  max-width: 100%;
}

/* 2) Ensure flex children can actually shrink instead of overflowing */
.price-options,
.calculated-price-section,
.phone-input-group > * {
  min-width: 0;
}

/* 3) Phone number input: keep country select narrow on tiny screens */
.phone-input-group {
  display: flex;
}
.country-code-select {
  /* On very narrow screens, a content-sized <select> can overflow.
     Constrain it and let the tel input take the remaining width. */
  flex: 0 0 42%;
  max-width: 42%;
}
@media (max-width: 360px) {
  .country-code-select {
    flex-basis: 46%;
    max-width: 46%;
  }
}
.phone-input-group input[type="tel"] {
  flex: 1 1 0;
  min-width: 0; /* critical: allow shrinking inside flex */
}

/* 4) Stack the price columns and remove min-widths on mobile */
@media (max-width: 768px) {
  .price-configurator {
    flex-direction: column;
    gap: 16px;
  }
  .price-options,
  .calculated-price-section {
    min-width: auto;
    width: 100%;
  }
}

/* 5) Apply the mobile padding even if body doesn't have .booking-page class */
@media (max-width: 768px) {
  body {
    padding-top: 75px;
  }
  .container {
    width: 100%;
    padding: 0 15px;
  }
}
/* === end of v2 patch === */



/* === booking_fix_v3.css: calendar column equalization === */
.calendar {
    table-layout: fixed; /* Make all columns equal width */
}
.calendar th,
.calendar td {
    width: 14.2857%; /* 7 equal columns */
    padding: 2px;
    text-align: center;
}
/* === end calendar fix === */

.mobile-booking-button-container {
    display: none;
}

@media (max-width: 768px) {
    .mobile-booking-button-container {
        display: block;
        margin-top: 20px;
    }

    .mobile-booking-button-container .button-primary {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

#options-section {
    display: none !important;
}

#tour-duration-section, #step-3 {
    scroll-margin-top: 85px;
}
