/* SysDX Quote Request - Front-office Styles */

/* ── Cards ───────────────────────────────────────────────────────── */
.sysdx-quote-request .card,
.sysdx-quotes-list .card,
.sysdx-quote-detail .card,
.sysdx-request-form .section-card {
    border: 1px solid #e0ece7;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    background: #fff;
    overflow: hidden;
}

/* Card contenant la recherche produit : l'autocomplete doit dépasser */
.sysdx-quote-detail .card.sysdx-add-product-card {
    overflow: visible;
}

.sysdx-quote-request .card-body,
.sysdx-quote-detail .card-body,
.sysdx-request-form .card-body {
    padding: 1.5rem;
}

/* ── Sections du formulaire de demande ──────────────────────────── */
.sysdx-request-form .mb-4:not(.text-right) {
    border: 1px solid #dce8e1;
    border-radius: 6px;
    margin-bottom: 1.5rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    background: #fff;
    overflow: hidden;
}

.sysdx-request-form h3 {
    color: #1f714f;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    padding: 14px 20px;
    background: #f4fbf7;
    border-bottom: 1px solid #dce8e1;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: none;
    word-wrap: break-word;
}

.sysdx-request-form h3 i {
    color: #1f714f;
    font-size: 20px;
}

.sysdx-request-form .card-body {
    padding: 1.5rem;
}

/* ── Formulaire : labels ────────────────────────────────────────── */
.sysdx-quote-request .form-group label.required::after,
.sysdx-request-form .form-group label.required::after {
    content: ' *';
    color: #e74c3c;
}

/* ── Textarea ───────────────────────────────────────────────────── */
.sysdx-quote-request textarea.form-control,
.sysdx-request-form textarea.form-control {
    resize: vertical;
    min-height: 120px;
}
.sysdx-quotes-list .card{     padding: 12px 24px;}
/* ── Titres h5 ──────────────────────────────────────────────────── */
h5 {
    color: #1f714f;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    word-wrap: break-word;
}

/* ── Section processus ──────────────────────────────────────────── */
.quote-process {
    border-left: 4px solid #1f714f;
}
.sysdx-quotes-list .mb-4  a{ margin-bottom: 1.5rem; }
.process-items {
    font-size: 13px;
}

.process-items i,
.sysdx-request-form h3 i {
    color: #1f714f;
}

.process-items > div {
    padding: 8px;
}

.process-icon {
    font-size: 28px;
    margin-bottom: 8px;
    color: #1f714f;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

/* ── Groupe quantité (formulaire demande) ───────────────────────── */
.quantity-group .btn-qty {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f3f5;
    color: #333;
    border-radius: 8px;
    margin: 0 4px;
    transition: .2s;
}

.quantity-group .btn-qty:hover {
    background: #1f714f;
    color: #fff;
    transform: scale(1.05);
}

.quantity-group .quantity-input {
    width: 55px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-weight: 600;
}

/* ── Groupe quantité (vue devis) ────────────────────────────────── */
.qty-group {
    max-width: 130px;
    margin: 0 auto;
}

.qty-group .form-control {
    text-align: center;
    font-weight: 600;
    -moz-appearance: textfield;
}

.qty-group .form-control::-webkit-outer-spin-button,
.qty-group .form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-group .btn {
    padding: 0.25rem 0.6rem;
    font-weight: bold;
    font-size: 1rem;
}

/* Masquer les flèches des inputs number dans le tableau produits */
#rq-selected-tbody input[type="number"]::-webkit-outer-spin-button,
#rq-selected-tbody input[type="number"]::-webkit-inner-spin-button,
#rq-qty::-webkit-outer-spin-button,
#rq-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#rq-selected-tbody input[type="number"],
#rq-qty {
    -moz-appearance: textfield;
    text-align: center;
    font-weight: 600;
}

/* ── Bannière message admin (front) ─────────────────────────────── */
.sysdx-admin-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, #e8f5ee 0%, #f0faf4 100%);
    border: 1px solid #a8d5b8;
    border-left: 5px solid #1f714f;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(31,113,79,.08);
}
.sysdx-banner-icon {
    color: #1f714f;
    font-size: 26px;
    flex-shrink: 0;
    margin-top: 2px;
}
.sysdx-banner-body {
    font-size: 14px;
    color: #2d4a38;
    line-height: 1.6;
}
.sysdx-banner-body p { margin: 0; }

/* ── Options panier (conversion devis) ──────────────────────────── */
.sysdx-cart-option {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-size: 13px;
}
.sysdx-cart-opt-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin: 0;
    font-weight: normal;
    color: #444;
}
.sysdx-cart-opt-label input[type="radio"] { margin: 0; }

