/* ==========================================================================
 * Carte cadeau Couteaux Morta : fiche produit, champ « Vous avez une carte
 * cadeau ? » (panier, étape 3 du tunnel) et lignes de la carte au récapitulatif.
 * Couleurs, tailles et boutons repris du thème Morta (style.css) et du module
 * product-variations (.morta-swatch).
 * ========================================================================== */

/* ---- Fiche produit ---------------------------------------------------- */

/* Le prix vide du haut de la colonne (il s'affiche avec le choix du montant). */
body.mgc-page-carte div.product div.entry-summary > .price:empty {
    display: none;
}

.mgc-fiche {
    margin: 0 0 24px;
}

/* « Choisissez le montant : » = « Choisissez vos options : » des couteaux. */
.mgc-fiche .mgc-titre-choix {
    margin: 0;
    font-family: "Roboto", sans-serif;
    font-weight: 300;
    text-transform: uppercase;
    line-height: 1.7;
    letter-spacing: 1px;
    font-size: 18px;
    color: #0541a4;
    text-decoration: underline;
}

.mgc-fiche .mgc-prix {
    min-height: 38px;
}

.mgc-fiche .mgc-choix {
    margin-bottom: 18px;
}

.mgc-fiche .mgc-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0 0 8px;
    font-weight: 300;
}

.mgc-fiche .mgc-label label {
    font-weight: 300;
}

.mgc-fiche .mgc-montants {
    grid-template-columns: repeat(3, 1fr);
}

.mgc-fiche .morta-swatch[aria-pressed] {
    min-height: 44px;
}

/* Sans script : pas de boutons, le champ du montant reste seul. */
.mgc-fiche:not(.mgc-js) .morta-swatches {
    display: none;
}

.mgc-fiche .mgc-autre {
    margin: 12px 0 0;
}

.mgc-fiche.mgc-js .mgc-autre:not(.mgc-autre-on) {
    display: none;
}

.mgc-fiche .mgc-euros {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.mgc-fiche .mgc-euros input {
    width: 9em;
}

/* Champs : ceux de la gravure des couteaux. */
.mgc-fiche input.input-text,
.mgc-fiche textarea.input-text {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 15px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: #212121;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    outline: none;
}

.mgc-fiche input.input-text:focus,
.mgc-fiche textarea.input-text:focus {
    border-color: #212121;
}

.mgc-fiche textarea.input-text {
    resize: vertical;
    min-height: 90px;
}

.mgc-fiche small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-style: italic;
    line-height: 1.5;
    color: #5e5d5d;
}

.mgc-fiche .mgc-destinataire {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.mgc-fiche .mgc-destinataire p {
    margin: 0;
}

.mgc-fiche .mgc-destinataire .mgc-plein {
    grid-column: 1 / -1;
}

.mgc-fiche .mgc-destinataire label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 300;
}

.mgc-fiche abbr.required {
    color: #b3261e;
    text-decoration: none;
    border: 0;
}

@media screen and (max-width: 600px) {
    .mgc-fiche .mgc-destinataire {
        grid-template-columns: minmax(0, 1fr);
    }

    .mgc-fiche .morta-swatch {
        padding: 12px 8px;
    }

    /* 16 px : pas de zoom automatique de l'iPhone sur les champs. */
    .mgc-fiche input.input-text,
    .mgc-fiche textarea.input-text {
        font-size: 16px;
    }
}

/* Bandeau de réassurance sans « Garantie à vie » (MGC_Product::reassurance_banner) :
 * une colonne par élément affiché, au lieu de 4 colonnes dont une vide. */
body.mgc-page-carte .reassurance-banner .reassurance-banner-container {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
}

/* Listes de produits : « De 20 € à 1 000 € ». */
.mgc-prix-liste .woocommerce-Price-amount {
    white-space: nowrap;
}

/* ---- Champ « Vous avez une carte cadeau ? » ---------------------------- */

.mgc-carte-cadeau .mgc-titre {
    margin: 0 0 12px;
    font-weight: bold;
    font-size: 16px;
    color: #0541a4;
}

