/* Riviera Booking Custom UI - Expert Fixes */

/* 1. OVERRIDE PARENT CONTAINER CONSTRAINTS */
.tourmaster-tour-booking-people-input {
    max-width: none !important;
    float: none !important;
    display: block !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* Ensure the main wrapping container of the booking form is flexible */
.tourmaster-tour-booking-people {
    float: none !important;
}

/* 2. THE PICKER LAYOUT */
.riviera-qty-picker {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    clear: both;
    position: relative;
}

.riviera-qty-picker:last-of-type {
    border-bottom: none;
}

/* 3. THE LABEL (Left Side) */
.riviera-qty-label {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.riviera-qty-label-main {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 400px) {
    .riviera-qty-label-main {
        white-space: normal;
    }
}

.riviera-qty-unit-price {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #888;
    font-weight: 400;
}

/* 4. THE CONTROLS (Right Side) */
.riviera-qty-controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.riviera-qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #c8db14;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s, transform 0.1s;
}

.riviera-qty-btn:active {
    transform: scale(0.95);
}

.riviera-qty-btn.disabled {
    background-color: #eee;
    color: #ccc;
    cursor: default;
    pointer-events: none;
}

.riviera-qty-value {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    min-width: 24px;
    text-align: center;
}

/* 5. NUKE ORIGINAL ELEMENTS (IMMEDIATE HIDE) */
.tourmaster-tour-booking-people-input .tourmaster-combobox-wrap {
    display: none !important;
}

.tourmaster-tour-booking-people-input select {
    display: none !important;
}

.tourmaster-tour-booking-people-input:after,
.tourmaster-tour-booking-people-input:before {
    content: none !important;
    display: none !important;
}

/* 6. INFO TOOLTIP STYLES (New Feature) */
.riviera-info-icon {
    display: inline-block;
    margin-left: 6px;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
}

.riviera-info-icon i {
    color: #fff;
    /* White icon on the dark overlay background */
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tourmaster-header-price .tourmaster-tour-price-info {
    display: none;
}

.riviera-info-icon:hover i {
    opacity: 1;
}

/* The Tooltip Box */
.riviera-info-tooltip {
    visibility: hidden;
    opacity: 0;
    width: 250px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    /* Position above */
    left: 50%;
    margin-left: -125px;
    /* Center */

    /* Text styling */
    font-family: inherit;
    font-size: 12px;
    font-style: normal;
    line-height: 1.4;
    font-weight: 400;
    text-shadow: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);

    /* Animation */
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(5px);
    pointer-events: none;
    /* Let clicks pass through if needed, though usually we want interactions */
}

/* Arrow */
.riviera-info-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Show on Hover */
.riviera-info-icon:hover .riviera-info-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Tooltip */
@media (max-width: 768px) {
    .riviera-info-tooltip {
        left: auto;
        right: -10px;
        /* Align to right edge roughly */
        margin-left: 0;
        width: 200px;
        /* Slightly smaller width */
        bottom: 135%;
        /* Higher up to avoid finger overlap */
    }

    .riviera-info-tooltip::after {
        left: auto;
        right: 15px;
        /* Move arrow to right side to match icon position relative to box */
        margin-left: 0;
    }
}

/* --- CUSTOM PAYMENT OPTIONS --- */
.riviera-payment-options-wrapper {
    margin-top: 30px;
    border-top: 1px solid #ccc;
    padding: 25px 25px 0;
    clear: both;
}

.riviera-payment-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #222;
    display: block;
}

/* Radio Button Styling */
label.riviera-payment-option {
    display: flex !important;
    align-items: flex-start;
    margin-bottom: 20px;
    cursor: pointer;
    font-weight: normal;
    padding: 0;
    border: none;
    background: transparent;
}

label.riviera-payment-option:hover {
    background-color: transparent;
}

label.riviera-payment-option input[type="radio"] {
    margin-top: 4px;
    margin-right: 15px;
    transform: scale(1.3);
    flex-shrink: 0;
}

.riviera-option-content {
    flex-grow: 1;
}

.riviera-option-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #000;
    margin-bottom: 5px;
}

.riviera-option-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 0;
}

/* Selected state */
label.riviera-payment-option.selected {
    background-color: transparent;
    /* Light Highlight */
    border: none;
}

