/**
 * CSS pour le sélecteur 3 étapes - Hook page catégorie
 * Design compact avec fond #F7F7F7
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

.hs-category-selector-wrapper {
    background-color: #F9F7F6;
    width: 100%;
    padding: 18px 20px 33px 20px;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    border-bottom: 1px solid #ededed;
}

.hs-cat-selector-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* Ligne des sélecteurs */
.hs-cat-steps-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Chaque étape */
.hs-cat-step {
    flex: 1;
    min-width: 160px;
    max-width: 250px;
    position: relative;
}

/* Wrapper pour le select + flèche */
.hs-cat-select-wrapper {
    position: relative;
    width: 100%;
}

/* Le select lui-même */
.hs-cat-dropdown {
    width: 100%;
    height: 46px;
    background-color: #FFFFFF;
    border: 1.5px solid #163C5D;
    border-radius: 50px;
    padding: 0 44px 0 18px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #163C5D;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hs-cat-dropdown:focus {
    border-color: #163C5D;
    box-shadow: 0 0 0 2px rgba(22, 60, 93, 0.15);
}

.hs-cat-dropdown:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hs-cat-dropdown option {
    color: #163C5D;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

/* Flèche SVG positionnée à droite */
.hs-cat-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
    width: 20px;
    height: 20px;
    color: #163C5D;
    pointer-events: none;
    stroke: #163C5D;
    transition: transform 0.2s ease;
}

/* Quand le select est ouvert - rotate de la flèche */
.hs-cat-select-wrapper:focus-within .hs-cat-select-arrow {
    transform: translateY(-50%) rotate(0deg);
}

/* Étapes désactivées */
.hs-cat-step.hs-cat-disabled .hs-cat-dropdown {
    opacity: 0.5;
    cursor: not-allowed;
}

.hs-cat-step.hs-cat-disabled .hs-cat-select-arrow {
    opacity: 0.5;
}

/* Bouton Rechercher */
.hs-cat-search-container {
    flex-shrink: 0;
}

.hs-cat-search-btn {
    height: 46px;
    background-color: #E84242;
    color: #FFFFFF;
    border: none;
    border-radius: 30px;
    padding: 15px 70px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.hs-cat-search-btn:hover:not(:disabled) {
    background-color: #cc3535;
}

.hs-cat-search-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Desktop : cacher les éléments mobile */
.hs-cat-reset-container {
    display: none;
}

.hs-cat-mobile-trigger {
    display: none;
}

.hs-cat-modal-overlay {
    display: none;
}

.hs-cat-modal-header {
    display: none;
}

.hs-cat-modal-header-text {
    padding: 15px 0 20px 0;
}

.hs-cat-modal-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    color: #163C5D;
}

.hs-cat-subtitle-mobile {
    display: none;
}

.hs-cat-modal-title {
    display: none;
}

/* Responsive tablette */
@media (max-width: 900px) {
    .hs-cat-steps-row {
        gap: 16px;
    }

    .hs-cat-search-btn {
        padding: 15px 40px;
    }
}

/* Responsive mobile */
@media (max-width: 640px) {
    .hs-category-selector-wrapper {
        padding: 14px 15px;
    }

    .hs-cat-steps-row {
        flex-direction: column;
        gap: 16px;
    }

    .hs-cat-step {
        width: 100%;
        min-width: unset;
    }

    .hs-cat-search-container {
        width: 100%;
    }

    .hs-cat-search-btn {
        width: 100%;
        padding: 15px 20px;
    }

    /* --- Mobile : trigger + modal --- */
    .hs-cat-mobile-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #fff;
        border: 1.5px solid #163C5D;
        border-radius: 50px;
        padding: 12px 18px;
        cursor: pointer;
        font-family: 'Poppins', sans-serif;
        font-size: 14px;
        color: #163C5D;
    }

    .hs-cat-mobile-trigger-arrow {
        width: 20px;
        height: 20px;
        color: #163C5D;
        stroke: #163C5D;
        transform: rotate(180deg);
        flex-shrink: 0;
    }

    .hs-cat-vehicle-form {
        display: none;
    }

    .hs-category-selector-wrapper.hs-cat-modal-open .hs-cat-modal-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9998;
        background: rgba(0, 0, 0, 0.6);
    }

    .hs-category-selector-wrapper.hs-cat-modal-open {
        overflow: visible;
    }

    html.hs-cat-no-scroll,
    html.hs-cat-no-scroll body {
        overflow: hidden !important;
    }

    .hs-category-selector-wrapper.hs-cat-modal-open .hs-cat-vehicle-form {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 9999;
        background: #F9F7F6;
        padding: 24px 20px;
        width: calc(100% - 24px);
        max-width: 500px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }

    .hs-category-selector-wrapper.hs-cat-modal-open .hs-cat-step {
        max-width: 100%;
    }

    .hs-cat-dropdown {
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    .hs-category-selector-wrapper.hs-cat-modal-open .hs-cat-search-container {
        width: 100%;
    }

    .hs-category-selector-wrapper.hs-cat-modal-open .hs-cat-search-btn {
        width: 100%;
    }

    .hs-category-selector-wrapper.hs-cat-modal-open .hs-cat-mobile-trigger {
        display: none;
    }

    .hs-cat-modal-header {
        display: flex;
        justify-content: flex-end;
        align-items: flex-start;
        position: relative;
        background: #163C5D url('/modules/homeselector/views/img/Popup-image.png') center 30% / cover no-repeat;
        margin: -24px -20px 0px -20px;
        padding: 24px 20px;
        min-height: 70px;
    }

    .hs-cat-modal-header-text {
        display: flex;
        color: #163c5d;
        flex-direction: column;
        gap: 4px;
        padding: 25px 0;
    }

    .hs-cat-modal-title {
        font-family: 'Poppins', sans-serif;
        font-size: 18px;
        font-weight: 600;
        color: #163C5D;
        display: block;
    }

    .hs-cat-modal-subtitle {
        font-family: 'Poppins', sans-serif;
        font-size: 16px;
        font-weight: 400;
        color: #163c5d;
    }

    .hs-cat-subtitle-desktop {
        display: none;
    }

    .hs-cat-subtitle-mobile {
        display: inline;
    }

    #hs-cat-search-button {
        font-size: 16px;
        font-weight: 500;
    }

    .hs-cat-modal-close {
        background: none;
        border: none;
        font-size: 36px;
        color: #fff;
        cursor: pointer;
        padding: 0 5px;
        line-height: 1;
        position: relative;
        z-index: 1;
    }

    .hs-cat-reset-container {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 12px;
    }

    .hs-cat-reset-btn {
        background: none;
        border: none;
        font-family: 'Poppins', sans-serif;
        font-size: 16px;
        font-weight: 400;
        color: #163C5D;
        cursor: pointer;
        text-decoration: underline;
        padding: 4px 0;
    }
}
