/*
 * Hourly rentals: homepage search switch, car-card badge, promotional banner.
 * Colours come from the theme's CSS variables (Theme Options), so the existing palette
 * (gold primary, beige secondary, near-black headings) is reused, not redefined.
 */

/* ---------- Homepage search: Full-Day / Hourly switch ---------- */
.booking-type-search-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: var(--secondary-color, #f6f3ed);
    border: 1px solid var(--bs-border-color, #ddd6c9);
}

.booking-type-search-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    margin: 0;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color, #5e5b55);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.booking-type-search-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.booking-type-search-option:hover {
    color: var(--heading-color, #202020);
}

.booking-type-search-option.is-active,
.booking-type-search-option:has(input:checked) {
    background: var(--primary-color);
    color: var(--primary-button-text-color, #202020);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.booking-type-search-option:has(input:focus-visible) {
    outline: 2px solid var(--heading-color, #202020);
    outline-offset: 2px;
}

.box-search-advance .js-search-type-section[hidden] {
    display: none !important;
}

.box-search-advance .item-search .js-hourly-search-date {
    width: 100%;
    padding-left: 30px !important;
    border: 0;
    box-shadow: none;
    background: transparent;
    cursor: pointer;
}

.box-search-advance .item-search .js-hourly-search-date:focus {
    outline: none;
    box-shadow: none;
}

/* Hourly mode has two more fields: share the row on wide screens. Tablet/mobile keep the
   theme's own stacking rules. */
@media (min-width: 1200px) {
    .box-search-advance .box-bottom-search.is-hourly {
        flex-wrap: nowrap;
    }

    .box-search-advance .box-bottom-search.is-hourly .item-search {
        flex: 1 1 19% !important;
        width: auto !important;
        max-width: 19% !important;
        min-width: 0;
        padding: 0 20px;
    }

    .box-search-advance .box-bottom-search.is-hourly .item-search--compact {
        flex-basis: 13% !important;
        max-width: 13% !important;
    }

    .box-search-advance .box-bottom-search.is-hourly .item-search:last-child {
        flex-basis: 17% !important;
        max-width: 17% !important;
        padding: 0 16px 0 4px;
    }

    .box-search-advance .box-bottom-search.is-hourly .item-search:last-child .btn {
        width: 100%;
        justify-content: center;
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 575.98px) {
    .booking-type-search-switch {
        display: flex;
        width: 100%;
    }

    .booking-type-search-option {
        flex: 1 1 0;
        justify-content: center;
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* The homepage integration stylesheet lays the search out as a 4-column grid
   (#page-home #js-box-search-advance …). Hourly mode adds two fields, so give it its own
   columns with the same specificity. The hidden full-day date item is display:none and
   takes no column. */
@media (min-width: 1200px) {
    #page-home #js-box-search-advance .box-bottom-search.is-hourly {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 0.9fr) minmax(0, 0.6fr) minmax(0, 0.6fr) auto !important;
    }
}

@media (max-width: 767.98px) {
    /* The integration stylesheet hides the search top bar on phones; keep it when it holds
       the Full-Day / Hourly switch ("Need help?" stays hidden via d-none d-md-flex). */
    #page-home #js-box-search-advance .box-top-search:has(.booking-type-search-switch) {
        display: flex !important;
        margin-bottom: 10px;
    }

    #page-home #js-box-search-advance .box-top-search:has(.booking-type-search-switch) .left-top-search {
        width: 100%;
    }
}

@media (max-width: 1199.98px) {
    #page-home #js-box-search-advance .box-bottom-search.is-hourly .js-search-type-section[data-booking-type='hourly']:not(.item-search--compact) {
        grid-column: 1 / -1;
    }
}

/* ---------- Car cards: "Hourly from …" ---------- */
.car-hourly-from {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--secondary-color, #f6f3ed);
    color: var(--heading-color, #202020);
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Promotional banner ---------- */
.shortcode-hourly-promo {
    padding-top: 40px;
    padding-bottom: 40px;
}

.hourly-promo {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
    padding: 64px;
    border-radius: 24px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(var(--primary-color-rgb, 225, 202, 79), 0.28) 0%, rgba(var(--primary-color-rgb, 225, 202, 79), 0) 55%),
        var(--heading-color, #202020);
    isolation: isolate;
}

.hourly-promo::after {
    content: '';
    position: absolute;
    inset: auto -80px -120px auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    border: 1px solid rgba(var(--primary-color-rgb, 225, 202, 79), 0.35);
    z-index: -1;
}

.hourly-promo__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    margin-bottom: 20px;
    border-radius: 999px;
    border: 1px solid rgba(var(--primary-color-rgb, 225, 202, 79), 0.55);
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hourly-promo .hourly-promo__title {
    margin-bottom: 12px;
    color: #fff !important;
    font-size: clamp(30px, 3.6vw, 48px);
    line-height: 1.1;
    font-weight: 800;
}

.hourly-promo__subtitle {
    margin-bottom: 16px;
    color: var(--primary-color);
    font-size: clamp(17px, 1.6vw, 21px);
    font-weight: 700;
    line-height: 1.4;
}

.hourly-promo__text {
    max-width: 560px;
    margin-bottom: 28px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    line-height: 1.65;
}

.hourly-promo__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
}

.hourly-promo__cta.btn {
    padding: 14px 28px;
}

.hourly-promo__from {
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
}

.hourly-promo__from strong {
    color: #fff;
    font-size: 20px;
}

.hourly-promo__visual {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hourly-promo__image img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 16px;
}

.hourly-promo__durations {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.hourly-promo__duration {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    border: 1px solid rgba(var(--primary-color-rgb, 225, 202, 79), 0.45);
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.hourly-promo__duration:hover {
    transform: translateY(-3px);
    background: rgba(var(--primary-color-rgb, 225, 202, 79), 0.12);
}

.hourly-promo__duration-value {
    color: var(--primary-color);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 800;
    line-height: 1;
}

.hourly-promo__duration-unit {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hourly-promo__points {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.hourly-promo__points li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
}

.hourly-promo__points svg {
    flex: none;
    color: var(--primary-color);
}

@media (max-width: 991.98px) {
    .hourly-promo {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 44px 32px;
    }

    .hourly-promo::after {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .shortcode-hourly-promo {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .hourly-promo {
        padding: 32px 20px;
        border-radius: 18px;
    }

    .hourly-promo__durations {
        gap: 8px;
    }

    .hourly-promo__duration {
        border-radius: 12px;
    }

    .hourly-promo__actions .btn {
        width: 100%;
        justify-content: center;
    }
}