/* --- RECAP SECTION --- */
.riviera-payment-recap {
    border-top: 1px dashed #ddd;
    padding: 30px 25px 20px;
}

.riviera-recap-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    /* Reduced slightly for cleaner look */
    font-size: 15px;
}

.riviera-recap-row.highlight {
    font-weight: 800;
    font-size: 18px;
    color: #222;
    margin-top: 10px;
}

.riviera-recap-row.highlight .value {
    color: #222;
}

.riviera-recap-row.secondary {
    color: #666;
    font-size: 14px;
}

/* Hide original plugin payment text if it leaks through */
.tourmaster-tour-booking-bar-deposit-text {
    display: none !important;
}

/* --------------------------------------------------------------------------------
   QUAD UI STYLES (MATCH DRAWING)
   -------------------------------------------------------------------------------- */

.riviera-quad-booking-wrap {
    margin-bottom: 20px;
}

.riviera-quad-row {
    border-bottom: 1px solid #f5f5f5;
    padding: 15px 0;
}

.tourmaster-header-price .tourmaster-tour-price {
    font-size: 32px;
    margin-right: 15px;
    font-weight: 800;
}

/* Force "Tarif de" to be white in the blue header */
.tourmaster-header-price .tourmaster-head {
    color: #fff !important;
    font-size: 14px;
    margin-right: 10px;
    display: inline-block;
}

.tourmaster-header-price .fa-tags {
    color: #fff !important;
    margin-right: 5px;
    opacity: 0.8;
}

/* Flex on the INNER container */
.riviera-quad-row .tourmaster-tour-booking-room-qty {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100%;
}

.riviera-quad-label-wrap {
    display: flex;
    flex-direction: column;
}

.riviera-quad-price-sub {
    font-size: 13px;
    font-weight: 400;
    color: #999;
    margin-top: 5px;
}

/* Limit Label width to prevent overlap on small screens */
.riviera-quad-label-wrap .tourmaster-head {
    float: none !important;
    margin: 0 !important;
    max-width: 200px;
    line-height: 1.2;
}

/* Override existing tail layout for Quad */
.riviera-quad-row .tourmaster-tail {
    float: none !important;
    /* Override standard float */
    display: flex;
    align-items: center;
    gap: 15px;
    /* Spacing between - / Value / + */
    margin: 0 !important;
}

/* Inputs */
.riviera-quad-input {
    width: 30px !important;
    text-align: center;
    border: none !important;
    background: transparent !important;
    font-weight: 700;
    font-size: 16px;
    color: #333 !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
}

/* Orange Buttons */
.riviera-quad-minus,
.riviera-quad-plus {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    float: none !important;
    /* Reset standard styles */
    margin: 0 !important;
}

/* PLUS IS ORANGE */
.riviera-quad-plus {
    background-color: #f26b21;
    color: #fff;
}

.riviera-quad-plus:hover {
    background-color: #d85a17;
}

/* MINUS IS GRAY (Standard Look) */
.riviera-quad-minus {
    background-color: #f3f3f3;
    color: #aaa;
}

.riviera-quad-minus:hover {
    background-color: #e6e6e6;
    color: #888;
}

.riviera-quad-minus.disabled {
    background-color: #f9f9f9;
    color: #ddd;
    cursor: default;
}

/* Icon reset */
.riviera-quad-minus i,
.riviera-quad-plus i {
    font-size: 12px;
    line-height: 1;
}

.riviera-quad-people-count-wrap {
    text-align: center;
}

/* Display Value Styling (Matches Standard) */
.riviera-quad-value {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    min-width: 24px;
    text-align: center;
    /* Center vertically with buttons */
}

/* Masquer l'extrait personnalisé (Custom Excerpt) sur les fiches de tour dans les listes/grilles */
.tourmaster-tour-info-custom-excerpt {
    display: none !important;
}

/* --------------------------------------------------------------------------------
   CURRENCY SWITCHER (HEADER)
   -------------------------------------------------------------------------------- */

.riviera-currency-switcher {
    position: relative;
    display: inline-block;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #333;
    z-index: 1000;
    cursor: pointer;
    vertical-align: middle;
}

