/* ==========================================================================
   Formulaire de commande
   ==========================================================================
   On reste dans l'aspect clair de TikTak Pro — c'est ce que les clients du
   marchand connaissent, et un formulaire de paiement a la livraison n'est pas
   l'endroit ou desorienter quelqu'un. Ce qu'on ameliore tient en trois points :

     · la place laissee au doigt,
     · le choix du gouvernorat, qui etait le vrai point de friction,
     · un repere d'avancement, pour savoir combien il reste a faire.

   Toute la couleur vive est depensee a UN endroit : le bouton d'envoi.
   ------------------------------------------------------------------------ */
.shop-order-form {
    --miel-or: #FFB606;
    --miel-or-fonce: #E09A00;
    --miel-ambre: #B87A00;
    --miel-encre: #241C13;
    --miel-gris: #6B6257;
    --miel-trait: #E8DFCF;
    --miel-fond: #FFFDF9;
    --miel-champ: #FFFFFF;
    --miel-vert: #1F8A4C;

    position: relative;
    padding: 22px 20px 26px;
    border: 1px solid var(--miel-trait);
    border-radius: 18px;
    background: var(--miel-fond);
    color: var(--miel-encre);
    box-shadow: 0 14px 34px rgba(36, 28, 19, .07);
}

.shop-order-form label {
    display: block;
    margin-bottom: 7px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--miel-gris);
}

.shop-order-form .form__control {
    width: 100%;
    /* 52 px : on tape au pouce, souvent debout, souvent presse. */
    min-height: 52px;
    padding: 13px 15px;
    border: 1px solid var(--miel-trait);
    border-radius: 12px;
    background: var(--miel-champ);
    color: var(--miel-encre);
    font-size: 16px;   /* en dessous de 16 px, iOS zoome au focus et deplace la page */
    transition: border-color .18s ease, box-shadow .18s ease;
}

.shop-order-form .form__control::placeholder { color: #A79C8C; }

/* Le halo de focus : de la lumiere qui traverse l'ambre. */
.shop-order-form .form__control:focus {
    outline: none;
    border-color: var(--miel-or);
    box-shadow: 0 0 0 3px rgba(255, 182, 6, .22);
}

.shop-order-form .shop-hint {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--miel-gris);
}

/* Le telephone est le champ le plus precieux : c'est par lui que l'agent
   confirme la commande. Chiffres a chasse fixe, pour se relire d'un coup. */
.shop-order-form input[data-phone-field] {
    font-variant-numeric: tabular-nums;
    letter-spacing: .06em;
}

/* --- Le select natif reste, mais ne se voit plus ------------------------- */
.vm-select-cache {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* --- Gouvernorat : un champ replie qui ouvre une grille ------------------ */
.vm-declencheur {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 13px 15px;
    border: 1px solid var(--miel-trait);
    border-radius: 12px;
    background: var(--miel-champ);
    color: #A79C8C;
    font-size: 16px;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, color .18s ease;
}

.vm-declencheur--rempli { color: var(--miel-encre); }

.vm-declencheur:hover { border-color: #D9C9A8; }

.vm-declencheur:focus-visible {
    outline: none;
    border-color: var(--miel-or);
    box-shadow: 0 0 0 3px rgba(255, 182, 6, .22);
}

.vm-declencheur__fleche {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--miel-ambre);
    border-bottom: 2px solid var(--miel-ambre);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .22s ease;
}

.vm-choix--ouvert .vm-declencheur__fleche { transform: rotate(-135deg) translate(-3px, -3px); }
.vm-choix--ouvert .vm-declencheur { border-color: var(--miel-or); }

.vm-panneau {
    margin-top: 8px;
    padding: 12px;
    border: 1px solid var(--miel-trait);
    border-radius: 12px;
    background: #FFF8EC;
    /* Le panneau ne pousse pas la page a l'infini : au-dela, il defile seul. */
    max-height: 46vh;
    overflow-y: auto;
}

.vm-panneau[hidden] { display: none; }

.vm-choix__recherche {
    width: 100%;
    min-height: 46px;
    margin-bottom: 10px;
    padding: 11px 14px;
    border: 1px solid var(--miel-trait);
    border-radius: 10px;
    background: var(--miel-champ);
    color: var(--miel-encre);
    font-size: 15px;
}

.vm-choix__recherche:focus {
    outline: none;
    border-color: var(--miel-or);
    box-shadow: 0 0 0 3px rgba(255, 182, 6, .18);
}

/* Trois colonnes des que la place le permet : vingt-quatre tuiles sur deux
   colonnes font douze rangees, soit plus long a parcourir que le menu qu'on
   remplace. */
.vm-choix__grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
}

