/* Composant : hero
 * Section d'accueil — background image, titre, subtitle, search bar, stats, vague.
 * Consomme les design tokens de /site/css/global/tokens.css.
 */

.hero {
    position: relative;
    min-height: 720px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-5);
    background-size: cover;
    background-position: center 40%;
    color: var(--color-text-on-dark);
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0, 56, 66, 0.35) 0%,
        rgba(0, 75, 88, 0.55) 60%,
        rgba(0, 75, 88, 0.75) 100%);
    z-index: -1;
}

.hero__content {
    width: 100%;
    max-width: 760px;
    text-align: center;
    padding: 80px 0;
}

.hero__title {
    margin: 0 0 18px;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.hero__title-accent {
    color: var(--color-tertiary);
}

.hero__subtitle {
    margin: 0 auto 36px;
    max-width: 540px;
    font-size: 17px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* ───── Search bar ───── */

.hero__search {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 8px;
    background: var(--color-surface);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.hero__search-field {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 18px;
    min-width: 0;
    text-align: left;
}

.hero__search-clear {
    position: absolute;
    right: 8px;
    bottom: 10px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    font-size: 11px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.hero__search-clear.is-visible {
    display: inline-flex;
}

.hero__search-clear:hover {
    background: var(--color-text-muted);
    color: var(--color-text-on-dark);
}

.hero__search-clear:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

.hero__search-field + .hero__search-field {
    border-left: 1px solid #eef2f4;
}

.hero__search-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-secondary);
}

.hero__search-label i {
    width: 22px;
    text-align: center;
    font-size: 11px;
}

.hero__search-input {
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    font: inherit;
    font-size: 14px;
    color: var(--color-text-primary);
    width: 100%;
    appearance: none;
}

.hero__search-input::placeholder {
    color: var(--color-text-muted);
}

select.hero__search-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3aa' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 16px;
    padding-right: 22px;
}

.hero__search-btn {
    flex-shrink: 0;
    width: 60px;
    align-self: stretch;
    border: none;
    border-radius: 12px;
    background: var(--color-accent);
    color: var(--color-text-on-dark);
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(231, 124, 49, 0.4);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.hero__search-btn:hover {
    background: var(--color-primary);
    box-shadow: 0 8px 20px rgba(0, 75, 88, 0.4);
}

.hero__search-btn:focus-visible {
    outline: 2px solid var(--color-tertiary);
    outline-offset: 2px;
}

/* ───── Catégorie : custom dropdown ───── */

.hero__category {
    position: relative;
}

.hero__category-current {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.hero__category-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
}

.hero__category-icon[data-cat="all"]      { background: rgba(40, 163, 179, 0.15); color: var(--color-secondary); }
.hero__category-icon[data-cat="piscine"]  { background: var(--color-type-piscine-light); color: var(--color-type-piscine); }
.hero__category-icon[data-cat="plage"]    { background: var(--color-type-plage-light);   color: var(--color-type-plage); }
.hero__category-icon[data-cat="lac"]      { background: var(--color-type-lac-light);     color: var(--color-type-lac); }
.hero__category-icon[data-cat="riviere"]  { background: var(--color-type-riviere-light); color: var(--color-type-riviere); }

.hero__category-text {
    flex: 1;
    font-size: 14px;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero__category-chevron {
    font-size: 10px;
    color: var(--color-text-muted);
    transition: transform 0.2s ease;
}

.hero__category[data-open="true"] .hero__category-chevron {
    transform: rotate(180deg);
}

.hero__category-list {
    position: absolute;
    top: calc(100% + 14px);
    left: -8px;
    right: -8px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: var(--color-surface);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    z-index: 10;
    max-height: 320px;
    overflow-y: auto;
}

.hero__category-list[hidden] {
    display: none;
}

.hero__category-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.hero__category-list li:hover {
    background: var(--color-surface-alt);
}

.hero__category-list li.is-selected {
    background: var(--color-surface-alt);
    font-weight: 700;
}

.hero__category-item-text {
    flex: 1;
}

.hero__category-check {
    color: var(--color-primary);
    font-size: 12px;
    visibility: hidden;
}

.hero__category-list li.is-selected .hero__category-check {
    visibility: visible;
}

/* ───── Stats ───── */

.hero__stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 36px;
    margin-top: 36px;
    font-size: 13px;
}

.hero__stat {
    text-align: left;
}

.hero__stat-value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--color-tertiary);
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.hero__stat-star {
    color: #f4b942;
    font-size: 16px;
}

.hero__stat-label {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.85);
}

/* ───── Vague décorative ───── */

.hero__wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    display: block;
}

/* ───── Responsive ───── */

@media (max-width: 720px) {
    .hero {
        min-height: 480px;
        padding: var(--space-5) var(--space-4);
    }

    .hero__content {
        padding: 56px 0;
    }

    .hero__search {
        flex-direction: column;
        border-radius: var(--radius-lg);
        padding: var(--space-3);
    }

    .hero__search-field {
        padding: 8px 12px;
    }

    .hero__search-field + .hero__search-field {
        border-left: none;
        border-top: 1px solid #eef2f4;
    }

    .hero__search-btn {
        width: 100%;
        height: 48px;
        margin-top: 8px;
    }

    .hero__stats {
        gap: 24px;
    }
}