/* ── Bouton Voir le détail (liste devis) ────────────────────────── */
.sysdx-quotes-list .btn-outline-primary {
    color: #1f714f;
    border-color: #1f714f;
    background: transparent;
}
.sysdx-quotes-list .btn-outline-primary:hover {
    background: #1f714f;
    color: #fff;
}

/* ── Boutons retour / navigation ─────────────────────────────────── */
.sysdx-request-form .btn-outline-secondary,
.sysdx-bottom-actions .btn-outline-secondary,
.sysdx-quotes-list .btn-outline-secondary {
    color: #555 !important;
    border-color: #aaa !important;
    background: transparent !important;
}
.sysdx-request-form .btn-outline-secondary:hover,
.sysdx-bottom-actions .btn-outline-secondary:hover,
.sysdx-quotes-list .btn-outline-secondary:hover {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

/* ── Badges statut ──────────────────────────────────────────────── */
.badge-info      { background-color: #17a2b8; color: #fff; }
.badge-warning   { background-color: #ffc107; color: #333; }
.badge-success   { background-color: #28a745; color: #fff; }
.badge-danger    { background-color: #dc3545; color: #fff; }
.badge-secondary { background-color: #6c757d; color: #fff; }
.badge-primary   { background-color: #1f714f; color: #fff; }

/* ── Tableau articles devis ─────────────────────────────────────── */
.sysdx-quote-detail .table td {
    vertical-align: middle;
}

.sysdx-quote-detail .table img {
    border-radius: 3px;
    border: 1px solid #eee;
}

.sysdx-quote-detail .table-sm td {
    padding: 0.5rem 0.75rem;
}

/* ── Alert succès ───────────────────────────────────────────────── */
.sysdx-quote-request .alert-success h4,
.sysdx-request-form .alert-success h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Navigation ─────────────────────────────────────────────────── */
.sysdx-quote-nav a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
    font-size: 0.85rem;
}

.sysdx-quote-nav a:hover {
    color: #1f714f;
}

/* ── Lien compte client ─────────────────────────────────────────── */
#sysdx-quote-link .link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 1rem;
}

/* ── Custom file input (Bootstrap 4 — fallback si le thème ne l'inclut pas) ── */
.custom-file {
    position: relative;
    display: inline-block;
    width: 100%;
    height: calc(1.5em + .75rem + 2px);
    margin-bottom: 0;
}

.custom-file-input {
    position: relative;
    z-index: 2;
    width: 100%;
    height: calc(1.5em + .75rem + 2px);
    margin: 0;
    overflow: hidden;
    opacity: 0;
    cursor: pointer;
}

.custom-file-label {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    height: calc(1.5em + .75rem + 2px);
    padding: .375rem .75rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;
}

.custom-file-label::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: block;
    height: calc(1.5em + .75rem);
    padding: .375rem .75rem;
    line-height: 1.5;
    color: #495057;
    content: "Parcourir";
    background-color: #e9ecef;
    border-left: 1px solid #ced4da;
    border-radius: 0 .25rem .25rem 0;
}

.custom-file-input:focus ~ .custom-file-label {
    border-color: #1f714f;
    box-shadow: 0 0 0 .2rem rgba(31, 113, 79, .25);
    outline: none;
}

/* ── Ligne recherche + quantité + ajouter (formulaire demande) ───── */
.rq-add-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 12px;
}

.rq-search-col {
    flex: 1 1 auto;
    min-width: 0;
}

.rq-qty-col {
    flex: 0 0 auto;
}

.rq-add-col {
    flex: 0 0 auto;
}

/* Contrôle quantité custom */
.rq-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    height: 38px; max-width: 120px;
}

.rq-qty-btn {
    width: 34px;
    height: 38px;
    border: none;
    background: #f0f2f4;
    color: #333;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
    padding: 0;
}

.rq-qty-btn:hover {
    background: #1f714f;
    color: #fff;
}

.rq-qty-input {
    width: 52px;
    height: 38px;
    border: none;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 0;
}

.rq-qty-input::-webkit-outer-spin-button,
.rq-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.rq-qty-input:focus {
    outline: none;
    border-color: #1f714f;
}

.rq-btn-add {
    white-space: nowrap;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Label produit sélectionné */
.rq-selected-label {
    color: #1f714f;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

/* Responsive : colonne quantité et ajouter passent à 100% sous 576px */
@media (max-width: 576px) {
    .rq-add-row {
        flex-wrap: wrap;
    }
    .rq-search-col {
        width: 100%;
    }
    .rq-qty-col,
    .rq-add-col {
        flex: 1 1 auto;
    }
    .rq-btn-add {
        width: 100%;
        justify-content: center;
    }
}

/* ── Tableau produits sélectionnés (formulaire) ─────────────────── */
#rq-selected-products-wrapper {
    margin-top: 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

#rq-selected-table thead th {
    background: #f8f9fa;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

/* ── Spinner bouton soumission formulaire ────────────────────────── */
@keyframes rq-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Boutons bas de page (Retour + Imprimer) ─────────────────────── */
.sysdx-bottom-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── En-tête / pied d'impression (invisible à l'écran) ──────────── */
.sysdx-print-header,
.sysdx-print-footer { display: none; }

/* ── Typographie en-tête print ───────────────────────────────────── */
.sysdx-ph-shop   { font-size: 22pt; font-weight: 700; color: #1f714f; line-height: 1.2; }
.sysdx-ph-title  { font-size: 26pt; font-weight: 700; color: #1a1a1a; letter-spacing: 2px; }
.sysdx-ph-ref    { font-size: 11pt; color: #555; margin-top: 2px; }
.sysdx-ph-rule   { border: none; border-top: 2px solid #1f714f; margin: 12px 0; }
.sysdx-ph-section-label {
    font-size: 8pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1f714f;
    margin-bottom: 4px;
}
.sysdx-ph-line   { font-size: 10pt; color: #222; line-height: 1.5; }
.sysdx-ph-key    { font-size: 10pt; color: #666; padding-right: 10px; white-space: nowrap; }
.sysdx-ph-val    { font-size: 10pt; color: #222; font-weight: 600; }
.sysdx-ph-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-left: 3px solid #1f714f;
    font-size: 9pt;
    color: #444;
    background: #f4fbf7;
}

/* ── Impression ──────────────────────────────────────────────────── */
@media print {

    /* Format A4, marges propres */
    @page {
        size: A4 portrait;
        margin: 12mm 14mm 18mm 14mm;
    }

    /* Afficher les blocs print */
    .sysdx-print-header { display: block !important; margin-bottom: 4mm; }
    .sysdx-print-footer {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-top: 1px solid #ccc;
        padding: 3mm 14mm;
        font-size: 8pt;
        color: #888;
        background: #fff;
    }

    /* Masquer tout ce qui n'est pas utile */
    .sysdx-print-hide-actions,
    #header, .header-top, .header-nav, .header-banner,
    #_desktop_logo, #search_widget, #_desktop_cart, #_desktop_user_info,
    #top-menu, nav.breadcrumb, .breadcrumb, nav[aria-label],
    #footer, .footer-container, .footer-before-columns, .block-social,
    #notifications, .notifications-container,
    .page-header { display: none !important; }

    /* Corps propre */
    body, html { background: #fff !important; color: #000 !important; }
    #main, #wrapper, .page-wrapper, .page-content,
    #content-wrapper, #content {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .container { max-width: 100% !important; padding: 0 !important; }

    /* Cartes : supprimer ombres et arrondis */
    .sysdx-quote-detail .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        border-radius: 0 !important;
        margin-bottom: 5mm !important;
    }
    .sysdx-quote-detail .card-header {
        background: #f4fbf7 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border-bottom: 1px solid #ccc !important;
    }
    .sysdx-quote-detail .card-body { padding: 8px 12px !important; }

    /* Tableau articles */
    .sysdx-quote-detail .table {
        font-size: 9pt !important;
        width: 100% !important;
    }
    .sysdx-quote-detail .table th {
        background: #e8f4ee !important;
        color: #1f714f !important;
        font-weight: 700;
        font-size: 8pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .sysdx-quote-detail .table td,
    .sysdx-quote-detail .table th { padding: 5px 8px !important; }

    /* Masquer la colonne image à l'impression */
    .sysdx-quote-detail .table th:first-child,
    .sysdx-quote-detail .table td:first-child { display: none !important; }

    /* En-tête de tableau répété sur chaque page */
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }

    /* Totaux : passer en pleine largeur */
    .sysdx-quote-detail .row > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    .sysdx-quote-detail .table-sm { font-size: 10pt !important; }
    #quote-total-ttc { font-size: 13pt !important; color: #1f714f !important; }

    /* Coupes de page */
    table         { page-break-inside: auto; }
    tr            { page-break-inside: avoid; page-break-after: auto; }
    .card         { page-break-inside: avoid; }

    /* Supprimer les décorations de liens */
    a { color: inherit !important; text-decoration: none !important; }
    a[href]::after { content: none !important; }

    /* Badges lisibles en N&B */
    .badge { border: 1px solid #aaa !important; background: transparent !important;
             color: #000 !important; padding: 1px 4px !important; }

    /* Espace sous le contenu pour le pied de page fixe */
    .sysdx-quote-detail { padding-bottom: 12mm; }
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sysdx-quote-request .card-body,
    .sysdx-quote-detail .card-body,
    .sysdx-request-form .card-body {
        padding: 1rem;
    }

    .sysdx-quote-detail .table {
        font-size: 0.85rem;
    }

    .qty-group {
        max-width: 110px;
    }

    .sysdx-request-form h3 {
        font-size: 14px;
        padding: 12px 15px;
    }
}