.vm-tuile,
.vm-pastille {
    position: relative;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid var(--miel-trait);
    border-radius: 11px;
    background: var(--miel-champ);
    color: #4A4239;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.vm-tuile:hover,
.vm-pastille:hover { border-color: var(--miel-or); background: #FFF4DC; }

.vm-tuile:focus-visible,
.vm-pastille:focus-visible {
    outline: none;
    border-color: var(--miel-or);
    box-shadow: 0 0 0 3px rgba(255, 182, 6, .22);
}

.vm-tuile--choisi,
.vm-pastille--choisi {
    border-color: var(--miel-or-fonce);
    background: linear-gradient(180deg, #FFC53D 0%, var(--miel-or) 100%);
    color: var(--miel-encre);
}

/* La marque du choix : une cellule de ruche. C'est le SEUL endroit ou
   l'hexagone apparait — ailleurs il serait du decor. */
.vm-tuile--choisi::after,
.vm-pastille--choisi::after {
    content: "";
    position: absolute;
    top: 5px;
    inset-inline-end: 6px;
    width: 9px;
    height: 10px;
    background: var(--miel-encre);
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    opacity: .5;
}

/* --- Delegation : les pastilles coulent ---------------------------------- */
.vm-choix__liste {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vm-choix__liste .vm-pastille { min-width: 0; padding: 10px 14px; }

.vm-choix__attente {
    margin: 0;
    padding: 13px 15px;
    border: 1px dashed var(--miel-trait);
    border-radius: 12px;
    font-size: 13.5px;
    color: #A79C8C;
}

.vm-pastille--coule {
    opacity: 0;
    animation: vm-couler .32s ease forwards;
}

@keyframes vm-couler {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

/* --- Le recapitulatif ---------------------------------------------------- */
.shop-order-form .shop-summary {
    border: 1px solid var(--miel-trait);
    border-radius: 14px;
    background: #FFF8EC;
    padding: 6px 16px;
}

.shop-order-form .checkout__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
}

.shop-order-form .checkout__item + .checkout__item { border-top: 1px solid #F0E6D2; }
.shop-order-form .checkout__item .title { margin: 0; font-size: 14px; font-weight: 600; color: var(--miel-gris); }
.shop-order-form .checkout__item .price { font-variant-numeric: tabular-nums; }

/* Le total est le chiffre qu'on retient : le plus gros de la carte. */
.shop-order-form .checkout__total .title { color: var(--miel-encre); font-size: 15px; }
.shop-order-form .checkout__total [data-total-amount] {
    font-size: 24px;
    font-weight: 800;
    color: var(--miel-ambre);
    font-variant-numeric: tabular-nums;
}

/* --- Le bouton : toute la couleur vive de la carte ----------------------- */
.vm-envoi {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    padding: 16px 22px;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #F3E9D6;
    color: #7A6A55;
    font-size: 16.5px;
    font-weight: 700;
    cursor: pointer;
    transition: color .2s ease, box-shadow .2s ease;
}

/* La jauge : le bouton se remplit d'ambre a mesure que les champs se
   completent. C'est la seule reponse dont un formulaire a besoin a la question
   « il m'en reste combien ? ». */
.vm-envoi__jauge {
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(180deg, #FFC53D 0%, var(--miel-or-fonce) 100%);
    transition: width .45s cubic-bezier(.22, .61, .36, 1);
}

.vm-envoi > *:not(.vm-envoi__jauge) { position: relative; z-index: 1; }

.vm-envoi--pret {
    color: var(--miel-encre);
    box-shadow: 0 12px 26px rgba(255, 182, 6, .32);
}

.vm-envoi:focus-visible { outline: 3px solid rgba(255, 182, 6, .55); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .vm-envoi__jauge { transition: none; }
    .vm-pastille--coule { opacity: 1; animation: none; }
    .vm-declencheur__fleche { transition: none; }
}

/* --- Le choix du poids : des boutons, comme sur l'etiquette du pot ------- */
.vm-poids__liste {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vm-poids__bouton {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 92px;
    min-height: 56px;
    padding: 9px 16px;
    border: 1px solid var(--miel-trait);
    border-radius: 12px;
    background: var(--miel-champ);
    color: #4A4239;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
}

.vm-poids__bouton:hover { border-color: var(--miel-or); background: #FFF4DC; }

.vm-poids__bouton:focus-visible {
    outline: none;
    border-color: var(--miel-or);
    box-shadow: 0 0 0 3px rgba(255, 182, 6, .22);
}

/* Le poids se choisit, le prix se compare : deux tailles, deux roles. */
.vm-poids__valeur {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
}

.vm-poids__prix {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--miel-gris);
    font-variant-numeric: tabular-nums;
}

.vm-poids__bouton--choisi {
    border-color: var(--miel-or-fonce);
    background: linear-gradient(180deg, #FFC53D 0%, var(--miel-or) 100%);
    color: var(--miel-encre);
}

.vm-poids__bouton--choisi .vm-poids__prix { color: #6B4E00; }

/* Le libelle du declencheur tient sur une ligne : « Choisir votre gouvernorat »
   passait sur deux et doublait la hauteur du champ. */
.vm-declencheur__valeur {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
