/*
 * Konect_OnOrderRequest : « Disponible sur commande ».
 * Fiche produit (buy-box, jetons --k-* du thème), fenêtre de demande, listes produits.
 */

/* ----- Fiche produit : buy-box ----- */
body.catalog-product-view .kbuy-body > .konorder-cta {
    order: 4;
}

body.catalog-product-view .konorder-note {
    margin: 16px 0 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--k-muted, #7b7b83);
}

body.catalog-product-view .konorder-btn {
    margin-top: 14px;
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 12px;
    font-family: var(--k-display, "Poppins", sans-serif);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #fff;
    background: var(--k-accent, #f96302);
    box-shadow: 0 8px 18px -6px rgba(249, 99, 2, .5);
    cursor: pointer;
    transition: background .15s, transform .12s, box-shadow .15s;
}

body.catalog-product-view .konorder-btn:hover,
body.catalog-product-view .konorder-btn:focus-visible {
    background: var(--k-accent-dark, #e35502);
    box-shadow: 0 11px 22px -6px rgba(249, 99, 2, .55);
}

body.catalog-product-view .konorder-btn:active {
    transform: translateY(1px);
}

/* ----- Fenêtre -----
 * Sélecteurs préfixés par .konorder-modal : la règle générique du thème
 * « button:not(.primary) » (custom.css, chargé après ce fichier) écrase sinon hauteur,
 * fond et marges des boutons. */
.konorder-modal .modal-inner-wrap {
    width: 520px;
    max-width: calc(100% - 32px);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 60px -10px rgba(20, 20, 30, .35);
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1b1b1d;
}

.konorder-modal .modal-header {
    padding: 22px 26px 0;
    border: 0;
}

.konorder-modal .modal-title {
    font-family: "Poppins", "Open Sans", sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.3;
    border: 0;
    padding: 0;
    margin: 0;
}

.konorder-modal .action-close {
    top: 14px;
    right: 14px;
}

.konorder-modal .modal-content {
    padding: 18px 26px 24px;
}

.konorder-prod {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e7e7ea;
    border-radius: 12px;
    background: #fafafb;
}

.konorder-prod img {
    width: 56px;
    height: 56px;
    flex: none;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.konorder-prod b {
    display: block;
    font-size: 14px;
    line-height: 1.35;
}

.konorder-prod span {
    font-size: 12.5px;
    color: #7b7b83;
}

.konorder-label {
    display: block;
    font-weight: 600;
    font-size: 13.5px;
    margin: 18px 0 8px;
}

.konorder-label em {
    font-weight: 400;
    font-style: normal;
    color: #9b9ba3;
}

.konorder-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.konorder-modal .konorder-qty button {
    width: 40px;
    height: 46px;
    line-height: 1;
    border-radius: 0;
    border: 0;
    background: #fff;
    font-size: 19px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    padding: 0;
    box-shadow: none;
}

.konorder-modal .konorder-qty button:hover {
    color: var(--k-accent, #f96302);
    background: #fff;
}

.konorder-modal .konorder-qty input[type="number"] {
    width: 72px;
    height: 46px;
    border: 0;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    border-radius: 0;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    padding: 0;
    color: #1b1b1d;
    -moz-appearance: textfield;
}

.konorder-modal .konorder-qty input[type="number"]::-webkit-outer-spin-button,
.konorder-modal .konorder-qty input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.konorder-form textarea {
    width: 100%;
    min-height: 110px;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.konorder-hint {
    font-size: 12.5px;
    line-height: 1.5;
    color: #7b7b83;
    margin: 12px 0 0;
}

.konorder-error {
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fdecee;
    color: #b42318;
    font-size: 13.5px;
}

.konorder-error[hidden],
.konorder-form[hidden],
.konorder-done[hidden] {
    display: none;
}

.konorder-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.konorder-modal .konorder-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
    height: 46px;
    border-radius: 12px;
    padding: 0 20px;
    font-family: "Poppins", "Open Sans", sans-serif;
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
}

.konorder-modal .konorder-actions .konorder-cancel {
    background: #fff;
    border: 1px solid #e7e7ea;
    color: #3a3a3e;
}

.konorder-modal .konorder-actions .konorder-send {
    background: var(--k-accent, #f96302);
    border: 0;
    color: #fff;
    box-shadow: 0 8px 18px -6px rgba(249, 99, 2, .5);
}

.konorder-modal .konorder-actions .konorder-send:hover {
    background: var(--k-accent-dark, #e35502);
}

.konorder-modal .konorder-actions .konorder-send[disabled] {
    opacity: .6;
    cursor: wait;
}

.konorder-done {
    text-align: center;
    padding: 10px 0 0;
}

.konorder-done-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e8f6ee;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.konorder-done h3 {
    font-family: "Poppins", "Open Sans", sans-serif;
    font-size: 18px;
    margin: 0 0 8px;
}

.konorder-done p {
    color: #3a3a3e;
    font-size: 14px;
    margin: 0;
}

.konorder-done .konorder-actions {
    justify-content: center;
}

@media (max-width: 480px) {
    .konorder-modal .modal-header {
        padding: 18px 18px 0;
    }

    .konorder-modal .modal-content {
        padding: 14px 18px 20px;
    }

    .konorder-modal .konorder-actions {
        flex-direction: column-reverse;
    }

    .konorder-modal .konorder-actions button {
        width: 100%;
    }
}

/* ----- Sélecteur « Autres versions disponibles » (Konect_ColorVariants) ----- */
.kcv-option .kcv-option__oos.kcv-option__onorder {
    color: #ff5501;
}

/* ----- Recherche instantanée de l'en-tête (Mageplaza_Search) ----- */
.autocomplete-suggestions .suggestion-info .product-stock.on-order {
    color: #ff5501;
}

.autocomplete-suggestions .suggestion-info .product-stock.on-order::before {
    background-color: #ff5501;
}

/* ----- Listes produits ----- */
.product-stock-level.on-order {
    color: #ff5501;
}

.product-stock-level.on-order::before,
.stock-dot.on-order {
    background-color: #ff5501;
}

a.konorder-list-btn,
a.konorder-list-btn:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: #ff5501;
    color: #fff;
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

a.konorder-list-btn:hover,
a.konorder-list-btn:focus-visible {
    background: #e64a00;
    color: #fff;
    text-decoration: none;
}

a.konorder-list-btn--dense {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 11.5px;
}

/* Mode grille : l'emplacement « En rupture de stock » est un petit texte posé sur l'image ;
   le lien y garde la même taille, en orange, au lieu d'un bouton qui recouvrirait le nom. */
.products-grid .product-item-actions a.konorder-list-btn,
.products-grid .product-item-actions a.konorder-list-btn:visited {
    display: inline;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    color: #ff5501;
    font-size: 14px;
    font-weight: 600;
}

.products-grid .product-item-actions a.konorder-list-btn:hover,
.products-grid .product-item-actions a.konorder-list-btn:focus-visible {
    background: none;
    color: #e64a00;
    text-decoration: underline;
}
