/* Champs de formulaire et sélecteur maison (04/11/2026), chargés sur tout le site.
   - Champs à libellé intégré (maquette de commande validée par Jeevan) : le libellé
     est dans le cadre ; il remonte en petit dès que le champ est rempli ou actif.
     Gabarit unique : _partials/form-fields.tpl (connexion, création de compte,
     « Mes informations », adresses, commande) ; quelques champs écrits à la main
     reprennent la même structure (facturation, e-mail de la commande, nom d'adresse).
   - Sélecteur maison : _partials/mk-choix.tpl + mk-choix.js. */

/* ---------- Champs ---------- */
.mk-champ { position: relative; display: block; min-width: 0; margin: 0 0 12px; }
.mk-champ > .form-control,
.mk-champ > .form-select,
.mk-champ > .input-group > .form-control {
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 22px 14px 6px;
    border: 1px solid var(--mk-filet);
    border-radius: 0;
    background-color: #fff;
    box-shadow: none;
    font-family: 'Lora', serif;
    font-size: .95rem;
    line-height: 1.4;
    color: var(--mk-encre);
}
.mk-champ > .form-select { padding-right: 38px; background-position: right 14px center; }
.mk-champ > .form-control::placeholder,
.mk-champ > .input-group > .form-control::placeholder { color: transparent; }
.mk-champ > .form-control:focus,
.mk-champ > .form-select:focus,
.mk-champ > .input-group > .form-control:focus { border-color: var(--mk-encre); outline: none; box-shadow: none; }
.mk-champ > .form-control[readonly],
.mk-champ > .form-control:disabled { background-color: #f6f5f2; color: var(--mk-gris); }

/* Mot de passe : l'œil dans le même cadre */
.mk-champ > .input-group > .form-control { border-right: 0; }
.mk-champ > .input-group > .input-group-btn > .btn {
    height: 52px;
    border: 1px solid var(--mk-filet) !important;
    border-left: 0 !important;
    border-radius: 0;
    background-color: #fff;
}
.mk-champ > .input-group:focus-within > .form-control,
.mk-champ > .input-group:focus-within > .input-group-btn > .btn { border-color: var(--mk-encre) !important; }

.mk-champ-lib {
    position: absolute;
    z-index: 4;
    left: 15px;
    top: 15px;
    max-width: calc(100% - 30px);
    margin: 0;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-family: 'Lora', serif;
    font-size: .95rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--mk-gris-clair);
    text-transform: none;
    letter-spacing: 0;
    pointer-events: none;
    transition: top .15s ease, font-size .15s ease;
}
.mk-champ > .input-group ~ .mk-champ-lib { max-width: calc(100% - 80px); }
/* Trois règles séparées : un navigateur qui ignore :has() ou :-webkit-autofill
   ne doit pas perdre les autres (mk-choix.js pose aussi .mk-rempli). */
