/* ==========================================================================
   PAGE CONTACT (vue/contact.php)
   S'appuie sur les variables et composants de css/chavigny.css
   ========================================================================== */

.co {
    background: var(--ch-grey-light);
}

/* --------------------------------------------------------------------------
   En-tête
   -------------------------------------------------------------------------- */
.co-head {
    padding: 22px 0 30px;
}

.co-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    font-size: .85rem;
}

.co-breadcrumb li {
    display: inline-flex;
    align-items: center;
    color: var(--ch-grey-dark);
}

.co-breadcrumb li + li::before {
    content: "";
    width: 6px;
    height: 6px;
    margin: 0 12px;
    border-top: 1.5px solid var(--ch-grey);
    border-right: 1.5px solid var(--ch-grey);
    transform: rotate(45deg);
}

.co-breadcrumb a {
    color: var(--ch-grey-dark);
    text-decoration: none;
}

.co-breadcrumb a:hover {
    color: var(--ch-red);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.co-breadcrumb [aria-current] {
    color: var(--ch-text);
    font-weight: 700;
}

.co-kicker {
    margin: 0 0 4px;
    color: var(--ch-red);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.co-title {
    margin: 0;
    color: var(--ch-text);
    font-family: var(--ch-font);
    font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
}

.co-subtitle {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--ch-grey-dark);
    font-size: 1rem;
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Mise en page : formulaire | informations
   -------------------------------------------------------------------------- */
.co-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 28px;
    padding-bottom: 56px;
}

.co-card {
    padding: 34px 36px;
    border-radius: var(--ch-radius);
    background: var(--ch-white);
    box-shadow: var(--ch-shadow);
}

/* Messages */
.co-success {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 26px;
    padding: 18px 20px;
    border: 1px solid rgba(45, 154, 74, .3);
    border-left: 4px solid #2d9a4a;
    border-radius: var(--ch-radius-sm);
    background: #effaf2;
    color: var(--ch-text);
}

.co-success p {
    margin: 0 0 6px;
    font-size: .92rem;
    line-height: 1.5;
}

.co-success-title {
    color: #2d7a3e;
    font-size: 1.02rem !important;
    font-weight: 700;
}

.co-success-icon {
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2d9a4a;
    color: var(--ch-white);
    font-size: 1.1rem;
}

.co-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    padding: 12px 14px;
    border: 1px solid rgba(208, 52, 58, .3);
    border-left: 4px solid var(--ch-red);
    border-radius: var(--ch-radius-sm);
    background: var(--ch-red-soft);
    color: var(--ch-red-dark);
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.45;
}

.co-alert[hidden] {
    display: none;
}

.co-alert i {
    margin-top: 2px;
    font-size: 1.05rem;
}

/* Champs */
.co-required-note {
    margin: 0 0 18px;
    color: var(--ch-grey-dark);
    font-size: .82rem;
}

.co-required-note span,
.co-req {
    color: var(--ch-red);
}

.co-req[hidden] {
    display: none;
}

.co-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.co-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.co-field--full {
    grid-column: 1 / -1;
}

.co-field label,
.co-field legend {
    display: block;
    margin-bottom: 8px;
    padding: 0;
    color: var(--ch-text);
    font-size: .9rem;
    font-weight: 700;
}

.co-field input[type="text"],
.co-field input[type="email"],
.co-field input[type="tel"],
.co-field select,
.co-field textarea {
    width: 100%;
    border: 1.5px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    background: var(--ch-white);
    color: var(--ch-text);
    font-family: var(--ch-font);
    font-size: .98rem;
    transition: border-color .2s var(--ch-ease), box-shadow .2s var(--ch-ease);
}

.co-field input[type="text"],
.co-field input[type="email"],
.co-field input[type="tel"],
.co-field select {
    height: 48px;
    padding: 0 14px;
}

.co-field textarea {
    min-height: 170px;
    padding: 12px 14px;
    line-height: 1.55;
    resize: vertical;
}

.co-field input:focus,
.co-field select:focus,
.co-field textarea:focus {
    outline: none;
    border-color: var(--ch-red);
    box-shadow: 0 0 0 4px rgba(208, 52, 58, .12);
}

.co-field [aria-invalid="true"] {
    border-color: var(--ch-red);
    background: #fffafa;
}

.co-field-error {
    margin: 6px 0 0;
    color: var(--ch-red-dark);
    font-size: .8rem;
    font-weight: 700;
}

/* Liste déroulante : flèche maison */
.co-select {
    position: relative;
}

.co-select select {
    padding-right: 42px !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.co-select::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid var(--ch-grey-dark);
    border-bottom: 2px solid var(--ch-grey-dark);
    transform: rotate(45deg);
    pointer-events: none;
}

