/* booking-form.css — the booking form only.
   Additive: loaded by booking.php alone, so nothing else on the site changes. */

/* ---- field with a leading icon ---- */
.bf-field { position: relative; margin-bottom: 18px; }
.bf-field > label {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 13px; margin-bottom: 7px; color: var(--black);
}
.bf-field > label .req { color: #c62828; }
.bf-field > label .opt { color: var(--gray-mid); font-weight: 500; }

.bf-input-wrap { position: relative; }
.bf-input-wrap > .bf-ico {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 15px; color: var(--gray-mid); pointer-events: none; line-height: 1;
}
.bf-input-wrap .form-control { padding-left: 42px; }
.bf-input-wrap .form-control:focus + .bf-ico,
.bf-input-wrap .form-control:not(:placeholder-shown) + .bf-ico { color: var(--yellow-dark); }

/* ---- From ⇄ To row ---- */
.bf-route {
    display: grid;
    grid-template-columns: 1fr 48px 1fr;
    gap: 12px; align-items: end;
    margin-bottom: 18px;
}
.bf-route .bf-field { margin-bottom: 0; }

.bf-swap {
    width: 44px; height: 46px; margin-bottom: 1px;
    border: 2px solid var(--gray-light); background: var(--white);
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--gray-mid);
    transition: all var(--transition);
    justify-self: center;
}
.bf-swap:hover { border-color: var(--yellow); background: var(--yellow); color: var(--black); }
.bf-swap.spin { transform: rotate(180deg); }

@media (max-width: 560px) {
    .bf-route { grid-template-columns: 1fr; gap: 8px; }
    .bf-swap {
        justify-self: flex-end; margin: -4px 6px -4px 0;
        width: 40px; height: 40px; transform: rotate(90deg);
    }
    .bf-swap.spin { transform: rotate(270deg); }
}

/* ---- autocomplete dropdown ---- */
.ac-list {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
    background: var(--white); border: 2px solid var(--gray-light);
    border-radius: 12px; box-shadow: var(--shadow-lg);
    max-height: 280px; overflow-y: auto; display: none;
}
.ac-list.show { display: block; }