.mk-champ--haut > .mk-champ-lib,
.mk-champ.mk-rempli > .mk-champ-lib,
.mk-champ:focus-within > .mk-champ-lib { top: 6px; font-size: .74rem; color: var(--mk-gris); }
.mk-champ:has(> .form-control:not(:placeholder-shown)) > .mk-champ-lib,
.mk-champ:has(> .input-group > .form-control:not(:placeholder-shown)) > .mk-champ-lib { top: 6px; font-size: .74rem; color: var(--mk-gris); }
.mk-champ:has(:-webkit-autofill) > .mk-champ-lib { top: 6px; font-size: .74rem; color: var(--mk-gris); }
.has-error .mk-champ > .form-control,
.has-error .mk-champ > .form-select { border-color: #b3261e; }
/* Champs à corriger signalés à l'envoi (mk-champs.js, 12/11/2026) : même rouge, texte seul */
.mk-champ.mk-champ--erreur > .form-control,
.mk-champ.mk-champ--erreur > .form-select,
.form-control.mk-champ--erreur { border-color: #b3261e; }
label.mk-champ--erreur,
label.mk-champ--erreur * { color: #b3261e !important; }
label.mk-champ--erreur input { outline: 1px solid #b3261e; outline-offset: 1px; }
/* Mention légale sous une case (création de compte) : reste dans sa couleur */
label.mk-champ--erreur em,
label.mk-champ--erreur em * { color: var(--mk-encre, #1a1a1a) !important; }
/* La phrase reprend le style global « erreur sous un champ » (theme.css, 28/10 : croix
   cerclée, sans fond), dans le rouge des champs (#b3261e, choix de Jeevan du 12/11) */
.mk-champs-erreur { margin: 0 0 12px; }
.mk-champs-erreur .alert { margin-top: 0; color: #b3261e; }
.mk-champ ~ .form-control-comment { margin-top: -6px; }
@media (prefers-reduced-motion: reduce) { .mk-champ-lib { transition: none; } }
/* Téléphone : 16 px au moins, sinon l'iPhone agrandit la page au toucher */
@media (max-width: 767px) {
    .mk-champ > .form-control,
    .mk-champ > .form-select,
    .mk-champ > .input-group > .form-control { font-size: 16px; }
}

/* Pays des adresses : le vrai <select> ne reçoit plus les clics (mk-choix.js) */
.mk-champ > select[data-mk-choix-select] { pointer-events: none; }
.mk-champ--select { cursor: pointer; }
.mk-champ > select[data-mk-choix-select][aria-expanded=true] { border-color: var(--mk-encre); }

/* ---------- Sélecteur maison ---------- */
[data-mk-choix] { position: relative; }
.mk-choix-bouton { display: inline-flex; align-items: center; gap: .35rem; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--mk-encre); text-align: left; cursor: pointer; }
.mk-choix-chevron { flex: none; transition: transform .15s ease; }
.mk-choix-bouton[aria-expanded=true] .mk-choix-chevron { transform: rotate(180deg); }
/* Style « ombre douce » choisi par Jeevan le 05/11/2026 (maquette locale, option 1) :
   menu blanc sans cadre, ombre légère, fondu à l'ouverture ; recherche sur une ligne avec
   loupe ; option survolée sur fond crème ; option choisie en gras avec une coche ocre. */
.mk-choix-menu { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 15rem; max-width: calc(100vw - 32px); background: #fff; border: 0; box-shadow: 0 14px 34px rgba(29, 29, 27, .13), 0 2px 6px rgba(29, 29, 27, .06); animation: mk-choix-ouvre .14s ease-out; }
@keyframes mk-choix-ouvre { from { opacity: 0; transform: translateY(-4px); } }
@keyframes mk-choix-ouvre-haut { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .mk-choix-menu { animation: none; } }
.mk-choix-menu[hidden] { display: none; }
.mk-choix-recherche { display: block; width: 100%; box-sizing: border-box; height: 46px; margin: 0; border: 0; border-bottom: 1px solid #eeebe5; border-radius: 0; padding: 0 16px 0 42px; font: inherit; font-size: .9rem; color: var(--mk-encre); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 16 16' fill='none' stroke='%236d6d6d' stroke-width='1.3'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l3.5 3.5'/%3E%3C/svg%3E") no-repeat 16px 50%; }
.mk-choix-recherche::placeholder { color: var(--mk-gris-clair); font-style: normal; opacity: 1; } /* droit, comme la version 2 (Jeevan, 05/11/2026) */
.mk-choix-recherche:focus { outline: none; border-bottom-color: var(--mk-filet); }
.mk-choix-liste { position: relative; max-height: 18rem; overflow-y: auto; margin: 0; padding: 6px 0; list-style: none; }
.mk-choix-liste:focus { outline: none; }
.mk-choix-liste [role=option] { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; font-size: .95rem; line-height: 1.4; color: var(--mk-encre); cursor: pointer; }
.mk-choix-liste [role=option][hidden] { display: none; }
.mk-choix-liste .mk-actif { background: #f6f3ec; }
.mk-choix-liste [aria-selected=true] { color: var(--mk-encre); font-weight: 500; }
.mk-choix-liste [aria-selected=true]::after { content: ""; flex: none; width: 12px; height: 7px; border-left: 1.5px solid var(--mk-ocre); border-bottom: 1.5px solid var(--mk-ocre); transform: rotate(-45deg) translateY(-2px); }

/* Style « lien » : texte souligné suivi d'un chevron (pays du panier) */
.mk-choix--lien { display: inline-block; }
.mk-choix--lien .mk-choix-nom { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.mk-choix--lien .mk-choix-bouton:hover .mk-choix-nom { color: var(--mk-ocre); }
.mk-choix--lien .mk-choix-bouton:focus-visible { outline: 1px solid var(--mk-encre); outline-offset: 3px; }

/* Style « champ » : cadre de la hauteur d'un champ (fenêtre « Nos conditions ») */
.mk-choix--champ { display: block; }
.mk-choix--champ .mk-choix-bouton { width: 100%; height: 48px; justify-content: space-between; gap: 12px; padding: 0 16px 0 14px; border: 1px solid var(--mk-filet); background: #fff; }
.mk-choix--champ .mk-choix-bouton[aria-expanded=true],
.mk-choix--champ .mk-choix-bouton:focus-visible { border-color: var(--mk-encre); outline: none; }
.mk-choix--champ .mk-choix-menu { right: 0; width: auto; max-width: none; }
.mk-choix--champ .mk-choix-liste [role=option] { font-size: .95rem; }

/* Liste posée sous un <select> (pays des adresses) */
.mk-choix-menu--select { right: 0; width: auto; max-width: none; }
.mk-choix-menu--select .mk-choix-recherche { font-size: .95rem; }
.mk-choix-menu--select .mk-choix-liste [role=option] { font-size: .95rem; }
@media (max-width: 767px) { .mk-choix-recherche { font-size: 16px !important; } }

/* ---------- Hauteur des boutons principaux : 45 px (décision de Jeevan, 05/11/2026) ----------
   Fiche produit (ajout au panier et sélecteur de quantité), newsletter (pied de page et
   fenêtre), connexion, contact et formulaires du compte. Seul « Commander » du panier
   latéral reste à 40 px. La commande a ses propres règles (checkout-onepage.css). */
#product .product-quantity .add .add-to-cart { height: 45px; padding-top: 0; padding-bottom: 0; line-height: 43px; }
#product .product-quantity .bootstrap-touchspin { height: 45px; min-height: 0; box-sizing: border-box; }
#product .product-quantity .bootstrap-touchspin > .input-group-btn,
#product .product-quantity .bootstrap-touchspin .btn-touchspin,
#product .product-quantity .bootstrap-touchspin #quantity_wanted { height: 100%; }
body .mk-nl-trigger, body .mk-nl__submit { box-sizing: border-box; height: 45px; min-height: 0; padding-top: 0; padding-bottom: 0; }
#login-form #submit-login.btn, .form-control-submit, .contactFromButton, .contact-form [name=submitMessage] { box-sizing: border-box; height: 45px; padding-top: 0; padding-bottom: 0; }

/* ---------- Connexion et mot de passe hors commande (05/11/2026) ----------
   Le thème masque « #login-form label » : les libellés intégrés disparaissaient et le
   texte restait en bas du champ. Œil du site (mk-mdp-oeil.tpl) dans le même cadre que
   le champ, comme dans la commande. */
#login-form .mk-champ > .mk-champ-lib { display: block; }
.mk-champ > .input-group { display: flex; flex-wrap: nowrap; }
.mk-champ > .input-group > .form-control { flex: 1 1 auto; min-width: 0; }
.mk-champ > .input-group > .mk-mdp-oeil { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: 0; padding: 0; border: 1px solid var(--mk-filet); border-left: 0; border-radius: 0; background: #fff; color: var(--mk-gris); cursor: pointer; }
.mk-champ > .input-group > .mk-mdp-oeil:hover { color: var(--mk-ocre); }
.mk-champ > .input-group:focus-within > .mk-mdp-oeil { border-color: var(--mk-encre); }
.mk-champ > .input-group > .mk-mdp-oeil .mk-mdp-oeil-ferme,
.mk-champ > .input-group > .mk-mdp-oeil[aria-pressed="true"] .mk-mdp-oeil-ouvert { display: none; }
.mk-champ > .input-group > .mk-mdp-oeil[aria-pressed="true"] .mk-mdp-oeil-ferme { display: inline; }

/* Panier latéral : le menu des pays s'ouvre vers le haut, le fondu monte aussi (05/11/2026) */
#mk-tiroir .mk-t-pays .mk-choix-menu { animation-name: mk-choix-ouvre-haut; }
@media (prefers-reduced-motion: reduce) { #mk-tiroir .mk-t-pays .mk-choix-menu { animation: none; } }

/* Suggestions d'adresse en tapant (16/11/2026, mk-adresse.js) : liste sous le champ
   « Adresse », dans le style des champs (filet, Lora, fond blanc, coins carrés), titre
   « Suggestions d'adresse » en Bebas, une adresse par ligne (17/11/2026). */
.mk-champ > .mk-sugg { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; margin: 4px 0 0; padding: 6px 0; list-style: none; background: #fff; border: 1px solid var(--mk-bordure); box-shadow: 0 10px 24px rgba(29, 29, 27, .08); }
.mk-sugg .mk-sugg-titre { margin: 0; padding: 4px 16px 4px; font-family: 'Bebas Neue', cursive; font-size: 1.05rem; font-weight: 400; line-height: 1.3; letter-spacing: normal; color: var(--mk-encre); text-align: left; }
.mk-sugg .mk-sugg-liste { margin: 0; padding: 0; list-style: none; }
.mk-sugg li { padding: 9px 16px; cursor: pointer; font-family: 'Lora', serif; font-size: .95rem; line-height: 1.4; color: var(--mk-encre); text-align: left; }
.mk-sugg li:hover, .mk-sugg li.mk-actif { background: var(--mk-fond); }
