/**
 * 2026 Aptivanet - B2B Quote Stylesheet
 */

/* Hide standard checkout & order navigation ("Processo di acquisto" / checkout buttons) */
.blockcart-content .cart-buttons .btn-primary,
.blockcart-content .cart-buttons a[href*="ordine"],
.blockcart-content .cart-buttons a[href*="order"],
#blockcart-content .cart-buttons .btn-primary,
#blockcart-content .cart-buttons a[href*="ordine"],
#blockcart-content .cart-buttons a[href*="order"],
.cart-buttons a[href*="ordine"],
.cart-buttons a[href*="order"],
.cart-buttons a.btn-primary,
.cart-preview a[href*="ordine"],
.cart-preview a[href*="order"],
.cart-sidebar a[href*="ordine"],
.cart-sidebar a[href*="order"],
.side-cart a[href*="ordine"],
.side-cart a[href*="order"],
#blockcart-modal .cart-content-btn a.btn-primary,
#blockcart-modal a[href*="ordine"],
#blockcart-modal a[href*="order"],
#blockcart-modal a[href*="checkout"],
.cart-detailed-actions .btn-primary:not(#b2b-submit-btn),
.cart-detailed-actions a[href*="checkout"],
.cart-detailed-actions a[href*="ordine"],
.cart-detailed-actions a[href*="order"],
.checkout.cart-detailed-actions,
.blockcart .checkout,
.blockcart a.btn-primary,
#blockcart a.btn-primary,
a[href$="/order"],
a[href$="/ordine"],
a[href*="/ordine?"],
a[href*="/order?"],
a[href*="controller=order"],
a[href*="action=show&checkout"],
.quickview .add-to-cart-and-express-checkout .express-checkout,
#history-link,
#order-slips-link,
a[href*="storico-ordini"],
a[href*="order-history"],
a[href*="controller=history"],
a[href$="/history"],
a[href*="note-di-credito"],
a[href*="credit-slip"],
a[href*="order-slip"],
a[href*="controller=order-slip"],
li:has(> #history-link),
li:has(> #order-slips-link),
li:has(> a[href*="storico-ordini"]),
li:has(> a[href*="order-history"]),
li:has(> a[href*="controller=history"]),
li:has(> a[href$="/history"]),
li:has(> a[href*="note-di-credito"]),
li:has(> a[href*="credit-slip"]),
li:has(> a[href*="order-slip"]),
li:has(> a[href*="controller=order-slip"]) {
    display: none !important;
}

/* Style the remaining Preventivo/Carrello button in the slide-in cart as the primary action */
.blockcart-content .cart-buttons .btn-secondary,
.blockcart-content .cart-buttons a:not([style*="display: none"]):not([style*="display:none"]),
#blockcart-content .cart-buttons .btn-secondary,
#blockcart-content .cart-buttons a:not([style*="display: none"]):not([style*="display:none"]),
.cart-buttons a.btn-secondary,
.cart-buttons a:only-child {
    background-color: #3b8761 !important;
    border-color: #3b8761 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    margin-top: 0 !important;
    width: 100% !important;
    display: block !important;
}

.blockcart-content .cart-buttons .btn-secondary:hover,
.blockcart-content .cart-buttons .btn-secondary:focus,
#blockcart-content .cart-buttons .btn-secondary:hover,
#blockcart-content .cart-buttons .btn-secondary:focus,
.cart-buttons a.btn-secondary:hover,
.cart-buttons a.btn-secondary:focus {
    background-color: #2e6d4e !important;
    border-color: #2e6d4e !important;
    color: #ffffff !important;
}

/* Badge styling */
.badge-status-submitted {
    background-color: #f59f00;
    color: #ffffff;
}

.badge-status-under_review {
    background-color: #3b8761;
    color: #ffffff;
}

.badge-status-approved {
    background-color: #2fb344;
    color: #ffffff;
}

.badge-status-rejected {
    background-color: #d63939;
    color: #ffffff;
}

.badge-status-expired {
    background-color: #6c757d;
    color: #ffffff;
}

/* Banner warning */
.b2b-pending-banner {
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* B2B Cart action custom styling */
.b2b-quote-cart-action {
    border: 2px solid #3b8761 !important;
}

.b2b-quote-cart-action .btn-primary {
    background-color: #3b8761 !important;
    border-color: #3b8761 !important;
}

.b2b-quote-cart-action .btn-primary:hover,
.b2b-quote-cart-action .btn-primary:focus {
    background-color: #2e6d4e !important;
    border-color: #2e6d4e !important;
}

.b2b-theme-color {
    color: #3b8761 !important;
}

/* Rich text formatting in browser views */
.b2b-rich-text {
    display: block;
    white-space: normal;
}
.b2b-rich-text p {
    display: block;
    margin-bottom: 0.5rem;
}
.b2b-rich-text p:last-child {
    margin-bottom: 0;
}
.b2b-rich-text br {
    display: inline !important;
    content: "" !important;
}
.b2b-rich-text ul, .b2b-rich-text ol {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}
.b2b-rich-text strong, .b2b-rich-text b {
    font-weight: 700;
}

/* Customer registration form: hide Optional comment on Company and Siret */
.form-group:has(#field-company) .form-control-comment,
.form-group:has(#field-siret) .form-control-comment,
.form-group:has(input[name="company"]) .form-control-comment,
.form-group:has(input[name="siret"]) .form-control-comment,
.form-group:has(#field-b2b_fiscal_code) .form-control-comment,
.form-group:has(input[name="b2b_fiscal_code"]) .form-control-comment,
.form-group:has(#field-b2b_pec) .form-control-comment,
.form-group:has(input[name="b2b_pec"]) .form-control-comment {
    display: none !important;
}

/* PA Registration Form Box & Grouping */
.b2b-pa-fields-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 20px 20px 10px 20px;
    margin: 20px 0 25px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.b2b-pa-fields-card .b2b-pa-title h5 {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
    margin: 0 0 18px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #3b8761;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.b2b-section-header {
    font-weight: 700;
    font-size: 14px;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 0 15px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #e2e8f0;
}

/* Legend icon beside form labels */
.b2b-field-legend-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0275d8;
    margin-left: 6px;
    vertical-align: middle;
    text-decoration: none !important;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.b2b-field-legend-btn:hover,
.b2b-field-legend-btn:focus {
    color: #3b8761;
    transform: scale(1.18);
    text-decoration: none !important;
}

.b2b-field-legend-btn i.material-icons {
    font-size: 17px;
    vertical-align: middle;
}

/* Modal styling & backdrop fix for Warehouse / PrestaShop themes */
#b2b-legend-modal {
    z-index: 1000005 !important;
}

#b2b-legend-modal.show {
    display: block !important;
    opacity: 1 !important;
}

#b2b-modal-backdrop {
    z-index: 999995 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(15, 23, 42, 0.6) !important;
    opacity: 1 !important;
}

#b2b-legend-modal .modal-dialog {
    z-index: 1000006 !important;
    position: relative !important;
    margin: 1.75rem auto !important;
    max-width: 520px !important;
    pointer-events: auto !important;
}

#b2b-legend-modal .modal-content {
    background-color: #ffffff !important;
    background: #ffffff !important;
    opacity: 1 !important;
    transform: none !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
    pointer-events: auto !important;
    overflow: hidden !important;
}

#b2b-legend-modal .modal-header {
    background-color: #f8fafc !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 16px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    opacity: 1 !important;
}

#b2b-legend-modal .modal-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    opacity: 1 !important;
}

#b2b-legend-modal .modal-header .close {
    font-size: 24px !important;
    font-weight: 400 !important;
    color: #64748b !important;
    opacity: 0.8 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
}

#b2b-legend-modal .modal-header .close:hover {
    color: #0f172a !important;
    opacity: 1 !important;
}

#b2b-legend-modal .modal-body {
    padding: 24px 22px !important;
    font-size: 14.5px !important;
    line-height: 1.65 !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    opacity: 1 !important;
}

#b2b-legend-modal .modal-body p {
    color: #1e293b !important;
    font-size: 14.5px !important;
    line-height: 1.65 !important;
    margin: 0 !important;
    opacity: 1 !important;
}

#b2b-legend-modal .modal-footer {
    padding: 12px 20px !important;
    background-color: #f8fafc !important;
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    opacity: 1 !important;
}

#b2b-legend-modal .modal-footer .btn-secondary {
    background-color: #3b8761 !important;
    border-color: #3b8761 !important;
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    padding: 7px 18px !important;
    border-radius: 4px !important;
    opacity: 1 !important;
    cursor: pointer !important;
}

#b2b-legend-modal .modal-footer .btn-secondary:hover {
    background-color: #2e6d4e !important;
    border-color: #2e6d4e !important;
}