.ac-item {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    width: 100%; padding: 11px 15px; border: 0; background: none;
    text-align: left; cursor: pointer; font: inherit;
    border-bottom: 1px solid var(--gray-light);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.is-active { background: rgba(197,245,0,0.12); }
.ac-main { font-weight: 700; font-size: 14.5px; color: var(--black); }
.ac-sub {
    font-size: 12px; color: var(--gray-mid); width: 100%;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ac-tag {
    background: var(--yellow); color: var(--black);
    font-size: 10.5px; font-weight: 800; padding: 2px 8px;
    border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ---- return date, revealed for round trips ---- */
.bf-return { display: none; }
.bf-return.show { display: block; animation: bfSlide 0.25s ease; }
@keyframes bfSlide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---- small helper note under a field ---- */
.bf-note { font-size: 12.5px; color: var(--gray-mid); margin-top: 6px; display: block; min-height: 18px; }

/* ---- two column rows ---- */
.bf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .bf-row { grid-template-columns: 1fr; gap: 0; } }

@media (prefers-reduced-motion: reduce) {
    .bf-swap, .bf-return.show { transition: none; animation: none; }
}

/* ============================================================
   WIDGET WRAPPER
   Three looks, all driven by the .bw--* class on the wrapper.
   ============================================================ */

.bw { position: relative; }

/* card — the default. White panel, for sidebars and light sections. */
.bw--card {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 26px;
}

/* plain — no box at all, when the section already provides one. */
.bw--plain { padding: 0; }

/* dark — for use on a black hero or CTA band. */
.bw--dark {
    background: var(--black);
    border-radius: var(--radius-lg);
    padding: 26px;
    position: relative;
    overflow: hidden;
}
.bw--dark::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 70% 20%, rgba(197,245,0,0.14) 0%, transparent 60%);
}
.bw--dark > * { position: relative; }
.bw--dark .bw-title { color: var(--white); }
.bw--dark .bw-sub { color: rgba(255,255,255,0.6); }
.bw--dark .bf-field > label { color: rgba(255,255,255,0.85); }
.bw--dark .bf-field > label .opt { color: rgba(255,255,255,0.45); }
.bw--dark .bw-foot { color: rgba(255,255,255,0.45); }
.bw--dark .trip-tabs { background: rgba(255,255,255,0.08); }
.bw--dark .trip-tab { color: rgba(255,255,255,0.6); }
.bw--dark .trip-tab.active { background: var(--yellow); color: var(--black); }
.bw--dark .bf-swap { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: var(--white); }
.bw--dark .bf-swap:hover { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
.bw--dark .bf-note { color: rgba(255,255,255,0.5); }

.bw-title {
    font-family: var(--font-head);
    font-size: 1.2rem; font-weight: 700;
    margin: 0 0 4px; display: flex; align-items: center; gap: 9px;
}
.bw-title i { color: var(--yellow-dark); }
.bw--dark .bw-title i { color: var(--yellow); }

.bw-sub { font-size: 13.5px; color: var(--gray-mid); margin: 0 0 18px; line-height: 1.55; }

.bw-foot {
    font-size: 12px; color: var(--gray-mid);
    text-align: center; margin: 12px 0 0;
}

/* compact — narrow sidebars. Tighter spacing, stacked route. */
.bw--compact .bf-field { margin-bottom: 12px; }
.bw--compact .bf-row { grid-template-columns: 1fr 1fr; gap: 10px; }
.bw--compact .bf-route { grid-template-columns: 1fr; gap: 6px; }
.bw--compact .bf-swap {
    justify-self: flex-end; margin: -2px 6px;
    width: 36px; height: 36px; transform: rotate(90deg);
}
.bw--compact .bf-swap.spin { transform: rotate(270deg); }
.bw--compact .bw-sub { display: none; }

/* Stop a sidebar widget's dropdown being clipped by the column. */
.bw .ac-list { z-index: 80; }

/* ============================================================
   WIDE LAYOUT — three columns, centred, for a full width strip
   under the hero. Collapses to one field per row on mobile.
   Use:  $bw = ['layout' => 'wide', 'style' => 'card'];
   ============================================================ */

.bw--wide { max-width: 1080px; margin-inline: auto; }

/* The grid only applies in wide mode; stacked widgets are untouched. */
.bw--wide .bf-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 18px;
    align-items: start;
}

/* .bf-row normally makes its own 2-up grid. In wide mode it dissolves so its
   children become direct children of the 3-column grid instead. */
.bw--wide .bf-grid .bf-row { display: contents; }

/* From ⇄ To keeps its swap button and takes two of the three columns. */
.bw--wide .bf-route {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 46px 1fr;
    gap: 10px;
    align-items: end;
    margin-bottom: 18px;
}
.bw--wide .bf-route .bf-field { margin-bottom: 0; }
.bw--wide .bf-swap { margin-bottom: 1px; }

/* The return date sits in the flow like any other field and simply
   disappears when the trip is not a round trip. */
.bw--wide .bf-return { grid-column: auto; }

.bw--wide .trip-tabs { max-width: 520px; margin-inline: auto; margin-bottom: 22px; }
.bw--wide .bw-title,
.bw--wide .bw-sub { text-align: center; }
.bw--wide .bw-sub { max-width: 560px; margin-inline: auto; }

/* One clear action, not a full width stretch across the whole card. */
.bw--wide .btn[type="submit"] {
    max-width: 340px;
    margin: 6px auto 0;
    display: flex;
}

/* Tablet: two columns reads better than three. */
@media (max-width: 900px) {
    .bw--wide .bf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bw--wide .bf-route { grid-column: span 2; }
}

/* Mobile: one field per row, exactly as asked. */
@media (max-width: 620px) {
    .bw--wide { max-width: none; }
    .bw--wide .bf-grid { grid-template-columns: 1fr; gap: 0; }
    .bw--wide .bf-route {
        grid-column: auto;
        grid-template-columns: 1fr;
        gap: 6px;
        margin-bottom: 18px;
    }
    .bw--wide .bf-route .bf-field { margin-bottom: 0; }
    .bw--wide .bf-swap {
        justify-self: flex-end;
        margin: -2px 6px;
        width: 38px; height: 38px;
        transform: rotate(90deg);
    }
    .bw--wide .bf-swap.spin { transform: rotate(270deg); }
    .bw--wide .btn[type="submit"] { max-width: none; }
}