.riviera-currency-active {
    display: flex;
    align-items: center;
    gap: 4px; /* Reduced gap slightly for professional look */
    padding: 0 5px; /* Removed vertical padding causing offset */
    height: 100%; /* Better alignment in flex containers */
    transition: opacity 0.2s;
}

.riviera-currency-active:hover {
    opacity: 0.7;
}

.riviera-flag {
    width: 20px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

/* Real SVG flag images instead of emoji.
   Windows does not render regional-indicator flag emoji (🇨🇦 🇪🇺),
   it shows the country letters "CA"/"EU" instead — so we ship actual SVGs. */
.riviera-flag-cad {
    background-image: url("../images/flags/ca.svg");
}

.riviera-flag-eur {
    background-image: url("../images/flags/eu.svg");
}

.riviera-currency-switcher i.fa-caret-down {
    font-size: 11px;
    margin-left: 4px;
    opacity: 0.8;
}

.riviera-currency-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #fff;
    border-radius: 4px;
    box-shadow: 0px 10px 30px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    padding: 8px 0;
    white-space: nowrap; /* Empeche le retour à la ligne */
}

.riviera-currency-switcher.open .riviera-currency-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.riviera-currency-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    color: #888;
    font-weight: 400;
    transition: all 0.2s;
}

.riviera-currency-option:hover {
    color: #333;
    background: #fdfdfd;
}

/* Optional: hide the currently active currency in the dropdown */
.riviera-currency-option.active {
    display: none;
}

/* --------------------------------------------------------------------------------
   MENU INTEGRATION OVERRIDES
   -------------------------------------------------------------------------------- */
.riviera-currency-menu-item {
    display: inline-flex !important;
    align-items: center;
    height: 100%;
}

.riviera-currency-menu-item .riviera-currency-switcher {
    display: flex;
    align-items: center;
    height: 100%;
}

/* Mobile specific styling */
@media (max-width: 999px) { /* TravelTour typical mobile breakpoint */
    .traveltour-mobile-menu .riviera-currency-menu-item,
    .mmenu .riviera-currency-menu-item,
    .sf-menu .riviera-currency-menu-item {
        display: none !important; /* Hide old desktop clone if triggered */
    }

    /* Make the header container a flex row so logo + right block align vertically */
    .traveltour-mobile-header .traveltour-mobile-header-container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        position: relative;
    }

    /* Logo takes available space on the left */
    .traveltour-mobile-header .traveltour-logo {
        flex: 1 1 auto;
        min-width: 0;
        margin-right: 0 !important;
    }

    .traveltour-mobile-header .traveltour-logo-inner {
        line-height: 1 !important; /* Remove arbitrary line-height that pushes content */
        display: flex;
        align-items: center;
        margin-right: 0 !important; /* Kill parent's 80px margin (was for absolute positioning) */
    }

    .traveltour-mobile-header .traveltour-logo-inner img {
        width: auto;
        display: block;
    }

    /* Override parent absolute positioning — use flex instead */
    .traveltour-mobile-menu-right {
        position: static !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end;
        flex: 0 0 auto;
        margin-top: 0 !important; /* Kill the parent's -9px margin-top */
        gap: 14px;
    }

    /* Currency switcher wrapper */
    .riviera-currency-mobile-wrapper {
        display: flex;
        align-items: center;
        height: auto;
    }

    .riviera-currency-mobile-wrapper .riviera-currency-switcher {
        display: flex;
        align-items: center;
    }

    .riviera-currency-mobile-wrapper .riviera-currency-active {
        font-size: 14px;
        padding: 0;
        gap: 4px;
    }

    /* Hamburger menu button alignment */
    .traveltour-mobile-menu-right .traveltour-mobile-menu {
        margin-left: 0 !important;
        display: flex;
        align-items: center;
        margin-top: 0;
    }

    .traveltour-mobile-menu-right .traveltour-mobile-menu-button {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Search / Cart alignment in mobile header */
    .traveltour-mobile-menu-right .traveltour-main-menu-search,
    .traveltour-mobile-menu-right .traveltour-main-menu-cart {
        display: flex;
        align-items: center;
        margin-top: 0 !important;
    }

    /* User login bar (TourMaster) alignment */
    .traveltour-mobile-menu-right .tourmaster-user-top-bar {
        float: none !important;
        display: flex;
        align-items: center;
        margin-top: 0 !important;
    }
}