.co-field-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--ch-red);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.co-field-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Méthode de contact : boutons radio en pastilles */
.co-choice-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.co-choice-option {
    position: relative;
    margin: 0 !important;
    font-weight: 400 !important;
    cursor: pointer;
}

.co-choice-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.co-choice-option span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 1.5px solid var(--ch-border);
    border-radius: var(--ch-radius-pill);
    background: var(--ch-white);
    color: var(--ch-grey-dark);
    font-size: .92rem;
    transition: border-color .15s var(--ch-ease), color .15s var(--ch-ease), background-color .15s var(--ch-ease);
}

.co-choice-option:hover span {
    border-color: var(--ch-grey);
}

.co-choice-option input:checked + span {
    border-color: var(--ch-red);
    background: var(--ch-red-soft);
    color: var(--ch-red);
    font-weight: 700;
}

.co-choice-option input:focus-visible + span {
    outline: 3px solid rgba(208, 52, 58, .45);
    outline-offset: 2px;
}

.co-counter {
    margin: 6px 0 0;
    color: var(--ch-grey);
    font-size: .78rem;
    text-align: right;
}

/* Pied du formulaire */
.co-form-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--ch-grey-light);
}

.co-privacy {
    margin: 0;
    color: var(--ch-grey-dark);
    font-size: .82rem;
}

.co-privacy i {
    margin-right: 4px;
    color: var(--ch-grey);
}

.co-submit {
    min-height: 50px;
    padding: 0 30px;
    font-size: .98rem;
}

.co-submit-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.co-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: var(--ch-white);
    border-radius: 50%;
    animation: co-spin .7s linear infinite;
}

.co-submit.is-loading {
    pointer-events: none;
    opacity: .9;
}

.co-submit.is-loading .co-spinner {
    display: inline-block;
}

.co-submit.is-loading .co-submit-label i {
    display: none;
}

@keyframes co-spin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Colonne d'informations
   -------------------------------------------------------------------------- */
.co-aside {
    display: grid;
    gap: 18px;
}

.co-info {
    padding: 24px;
    border-radius: var(--ch-radius);
    background: var(--ch-white);
    box-shadow: var(--ch-shadow);
    color: var(--ch-grey-dark);
    font-size: .9rem;
    line-height: 1.55;
}

.co-info p {
    margin: 0 0 14px;
}

.co-info-title {
    margin-bottom: 12px !important;
    color: var(--ch-text);
    font-size: 1.02rem;
    font-weight: 700;
}

.co-info-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.co-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.co-info-list i {
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--ch-radius-sm);
    background: var(--ch-red-soft);
    color: var(--ch-red);
    font-size: 1rem;
}

.co-info-list strong {
    display: block;
    color: var(--ch-text);
}

.co-info--red {
    background: var(--ch-red);
    color: rgba(255, 255, 255, .92);
}

.co-info--red .co-info-title {
    color: var(--ch-white);
}

.co-info-btn {
    background: var(--ch-white);
    color: var(--ch-red);
}

.co-info-btn:hover,
.co-info-btn:focus-visible {
    background: var(--ch-white);
    color: var(--ch-red-dark);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}

/* --------------------------------------------------------------------------
   Carte des dépôts
   -------------------------------------------------------------------------- */
.co-map-section {
    padding: 52px 0 64px;
    background: var(--ch-white);
}

.co-map-section:focus {
    outline: none;
}

.co-map-card {
    padding: 16px;
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    background: var(--ch-white);
}

/* Légende = filtres par univers */
.co-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.co-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--ch-border);
    border-radius: var(--ch-radius-pill);
    background: var(--ch-white);
    color: var(--ch-grey-dark);
    font-family: var(--ch-font);
    font-size: .88rem;
    cursor: pointer;
    transition: border-color .15s var(--ch-ease), color .15s var(--ch-ease), opacity .15s var(--ch-ease);
}

.co-legend-item.is-active {
    border-color: var(--pin);
    color: var(--ch-text);
    font-weight: 700;
}

.co-legend-item:not(.is-active) {
    opacity: .55;
}

.co-legend-item:not(.is-active) .co-legend-dot {
    background: transparent;
    box-shadow: inset 0 0 0 2px var(--pin);
}

.co-legend-dot {
    flex: 0 0 14px;
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--pin);
}

.co-legend-count {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: var(--ch-radius-pill);
    background: var(--ch-grey-light);
    color: var(--ch-grey-dark);
    font-size: .74rem;
    font-weight: 700;
    text-align: center;
}