/* A hero strip: the widget sits centred over the join between the black
   hero and the white section below it. */
.hero-booking-strip {
    position: relative;
    z-index: 5;
    margin-top: -56px;
    margin-bottom: 8px;
}
.hero-booking-strip .bw--card {
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
@media (max-width: 900px) {
    .hero-booking-strip { margin-top: 24px; }
}

/* Centred hero, used with the wide booking strip below it. */
.hero--center { min-height: auto; padding: 64px 0 96px; }
.hero-center { text-align: center; max-width: 780px; margin-inline: auto; }
.hero-center .hero-desc { margin-left: auto; margin-right: auto; max-width: 60ch; }
.hero-center .hero-stats { justify-content: center; gap: 42px; }
@media (max-width: 900px) {
    .hero--center { padding: 48px 0 40px; }
    .hero-center .hero-stats { gap: 26px; }
}

/* ============================================================
   ROUTE MAP — Leaflet with OpenStreetMap tiles.
   Free, no API key, no account needed.
   ============================================================ */

.bf-map {
    grid-column: 1 / -1;          /* full width inside the 3-column grid */
    margin-bottom: 18px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-light);
    animation: bfSlide 0.3s ease;
}
.bf-map[hidden] { display: none; }

.bf-map-canvas {
    width: 100%;
    height: 240px;
    background: #e8ecef;
}
@media (max-width: 620px) { .bf-map-canvas { height: 190px; } }

.bf-map-info {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 11px 16px;
    background: var(--black);
}
.bf-map-stat {
    color: var(--yellow);
    font-family: var(--font-head);
    font-weight: 700; font-size: 14px;
}
.bf-map-stat:empty { display: none; }
.bf-map-src {
    margin-left: auto;
    color: rgba(255,255,255,0.45);
    font-size: 11.5px;
}
.bf-map-src:empty { display: none; }

/* Start and end pins */
.bf-pin {
    border-radius: 50%;
    border: 3px solid var(--white);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.bf-pin--from { background: var(--yellow); }
.bf-pin--to   { background: var(--black); }

/* Leaflet's own furniture, toned down to match the site */
.bf-map .leaflet-container { font-family: var(--font-body); }
.bf-map .leaflet-control-attribution {
    background: rgba(255,255,255,0.85);
    font-size: 10px;
}
.bf-map .leaflet-bar a {
    color: var(--black);
    border-bottom-color: var(--gray-light);
}
.bf-map .leaflet-bar a:hover { background: var(--yellow); }

/* In a narrow sidebar the map is shorter, if it is switched on at all. */
.bw--compact .bf-map-canvas { height: 170px; }
.bw--compact .bf-map-info { padding: 9px 12px; gap: 10px; }
.bw--compact .bf-map-stat { font-size: 12.5px; }

/* The booking page itself uses the wide widget, so it needs more room than
   the default 900px booking container. */
.booking-container--wide { max-width: 1120px; }

/* ============================================================
   FARE BREAKDOWN — every line that makes up the total, so the
   customer can see exactly what driver bata and km cost.
   ============================================================ */

.fare-lines {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--gray-light);
}
.fare-lines:empty { display: none; }

.fare-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--gray-mid);
}
.fare-line span {
    flex: 1;
    line-height: 1.45;
}
.fare-line strong {
    color: var(--black);
    font-weight: 700;
    white-space: nowrap;
}

/* Starter suggestions shown on click, before anything is typed. */
.ac-tag--soft {
    background: var(--gray-light);
    color: var(--gray-mid);
}

/* Route and city pages can carry a banner image, set in the admin editor. */
.page-hero--img { position: relative; overflow: hidden; }
.page-hero--img::before {
    content: '';
    position: absolute; inset: 0;
    background-image: var(--page-hero-img);
    background-size: cover;
    background-position: center;
    opacity: 0.3;
}
.page-hero--img > * { position: relative; z-index: 1; }