/* ==========================================================================
   BA Book Everything presentation (booking form, availability calendar,
   datepicker). Replaces the plugin's babe-style.css on tour pages; the
   functional show/hide rules from that file are reproduced here.
   ========================================================================== */

/* Functional states copied from babe-style.css */
#error_group { display: none; }
.view-list-details { display: none; }
.input_select_field .input_select_list { display: none; }
.cal-month-block { display: none; }
.cal-month-block.cal-month-active { display: block; }
.view-rate-details { display: none; }

/* Icons from Font Awesome are not loaded on tour pages */
#booking_form_block i[class*="fa-"], #av-cal i[class*="fa-"], .wfp-bookform .spin_f i { display: none; }

/* Booking form ------------------------------------------------------------ */

#booking_form_block { margin: 0; }
#booking_form .input_group { display: grid; gap: 1rem; }
#booking_form .booking-form-block { display: flex; flex-direction: column; gap: .35rem; }
#booking_form .booking_form_input_label { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink); }
#booking_form .booking_form_step_num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 24px; height: 24px; border-radius: 50%;
	background: var(--sun); color: var(--ink); font-size: .8rem; font-weight: 700;
}
#booking_form .booking-date { position: relative; }
#booking_form input.booking_date {
	width: 100%; min-height: 48px; padding: .6rem .8rem .6rem 2.6rem;
	border: 1px solid var(--field-line); border-radius: 6px; background-color: var(--field);
	font: 400 1rem var(--sans); color: var(--ink); cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386601c' stroke-width='1.7' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='1.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-size: 20px; background-position: .75rem center;
}
#booking_form select, #booking-guests-result select, #booking-times select {
	width: 100%; min-height: 48px; padding: .55rem .75rem;
	border: 1px solid var(--field-line); border-radius: 6px; background-color: var(--field); font: 400 1rem var(--sans); color: var(--ink);
}
#booking-guests-result { font-size: .95rem; color: var(--muted); }
#booking-guests-result .select_guests_block,
#booking-guests-result .booking_guests_block,
#booking-guests-result > div { display: grid; gap: .5rem; }
#booking-guests-result label { color: var(--ink); font-weight: 500; }
#booking-guests-result .input_select_field,
#booking-guests-result .select_guests_line { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }

/* BA "select" widgets rendered as a button + list */
.input_select_field { position: relative; }
.input_select_field .input_select_title {
	display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: .55rem .8rem;
	border: 1px solid var(--field-line); border-radius: 6px; background-color: var(--field); cursor: pointer; color: var(--ink);
}
.input_select_field .input_select_list {
	position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: .35rem; list-style: none;
	background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 260px; overflow: auto;
}
.input_select_field .term_item { padding: .55rem .6rem; border-radius: 4px; cursor: pointer; min-height: 40px; }
.input_select_field .term_item:hover, .input_select_field .term_item_selected { background: var(--olive-soft); }

#booking-times { display: flex; flex-wrap: wrap; gap: .5rem; }
#booking-times .booking_time_item, #booking-times label { min-height: 44px; }

#total_group { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: 1.1rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--sun-soft); }
#total_group .booking_form_input_label { font-weight: 600; color: var(--ink); }
#booking_form_total { font: 700 1.45rem var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
#booking_form_total:empty::after { content: "–"; font-weight: 400; color: var(--muted); }
#booking_form_total label { display: none; }

#error_group { margin-top: .75rem; padding: .7rem .9rem; border-radius: var(--radius); background: var(--err-bg); color: var(--err); font-weight: 600; }

#booking_form .submit_group { margin-top: 1rem; }
#booking_form .booking_form_submit {
	width: 100%; min-height: 52px; padding: .75rem 1rem;
	border: 0; border-radius: 3px;
	background: var(--sun); color: var(--ink); font: 700 1.05rem var(--sans); cursor: pointer;
}
#booking_form .booking_form_submit:hover { background: var(--brass-2); }
#booking_form .booking_form_submit:disabled { opacity: .55; cursor: not-allowed; }
.booking_form_login_required { padding: .8rem; border-radius: var(--radius); background: var(--tint); }

.spin_f { display: inline-block; width: 22px; height: 22px; border: 3px solid var(--line-2); border-top-color: var(--olive); border-radius: 50%; animation: wfp-spin .8s linear infinite; }
@keyframes wfp-spin { to { transform: rotate(360deg); } }

/* Services / fees inside the form */
.booking-services-block, .booking-fees-block { padding-top: .5rem; border-top: 1px solid var(--line); }
.block_services_header { font-weight: 600; }

/* Availability calendar ----------------------------------------------------- */

