/* Page "Contact" : bandeau, formulaire, adresse directe, appel à commander, questions fréquentes.
   À charger APRÈS styleHeaderFooter.css et styleBase.css. */

body { overflow-x: clip; }

/* ---------- Bandeau jaune derrière le titre ---------- */
.page-contact {
    position: relative;
    isolation: isolate;
    width: min(1100px, 100% - 2.5rem);
    margin: 0 auto 5rem;
    padding-top: 2.8rem;
}

.page-contact::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    left: 50%;
    width: 100vw;
    height: 19rem;
    transform: translateX(-50%);
    background-color: var(--miel);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cg fill='none' stroke='%23C77F00' stroke-opacity='.25' stroke-width='2'%3E%3Cpath d='M28 2l26 15v30L28 62 2 47V17z'/%3E%3Cpath d='M28 62l26 15v20M28 62L2 77v20'/%3E%3C/g%3E%3C/svg%3E"), linear-gradient(135deg, var(--miel-clair), var(--miel) 70%);
    clip-path: polygon(0 0, 100% 0, 100% 82%, 92% 88%, 84% 92%, 75% 92%, 66% 88%, 58% 82%, 50% 79%, 42% 81%, 33% 87%, 25% 92%, 16% 92%, 8% 88%, 0 82%);
}

.page-contact > h1 {
    font-size: clamp(2.4rem, 6vw, 4rem);
    margin-bottom: .8rem;
    animation: apparition .5s ease both;
}

.page-contact > h1::before { background: var(--brun); }

.intro {
    max-width: 38rem;
    margin: 0 0 2.6rem;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    animation: apparition .5s .05s ease both;
}

/* ---------- Mise en page ---------- */
.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.contact-cotes {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ---------- Carte du formulaire ---------- */
.contact-form-carte {
    padding: clamp(1.4rem, 3.5vw, 2.6rem);
    background: #fff;
    border-radius: 32px;
    box-shadow: 0 12px 0 var(--miel), 0 30px 60px rgba(74, 46, 11, .18);
    animation: apparition .5s .1s ease both;
}

.form_contact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem 1rem;
}