.co-legend-reset {
    margin-left: auto;
    padding: 6px 4px;
    border: 0;
    background: none;
    color: var(--ch-red);
    font-family: var(--ch-font);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
}

.co-legend-reset:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.co-map {
    height: 520px;
    border-radius: var(--ch-radius-sm);
    background: var(--ch-grey-light);
    z-index: 0;
}

.co-map .leaflet-tile-pane {
    filter: grayscale(1) contrast(.9) brightness(1.05);
}

.co-map-hint {
    margin: 12px 0 0;
    color: var(--ch-grey-dark);
    font-size: .82rem;
}

.co-map-hint i {
    margin-right: 4px;
    color: var(--ch-red);
}

/* Repère : goutte à la couleur de l'univers */
.co-pin {
    display: block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--ch-white);
    border-radius: 50% 50% 50% 0;
    background: var(--pin);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
    transform: rotate(-45deg);
    transition: transform .15s var(--ch-ease);
}

.co-pin.is-showroom {
    border-radius: 50%;
}

.leaflet-marker-icon:hover .co-pin,
.leaflet-marker-icon:focus .co-pin {
    transform: rotate(-45deg) scale(1.15);
}

/* Fiche de l'agence (popup) */
.co-map .leaflet-popup-content {
    margin: 14px 16px;
    font-family: var(--ch-font);
}

.co-popup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 200px;
}

.co-popup-univers {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ch-grey-dark);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.co-popup-univers::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pin);
}

.co-popup strong {
    color: var(--ch-text);
    font-size: 1rem;
    line-height: 1.3;
}

.co-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.co-popup-actions a,
.co-popup-actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: var(--ch-radius-pill);
    font-family: var(--ch-font);
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.co-popup-actions button {
    border: 0;
    background: var(--ch-red);
    color: var(--ch-white);
}

.co-popup-actions button:hover {
    background: var(--ch-red-dark);
}

.co-map .leaflet-popup-content .co-popup-actions a {
    border: 1.5px solid var(--ch-border);
    color: var(--ch-text);
}

.co-map .leaflet-popup-content .co-popup-actions a:hover {
    border-color: var(--ch-red);
    color: var(--ch-red);
}

/* Liste des dépôts sous la carte */
.co-depots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 28px;
}

.co-depots-group[hidden] {
    display: none;
}

.co-depots-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--pin);
    color: var(--ch-text);
    font-size: .95rem;
    font-weight: 700;
}

.co-depots ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.co-depot {
    padding: 5px 11px;
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-pill);
    background: var(--ch-white);
    color: var(--ch-text);
    font-family: var(--ch-font);
    font-size: .82rem;
    cursor: pointer;
    transition: border-color .15s var(--ch-ease), color .15s var(--ch-ease);
}

.co-depot:hover,
.co-depot.is-active {
    border-color: var(--pin);
    color: var(--ch-text);
    box-shadow: inset 0 0 0 1px var(--pin);
}

/* Sélection d'agence depuis la carte : mise en évidence du champ */
.co-field.is-highlight select {
    border-color: var(--ch-red);
    box-shadow: 0 0 0 4px rgba(208, 52, 58, .18);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .co-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .co-aside {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

    .co-depots {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .co-head {
        padding: 16px 0 22px;
    }

    .co-card {
        padding: 22px 16px;
    }

    .co-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .co-field input[type="text"],
    .co-field input[type="email"],
    .co-field input[type="tel"],
    .co-field select,
    .co-field textarea {
        font-size: 16px; /* évite le zoom automatique iOS */
    }

    .co-choice-option {
        flex: 1 1 0;
    }

    .co-choice-option span {
        justify-content: center;
        width: 100%;
    }

    .co-form-foot {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .co-submit {
        width: 100%;
    }

    .co-map-section {
        padding: 36px 0 44px;
    }

    .co-map-card {
        padding: 10px;
    }

    .co-map {
        height: 380px;
    }

    .co-legend {
        flex-wrap: nowrap;
        margin: 0 -10px 12px;
        padding: 0 10px 2px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .co-legend::-webkit-scrollbar {
        display: none;
    }

    .co-legend-item,
    .co-legend-reset {
        flex: 0 0 auto;
    }
}

/* Bulle de la carte : adresse, téléphone et e-mail du dépôt */
.co-popup-address {
    display: block;
    margin: 4px 0 6px;
    color: var(--ch-grey-dark);
    font-size: .82rem;
    line-height: 1.45;
}

.co-popup-contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.co-map .leaflet-popup-content .co-popup-contact a {
    color: var(--ch-text);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.co-map .leaflet-popup-content .co-popup-contact a:hover {
    color: var(--ch-red);
    text-decoration: underline;
}