#av-cal { max-width: 640px; }
.cal-month-bar {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	padding: .5rem; margin-bottom: .5rem; font-weight: 700; color: var(--ink);
	border-bottom: 1px solid var(--line);
}
.cal-month-prev, .cal-month-next {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; min-height: 44px; border: 0; border-radius: 50%; cursor: pointer; background: var(--sand);
	font-size: 0;
}
.cal-month-prev::before { content: "‹"; font-size: 1.5rem; line-height: 1; }
.cal-month-next::before { content: "›"; font-size: 1.5rem; line-height: 1; }
.cal-month-prev:hover, .cal-month-next:hover { background: var(--cream); }
.cal-week-names { display: grid; grid-template-columns: repeat(7, 1fr); font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: center; padding: .25rem 0; }
.cal-dates-block { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
	position: relative; min-height: 56px; padding: .35rem;
	border: 1px solid var(--line); border-radius: 4px; background: #fff; font-variant-numeric: tabular-nums;
}
.cal-cell.cal-cell-invisible { border: 0; background: none; }
.cal-cell.cal-cell-empty, .cal-cell.cal-cell-disabled { background: var(--tint); color: #8b8e7f; }
.cal-cell .cal-cell-date { font-weight: 600; color: var(--ink); font-size: .92rem; }
.cal-cell.cal-cell-empty .cal-cell-date, .cal-cell.cal-cell-disabled .cal-cell-date { color: #8b8e7f; font-weight: 400; }
.cal-cell .cal-cell-pricefrom { display: block; margin-top: .15rem; font-size: .72rem; color: var(--olive); font-weight: 600; }
.cal-cell.cal-cell-active { cursor: pointer; border-color: var(--olive-2); }
.cal-cell.cal-cell-active:hover { background: var(--olive-soft); }
.cal-cell.cal-cell-active.cal-cell-selected { background: var(--ink); border-color: var(--ink); }
.cal-cell.cal-cell-active.cal-cell-selected .cal-cell-date, .cal-cell.cal-cell-active.cal-cell-selected .cal-cell-pricefrom { color: #fff; }
.cal-cell:hover .view-rate-details { display: block; }
.view-rate-details { position: absolute; z-index: 10; left: 0; top: 100%; width: 240px; padding: .6rem; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); font-size: .85rem; color: var(--text); }
.cal-cell:nth-child(7n) .view-rate-details, .cal-cell:nth-child(7n-1) .view-rate-details { left: auto; right: 0; }
.view-rate-details table { width: 100%; border-collapse: collapse; }
.view-rate-details td, .view-rate-details th { padding: .2rem; text-align: left; }
@media (max-width: 520px) {
	.cal-cell { min-height: 48px; padding: .25rem; }
	.cal-cell .cal-cell-pricefrom { font-size: .64rem; }
	.view-rate-details { display: none !important; }
}

/* jQuery UI datepicker (BA dependency) ------------------------------------------ */

.ui-datepicker { z-index: 60 !important; width: 19rem; padding: .6rem; background: #fff; border: 1px solid var(--line-2) !important; border-radius: var(--radius); box-shadow: var(--shadow); font: 400 .95rem var(--sans); }
.ui-datepicker .ui-datepicker-header { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; margin-bottom: .35rem; background: none; border: 0; font-weight: 700; color: var(--ink); }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position: absolute; top: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: var(--radius); }
.ui-datepicker .ui-datepicker-prev { left: 0; }
.ui-datepicker .ui-datepicker-next { right: 0; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: none; }
.ui-datepicker .ui-datepicker-prev::before { content: "‹"; font-size: 1.5rem; }
.ui-datepicker .ui-datepicker-next::before { content: "›"; font-size: 1.5rem; }
.ui-datepicker .ui-datepicker-prev:hover, .ui-datepicker .ui-datepicker-next:hover { background: var(--olive-soft); border: 0; }
.ui-datepicker table { width: 100%; border-collapse: collapse; }
.ui-datepicker th { font-size: .75rem; color: var(--muted); padding: .3rem 0; }
.ui-datepicker td { padding: 2px; }
.ui-datepicker td a, .ui-datepicker td span { display: flex; align-items: center; justify-content: center; height: 36px; border: 0 !important; border-radius: 4px; background: none !important; color: var(--ink) !important; text-decoration: none; font-weight: 600; }
.ui-datepicker td.ui-state-disabled span { color: #a3a596 !important; font-weight: 400; }
.ui-datepicker td a:hover { background: var(--olive-soft) !important; }
.ui-datepicker td .ui-state-active, .ui-datepicker td a.ui-state-active { background: var(--ink) !important; color: #fff !important; }
.ui-datepicker td .ui-state-highlight { box-shadow: inset 0 0 0 2px var(--sun); }

/* BA system pages (checkout, confirmation, account) -------------------------- */

.wfp-ba-screen { max-width: 960px; }
.wfp-ba-screen table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; }
.wfp-ba-screen th, .wfp-ba-screen td { padding: .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.wfp-ba-screen .btn, .wfp-ba-screen button[type="submit"], .wfp-ba-screen input[type="submit"] {
	min-height: 48px; padding: .7rem 1.35rem; border: 0; border-radius: 3px;
	background: var(--sun); color: var(--ink); font-weight: 700; cursor: pointer;
}

/* Month bar above weekday names */
.cal-month-block.cal-month-active { display: flex; flex-direction: column; }
.cal-month-block .cal-month-bar { order: -1; }
#booking_form input.booking_date:focus, #booking_form select:focus, .input_select_field .input_select_title:focus-within { border-color: var(--brass); background-color: #fff; box-shadow: 0 0 0 4px rgba(251, 178, 20, .2); outline: 2px solid transparent; }
#booking_form .booking_form_input_label { font-size: .9rem; }