.champ { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.champ-large { grid-column: 1 / -1; }
.champ label { font-weight: 600; }

.champ input,
.champ textarea {
    width: 100%;
    font: inherit;
    color: var(--brun);
    background-color: var(--creme);
    background-repeat: no-repeat;
    background-position: .95rem center;
    border: 2px solid var(--miel-clair);
    border-radius: 16px;
    padding: .9rem 1rem .9rem 3rem;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.champ textarea {
    min-height: 9rem;
    padding: .9rem 1rem;
    line-height: 1.5;
    resize: vertical;
}

.champ input:hover,
.champ textarea:hover { border-color: var(--miel); }

.champ input:focus,
.champ textarea:focus {
    outline: none;
    background-color: #fff;
    border-color: var(--miel);
    box-shadow: 0 0 0 5px rgba(244, 180, 26, .3);
}

#nom, #prenom { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23C77F00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
#email        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23C77F00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E"); }
#sujet        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23C77F00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L2 12V2h10l8.6 8.6a2 2 0 0 1 0 2.8z'/%3E%3Ccircle cx='7' cy='7' r='1.2'/%3E%3C/svg%3E"); }

/* champ piège : invisible pour les visiteurs */
.champ-piege {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-bas {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.compteur {
    font-size: .92rem;
    font-variant-numeric: tabular-nums;
    color: var(--miel-fonce);
}

.compteur.presque { color: #A63A26; font-weight: 700; }

#btn-envoyer {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--miel-clair);
    background: var(--brun);
    border: 0;
    border-radius: 999px;
    padding: 1rem 2.2rem;
    cursor: pointer;
    box-shadow: 0 6px 0 var(--miel);
    transition: transform .2s, box-shadow .2s, background .2s;
}

#btn-envoyer svg {
    width: 1.3rem;
    height: 1.3rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .25s;
}

#btn-envoyer:hover:not(:disabled) { background: #6B4416; transform: translateY(-2px); box-shadow: 0 8px 0 var(--miel); }
#btn-envoyer:hover:not(:disabled) svg { transform: translate(4px, -4px); }
#btn-envoyer:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--miel); }
#btn-envoyer:disabled { cursor: progress; opacity: .85; }
#btn-envoyer.envoi svg { animation: envol .9s ease-in-out infinite; }

/* messages après envoi */
.retour {
    margin: 0 0 1.4rem;
    padding: .9rem 1.2rem;
    font-weight: 600;
    border-radius: 16px;
    border-left: 6px solid;
    animation: apparition .4s ease both;
}

.retour-ok     { color: #2F5419; background: #DDEBCB; border-color: #5E8C3A; }
.retour-erreur { color: #8F2D1B; background: #FCE1DB; border-color: #C4553F; }

/* ---------- Colonne de droite ---------- */
.contact-cotes section { animation: apparition .5s .2s ease both; }
.contact-cotes h2 { margin: 0 0 .6rem; font-size: 1.35rem; line-height: 1.25; }
.contact-cotes p { margin: 0 0 1rem; }

/* adresse directe */
.carte-mail {
    position: relative;
    padding: 1.8rem;
    background-color: var(--miel);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cg fill='none' stroke='%23C77F00' stroke-opacity='.25' stroke-width='2'%3E%3Cpath d='M28 2l26 15v30L28 62 2 47V17z'/%3E%3Cpath d='M28 62l26 15v20M28 62L2 77v20'/%3E%3C/g%3E%3C/svg%3E"), linear-gradient(135deg, var(--miel-clair), var(--miel) 75%);
    border-radius: 28px;
    box-shadow: 0 8px 0 var(--miel-fonce), 0 22px 40px rgba(74, 46, 11, .15);
}

.carte-icone {
    display: grid;
    place-items: center;
    width: 3.4rem;
    aspect-ratio: 1 / 1.1547;
    margin-bottom: 1rem;
    color: var(--miel);
    background: var(--brun);
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.carte-icone svg {
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.adresse {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 1.2rem;
    font-size: clamp(1.1rem, 2.2vw, 1.35rem);
    font-weight: 800;
    color: var(--brun);
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-decoration-color: rgba(74, 46, 11, .35);
    text-underline-offset: 5px;
    overflow-wrap: anywhere;
    transition: text-decoration-color .2s;
}

.adresse:hover { text-decoration-color: var(--brun); }

.carte-boutons { display: flex; flex-wrap: wrap; gap: .6rem; }

.btn-copier,
.btn-contour,
.btn-brun {
    display: inline-block;
    font: inherit;
    font-size: .95rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border-radius: 999px;
    padding: .65rem 1.3rem;
    cursor: pointer;
    transition: transform .2s, background .2s, color .2s, box-shadow .2s;
}

.btn-copier {
    color: var(--miel-clair);
    background: var(--brun);
    border: 2px solid var(--brun);
    box-shadow: 0 4px 0 rgba(74, 46, 11, .35);
}

.btn-copier:hover { background: #6B4416; border-color: #6B4416; transform: translateY(-2px); }
.btn-copier.copie { color: var(--brun); background: #fff; border-color: #fff; }

.btn-contour { color: var(--brun); background: transparent; border: 2px solid var(--brun); }
.btn-contour:hover { color: var(--miel-clair); background: var(--brun); }

/* appel à commander */
.carte-commande {
    padding: 1.8rem;
    color: var(--creme);
    background: var(--brun);
    border-radius: 28px;
    box-shadow: 0 8px 0 var(--miel), 0 22px 40px rgba(74, 46, 11, .2);
}

.btn-brun {
    padding: .8rem 1.7rem;
    color: var(--brun);
    background: var(--miel);
    box-shadow: 0 5px 0 var(--miel-fonce);
}

.btn-brun:hover { background: var(--miel-clair); transform: translateY(-2px); box-shadow: 0 7px 0 var(--miel-fonce); }

/* questions fréquentes */
.carte-faq {
    padding: 1.6rem 1.8rem .8rem;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 8px 0 var(--miel-clair), 0 22px 40px rgba(74, 46, 11, .1);
}

.carte-faq details { border-top: 2px dashed var(--miel-clair); }

.carte-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    list-style: none;
}

.carte-faq summary::-webkit-details-marker { display: none; }

.carte-faq summary::after {
    content: "+";
    flex: none;
    display: grid;
    place-items: center;
    width: 1.9rem;
    aspect-ratio: 1;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--brun);
    background: var(--miel);
    border-radius: 50%;
    transition: transform .25s, background .2s;
}

.carte-faq details[open] summary::after { content: "−"; transform: rotate(180deg); background: var(--miel-clair); }
.carte-faq summary:hover::after { background: var(--miel-clair); }
.carte-faq details > p { margin: 0 0 1rem; animation: apparition .3s ease both; }

.page-contact a:focus-visible,
.page-contact button:focus-visible,
.carte-faq summary:focus-visible { outline: 3px solid var(--brun); outline-offset: 3px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- Animations ---------- */
@keyframes apparition { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes envol      { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(4px, -4px); } }

/* ---------- Tablette / mobile ---------- */
@media (max-width: 900px) {
    .contact-layout { grid-template-columns: minmax(0, 1fr); }
    .page-contact::before { height: 17rem; }
}

@media (max-width: 560px) {
    .form_contact { grid-template-columns: minmax(0, 1fr); }
    .form-bas { flex-direction: column-reverse; align-items: stretch; }
    .compteur { text-align: right; }
    #btn-envoyer { justify-content: center; }
    .carte-boutons > * { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}