/**
 * Portail retours client — styles front-end.
 *
 * Volontairement neutre et sobre : hérite au maximum du thème (boutons .button WooCommerce).
 * @package WC_Better_Management
 * @since   7.4.0
 */

.wcbm-portal {
    max-width: 640px;
    margin: 1.5em 0;
}

/* Icône du menu « Demander un retour » dans Mon compte.
   Le thème applique sa police d'icônes ; notre endpoint custom n'a pas de glyphe mappé
   (carré noir .notdef). On remplace par une icône SVG « retour » via masque CSS, qui
   hérite la couleur du texte du thème (currentColor). */
.woocommerce-MyAccount-navigation-link--wcbm-return-request a::before {
    content: "" !important;
    display: inline-block !important;
    width: 1em;
    height: 1em;
    margin-right: 0.5em;
    vertical-align: -0.12em;
    background: currentColor !important;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 14 4 9 9 4'/><path d='M4 9h11a5 5 0 0 1 0 10H9'/></svg>") no-repeat center / contain;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 14 4 9 9 4'/><path d='M4 9h11a5 5 0 0 1 0 10H9'/></svg>") no-repeat center / contain;
    font-family: inherit !important;
}
.woocommerce-MyAccount-navigation-link--wcbm-return-request a::after {
    content: "" !important;
    display: none !important;
}

.wcbm-portal__steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    list-style: none;
    margin: 0 0 1.5em;
    padding: 0;
    counter-reset: wcbm-step;
}

.wcbm-portal__steps li {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.4em 0.6em;
    font-size: 0.85em;
    color: #767676;
    border-bottom: 2px solid #e0e0e0;
    counter-increment: wcbm-step;
}

.wcbm-portal__steps li::before {
    content: counter(wcbm-step) ". ";
}

.wcbm-portal__steps li.is-active {
    color: #1a1a1a;
    border-bottom-color: #2271b1;
    font-weight: 600;
}

.wcbm-portal__steps li.is-done {
    color: #1a7f37;
    border-bottom-color: #1a7f37;
}

.wcbm-portal__message {
    padding: 0.75em 1em;
    margin-bottom: 1em;
    border-left: 4px solid #d63638;
    background: #fcf0f1;
    color: #8a1f22;
}

.wcbm-portal__loading {
    color: #767676;
    font-style: italic;
}

.wcbm-portal__title {
    margin: 0 0 0.75em;
    font-size: 1.15em;
}

/* Liste des commandes */
.wcbm-portal__orders,
.wcbm-portal__items,
.wcbm-portal__modes {
    list-style: none;
    margin: 0 0 1em;
    padding: 0;
}

.wcbm-portal__order {
    margin-bottom: 0.5em;
}

.wcbm-portal__order-btn {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em 1em;
    align-items: baseline;
    width: 100%;
    text-align: left;
    padding: 0.75em 1em;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
}

.wcbm-portal__order-btn:hover,
.wcbm-portal__order-btn:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.wcbm-portal__order-num {
    font-weight: 600;
}

.wcbm-portal__order-date,
.wcbm-portal__order-items {
    color: #767676;
    font-size: 0.9em;
}

.wcbm-portal__order-deadline {
    font-size: 0.8em;
    color: #a67c00;
    background: #fff8e1;
    padding: 0.1em 0.5em;
    border-radius: 999px;
}

/* Vignettes produits (liste commandes + mes demandes) */
.wcbm-portal__thumbs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    flex-basis: 100%;
}

.wcbm-portal__thumb {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border: 1px solid #f0f0f1;
    border-radius: 4px;
    background: #fff;
}

.wcbm-portal__thumb-more {
    font-size: 0.8em;
    color: #767676;
}

/* Articles */
.wcbm-portal__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
    padding: 0.6em 0;
    border-bottom: 1px solid #f0f0f1;
}

.wcbm-portal__item-label {
    display: flex;
    align-items: center;
    gap: 0.6em;
    cursor: pointer;
}

.wcbm-portal__item-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border: 1px solid #f0f0f1;
    border-radius: 4px;
    background: #fff;
    flex: 0 0 auto;
}

.wcbm-portal__item-qty {
    min-width: 3.5em;
}

/* Motif */
.wcbm-portal__reason {
    margin: 1em 0;
}

.wcbm-portal__reason-label {
    display: block;
    margin-bottom: 0.25em;
    font-weight: 600;
}

.wcbm-portal__reason-select {
    width: 100%;
    max-width: 320px;
}

/* Popup « non éligible » (liste des commandes) */
.wcbm-portal-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 1em;
}

