/*
 * Carte cadeau : champs du destinataire (fiche produit) et rubrique du panier / checkout.
 * Feuille à part, sans compilation, chargée seulement sur ces pages (src/Tools/GiftCardManager.php).
 * Valeurs reprises de assets/styles (noir #000, gris #f4f4f6, bordures à 20 %, rayon 5px).
 */
:root {
    --bob-gc-ink: #000;
    --bob-gc-line: #ccc;
    --bob-gc-soft: #f4f4f6;
    --bob-gc-danger: #c62828;
}

/* ---------- Fiche produit ---------- */
.bob-gc-fields {
    border: 0;
    margin: 30px 0;
    padding: 0;
    min-width: 0;
}

.bob-gc-fields__legend {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 6px;
    padding: 0;
}

.bob-gc-fields__hint {
    font-size: 14px;
    margin: 0 0 18px;
    color: #333;
}

.bob-gc-field {
    margin-bottom: 16px;
}

.bob-gc-field label {
    display: block;
    font-size: 14px;
    margin: 0 0 5px;
    color: var(--bob-gc-ink);
}

.bob-gc-field abbr {
    text-decoration: none;
}

.bob-gc-field__optional {
    color: #666;
}

/* Spécificité relevée : main.css retire la bordure par « input:not([type="radio"]):not([type="checkbox"]) ». */
.bob-gc-fields .bob-gc-field input:not([type="hidden"]),
.bob-gc-fields .bob-gc-field textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    font: inherit;
    font-size: 16px;
    line-height: 24px;
    color: var(--bob-gc-ink);
    background: transparent;
    border: 1px solid var(--bob-gc-line);
    border-radius: 5px;
    transition: border-color .2s;
}

.bob-gc-field textarea {
    resize: vertical;
    min-height: 100px;
}

.bob-gc-field input:focus-visible,
.bob-gc-field textarea:focus-visible {
    outline: 2px solid var(--bob-gc-ink);
    outline-offset: 1px;
    border-color: var(--bob-gc-ink);
}

/* ---------- Panier / checkout ---------- */
/*
 * Le thème retire la marge basse du sous-total : sans bordure haute, rien ne vient s'y coller.
 * Spécificité au-dessus de « .wc-block-components-discounts-meta .wc-block-components-totals-wrapper:first-child »
 * et de « .wc-block-components-totals-wrapper.slot-wrapper > * > * » (packages-style.css de WooCommerce).
 */
.wc-block-components-totals-wrapper.slot-wrapper .bob-gc-panel.wc-block-components-totals-wrapper,
.wc-block-components-discounts-meta .bob-gc-panel.wc-block-components-totals-wrapper.wc-block-components-totals-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 0;
    padding: 12px 0 16px;
}

/* Porte la classe des lignes du récapitulatif pour en prendre le retrait ; on garde la mise en colonne. */
.bob-gc-panel .bob-gc-actions.wc-block-components-totals-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.bob-gc-applied {
    flex-wrap: wrap;
}

/* Sur un écran étroit, le montant passe sous le libellé : il reste aligné à droite. */
.bob-gc-applied .wc-block-components-totals-item__value {
    margin-left: auto;
}

.bob-gc-applied__code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .9em;
    white-space: nowrap;
}

.bob-gc-applied__meta {
    width: 100%;
    font-size: 13px;
}

.bob-gc-toggle,
.bob-gc-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--bob-gc-ink);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.bob-gc-toggle {
    align-self: flex-start;
    font-size: 15px;
}

.bob-gc-link {
    font-size: 13px;
}

.bob-gc-toggle:focus-visible,
.bob-gc-link:focus-visible,
.bob-gc-form__submit:focus-visible {
    outline: 2px solid var(--bob-gc-ink);
    outline-offset: 2px;
}

.bob-gc-link:disabled {
    opacity: .5;
    cursor: wait;
}

.bob-gc-form__label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
}

.bob-gc-form__row {
    display: flex;
    gap: 8px;
}

/* Spécificité relevée, comme sur la fiche : main.css retire la bordure des champs. */
.bob-gc-panel .bob-gc-form .bob-gc-form__input {
    flex: 1 1 auto;
    min-width: 0;
    box-sizing: border-box;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    font-size: 16px;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--bob-gc-ink);
    background: #fff;
    border: 1px solid var(--bob-gc-line);
    border-radius: 5px;
}

.bob-gc-form__input::placeholder {
    text-transform: none;
    letter-spacing: 0;
    color: #767676;
}

.bob-gc-form__input:focus-visible {
    outline: 2px solid var(--bob-gc-ink);
    outline-offset: 1px;
}

.bob-gc-panel .bob-gc-form .bob-gc-form__input[aria-invalid="true"] {
    border-color: var(--bob-gc-danger);
}

.bob-gc-form__submit {
    flex: 0 0 auto;
    height: 48px;
    padding: 0 20px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--bob-gc-ink);
    border: 1px solid var(--bob-gc-ink);
    border-radius: 0;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.bob-gc-form__submit:hover:not(:disabled) {
    background: #fff;
    color: var(--bob-gc-ink);
}

.bob-gc-form__submit:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.bob-gc-error {
    margin: 0;
    font-size: 14px;
    color: var(--bob-gc-danger);
}

@media (max-width: 380px) {
    .bob-gc-form__row {
        flex-direction: column;
    }

    .bob-gc-form__submit {
        width: 100%;
    }
}