.mgc-carte-cadeau .mgc-saisie {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Sur une ligne, le champ prend la place ; passé dessous, le bouton prend toute la ligne. */
.mgc-carte-cadeau input.mgc-code {
    flex: 999 1 13em;
    min-width: 0;
    box-sizing: border-box;
    height: 42px;
    margin: 0;
    padding: 10px 15px;
    font-family: inherit;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #212121;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    outline: none;
}

.mgc-carte-cadeau input.mgc-code:focus {
    border-color: #0541a4;
}

.mgc-carte-cadeau input.mgc-code::placeholder {
    color: #9a9a9a;
    letter-spacing: 1px;
}

/* Bouton bleu du thème (« Suivant » du tunnel). */
.mgc-carte-cadeau button.mgc-appliquer {
    flex: 1 0 auto;
    height: 42px;
    margin: 0;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    background-color: #0541a4;
    border: 1px solid #0541a4;
    border-radius: 0;
    cursor: pointer;
    transition: all .2s ease-in;
}

.mgc-carte-cadeau button.mgc-appliquer:hover,
.mgc-carte-cadeau button.mgc-appliquer:focus-visible {
    color: #0541a4;
    background-color: transparent;
}

.mgc-carte-cadeau button.mgc-appliquer:disabled {
    opacity: .6;
    cursor: wait;
}

.mgc-carte-cadeau .mgc-message:not(:empty),
.mgc-carte-cadeau .mgc-zone-retrait:not(:empty) {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
}

.mgc-carte-cadeau .mgc-ok {
    color: #71b340;
}

.mgc-carte-cadeau .mgc-erreur {
    color: #b3261e;
}

/* Tunnel, étape 3 : un cadre comme ceux du récapitulatif. */
body.woocommerce-checkout .mgc-carte-cadeau {
    margin: 0 0 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

@media screen and (min-width: 769px) {
    body.woocommerce-checkout .mgc-carte-cadeau .mgc-titre {
        font-size: 18px;
    }
}

/* Panier : en tête du cadre des totaux, champ et bouton l'un sous l'autre (cadre étroit). */
body.woocommerce-cart .cart-collaterals .mgc-carte-cadeau {
    margin: 0 0 25px;
    padding: 0 0 25px;
    border-bottom: 1px solid #e0e0e0;
}

body.woocommerce-cart .cart-collaterals .mgc-carte-cadeau input.mgc-code {
    flex-basis: 100%;
}

@media screen and (max-width: 768px) {
    .mgc-carte-cadeau input.mgc-code {
        font-size: 16px;
    }
}

/* ---- Récapitulatif : la carte appliquée et la carte achetée ------------ */

/* Ligne « Carte cadeau ••••XXXX  −50,00 € [Retirer] » : verte, comme le bandeau de livraison offerte.
 * Même chose pour « Frais de port réglés par carte cadeau ••••XXXX » (MGC_Shipping). */
body.morta.woocommerce-checkout .woocommerce #order_review tr.fee:has(.mgc-port),
body.morta.woocommerce-checkout .woocommerce #order_review tr.cart-discount {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px 20px;
    background-color: #f0f8e8;
    border-color: #71b340;
}

body.morta.woocommerce-checkout .woocommerce #order_review tr.fee:has(.mgc-port) th,
body.morta.woocommerce-checkout .woocommerce #order_review tr.fee:has(.mgc-port) td,
body.morta.woocommerce-checkout .woocommerce #order_review tr.cart-discount th,
body.morta.woocommerce-checkout .woocommerce #order_review tr.cart-discount td {
    display: inline-block;
    width: auto;
    font-size: 16px;
}

body.morta.woocommerce-checkout .woocommerce #order_review tr.fee:has(.mgc-port) th::before,
body.morta.woocommerce-checkout .woocommerce #order_review tr.fee:has(.mgc-port) td::before,
body.morta.woocommerce-checkout .woocommerce #order_review tr.cart-discount th::before,
body.morta.woocommerce-checkout .woocommerce #order_review tr.cart-discount td::before {
    display: none;
}

body.morta.woocommerce-checkout .woocommerce #order_review tr.fee:has(.mgc-port) td,
body.morta.woocommerce-checkout .woocommerce #order_review tr.cart-discount td {
    font-weight: bold;
}

#order_review tr.cart-discount .woocommerce-remove-coupon,
.cart_totals tr.cart-discount .woocommerce-remove-coupon {
    margin-left: 8px;
    font-size: 13px;
    font-weight: normal;
    color: #0541a4;
}

/* Bénéficiaire et message d'une carte achetée : du texte, pas les pastilles bleues des options d'un couteau. */
body.morta.woocommerce-checkout .woocommerce #order_review .variation dd p:has(> .mgc-donnee),
body.morta.woocommerce-cart .woocommerce .cart-wrapper table .variation dd p:has(> .mgc-donnee) {
    display: block;
    margin: 0;
    padding: 0;
    color: #212121;
    background: none;
    border-radius: 0;
}

.mgc-donnee {
    overflow-wrap: anywhere;
}

/* « 1 » de la colonne Quantité, en noir comme le champ de quantité d'un couteau. */
.mgc-quantite {
    color: #000;
}