.wcbm-portal-modal {
    background: #fff;
    border-radius: 6px;
    padding: 1.5em;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.wcbm-portal-modal h3 {
    margin: 0 0 0.5em;
}

.wcbm-portal-modal p {
    margin: 0 0 1.25em;
}

/* Notice (commande non éligible) */
.wcbm-portal__notice {
    padding: 1em 1.25em;
    border-left: 4px solid #dba617;
    background: #fcf9e8;
    margin-bottom: 1em;
}

.wcbm-portal__notice-reason {
    margin: 0.4em 0 0;
    color: #555;
}

.wcbm-portal__home-link {
    margin-top: 1.5em;
}

/* Mes demandes (vue statut) */
.wcbm-portal__requests {
    list-style: none;
    margin: 0 0 2em;
    padding: 0;
}

.wcbm-portal__request {
    padding: 0.75em 1em;
    margin-bottom: 0.75em;
    border: 1px solid #dcdcde;
    border-left-width: 4px;
    border-radius: 4px;
    background: #fff;
}

.wcbm-portal__request--rejected { border-left-color: #d63638; }
.wcbm-portal__request--label_generated,
.wcbm-portal__request--validated_refund,
.wcbm-portal__request--completed { border-left-color: #1a7f37; }
.wcbm-portal__request--pending_operator { border-left-color: #dba617; }

.wcbm-portal__request-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1em;
    flex-wrap: wrap;
}

.wcbm-portal__request-order { font-weight: 600; }

.wcbm-portal__request-status {
    font-size: 0.85em;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    background: #f0f0f1;
}

.wcbm-portal__request-items {
    margin: 0.4em 0 0;
    color: #555;
    font-size: 0.9em;
}

.wcbm-portal__request-rejection {
    margin: 0.4em 0 0;
    color: #8a1f22;
    font-size: 0.9em;
}

.wcbm-portal__request-label {
    display: inline-block;
    margin-top: 0.5em;
}

.wcbm-portal__request-date {
    display: block;
    margin-top: 0.35em;
    color: #767676;
    font-size: 0.8em;
}

/* Issue du retour : échange (recommandé, en 1er) puis remboursement.
   Cartes empilées : les deux options ont la MÊME surface cliquable et la même
   hiérarchie de lecture. La recommandation est portée par le badge textuel
   « Recommandé » — le style ci-dessous ne fait que la souligner (jamais la seule
   couleur comme porteuse d'information). */
.wcbm-portal__prefs {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    margin-bottom: 1.5em;
}

.wcbm-portal__pref {
    display: flex;
    align-items: flex-start;
    gap: 0.6em;
    padding: 0.9em 1em;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
}

.wcbm-portal__pref-input {
    margin-top: 0.25em;
    flex: 0 0 auto;
}

.wcbm-portal__pref-text {
    display: block;
}

.wcbm-portal__pref-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em;
}

.wcbm-portal__pref-name {
    font-weight: 600;
}

.wcbm-portal__pref-badge {
    display: inline-block;
    padding: 0.1em 0.5em;
    border: 1px solid #1d6b3f;
    border-radius: 999px;
    background: #eaf6ee;
    color: #16532f;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.wcbm-portal__pref-desc {
    display: block;
    margin-top: 0.3em;
    color: #555;
    font-size: 0.88em;
    line-height: 1.4;
}

.wcbm-portal__pref--recommended {
    border-color: #1d6b3f;
    border-width: 2px;
    background: #f6fbf8;
}

/* Le focus clavier doit rester visible sur la carte entière (le radio est petit). */
.wcbm-portal__pref:focus-within {
    outline: 2px solid #1d6b3f;
    outline-offset: 2px;
}

/* Article : en-tête + variation */
.wcbm-portal__item {
    display: block;
}

.wcbm-portal__item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
}

.wcbm-portal__variation {
    margin: 0.5em 0 0 1.75em;
}

.wcbm-portal__variation-label {
    display: block;
    font-size: 0.85em;
    color: #555;
    margin-bottom: 0.2em;
}

.wcbm-portal__variation-select {
    width: 100%;
    max-width: 320px;
}

.wcbm-portal__variation-select option:disabled {
    color: #b0b0b0;
}

/* Produit variable sans aucune variation disponible à l'échange. */
.wcbm-portal__variation-empty {
    margin: 0.5em 0 0 1.75em;
    color: #8a1f22;
    font-size: 0.85em;
}

/* Note client */
.wcbm-portal__note {
    margin: 1.25em 0;
}

.wcbm-portal__note-label {
    display: block;
    margin-bottom: 0.25em;
    font-weight: 600;
}

.wcbm-portal__note-input {
    width: 100%;
}

/* Conditions de retour */
.wcbm-portal__conditions {
    margin: 1.25em 0;
    padding: 0.75em 1em;
    background: #f6f7f7;
    border-left: 4px solid #c3c4c7;
    font-size: 0.9em;
}

.wcbm-portal__conditions p {
    margin: 0.4em 0 0;
}

/* Modes */
.wcbm-portal__mode {
    margin-bottom: 0.75em;
}

.wcbm-portal__mode-cost {
    display: block;
    margin-top: 0.35em;
    margin-left: 0.4em;
    font-weight: 600;
    color: #1a1a1a;
}

.wcbm-portal__mode-label {
    display: block;
    padding: 0.75em 1em;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
}

.wcbm-portal__mode-name {
    display: block;
    font-weight: 600;
    margin-left: 0.4em;
}

.wcbm-portal__mode-desc {
    display: block;
    color: #767676;
    font-size: 0.9em;
    margin-top: 0.25em;
}

/* Récapitulatif */
.wcbm-portal__summary-items {
    margin: 0 0 1em;
    padding-left: 1.25em;
}

/* Navigation */
.wcbm-portal__nav {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    margin-top: 1.5em;
}

.wcbm-portal__nav .wcbm-portal__btn--next {
    margin-left: auto;
}

/* Confirmation finale */
.wcbm-portal__done {
    padding: 1em 1.25em;
    border-left: 4px solid #1a7f37;
    background: #edfaef;
}

.wcbm-portal__done-instructions {
    white-space: pre-line;
    margin-top: 0.5em;
    color: #1a1a1a;
}
