/**
 * Mavigex_B2BCsvCartImport — frontend styles
 *
 * Header-link spacing intentionally minimal: we inject one link into
 * Porto's header.links block. We do NOT override porto_header / header.phtml
 * (that was the Bss_FastOrder regression).
 */

/* Header user-menu link — text-only; Porto's icon font is "porto-icons",
   not FontAwesome, so we don't ship an ::before glyph here. If the client
   wants an icon, add it via a Porto theme override using a real
   porto-icons codepoint. */
.header.links .b2b-csv-import-link {
    /* spacing inherits from sibling header.links items */
}

/* Upload page */
.b2b-csv-import {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 16px;
}
.b2b-csv-import__intro {
    margin-bottom: 12px;
    line-height: 1.5;
}
.b2b-csv-import__sample {
    margin-bottom: 24px;
}
.b2b-csv-import__form .field {
    margin-bottom: 16px;
}
.b2b-csv-import__form .note {
    margin-top: 6px;
    font-size: 12px;
    color: #555;
}

/* CSV import modal — body styles only; modal title + footer buttons
   are rendered by Magento_Ui/js/modal/modal */
.b2b-csv-import-modal {
    padding: 4px 0;
}
.b2b-csv-import-modal__panel + .b2b-csv-import-modal__panel {
    margin-top: 12px;
}
.b2b-csv-import-modal__intro {
    margin: 0 0 12px;
    line-height: 1.5;
}
.b2b-csv-import-modal__sample {
    margin: 0 0 16px;
}
.b2b-csv-import-modal .field {
    margin-bottom: 16px;
}
.b2b-csv-import-modal .note {
    margin-top: 6px;
    font-size: 12px;
    color: #555;
}
.b2b-csv-import-modal__error {
    margin: 12px 0 0;
}

/* Progress panel */
.b2b-csv-import-modal__progress-counter {
    margin: 0 0 8px;
    font-weight: 600;
}
.b2b-csv-import-modal__progress-bar {
    width: 100%;
    height: 14px;
    appearance: none;
    -webkit-appearance: none;
}
.b2b-csv-import-modal__progress-bar::-webkit-progress-bar {
    background: #eee;
    border-radius: 3px;
}
.b2b-csv-import-modal__progress-bar::-webkit-progress-value {
    background: #1979c3;
    border-radius: 3px;
    transition: width 0.15s ease-out;
}
.b2b-csv-import-modal__progress-bar::-moz-progress-bar {
    background: #1979c3;
    border-radius: 3px;
}
.b2b-csv-import-modal__progress-overflow {
    margin: 12px 0 0;
    font-size: 12px;
    color: #b78103;
}

/* Done panel */
.b2b-csv-import-modal__stats {
    margin: 0;
    padding: 0;
    list-style: none;
}
.b2b-csv-import-modal__stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}
.b2b-csv-import-modal__stat:last-child {
    border-bottom: 0;
}
.b2b-csv-import-modal__stat--success .b2b-csv-import-modal__stat-value {
    color: #2e7d32;
}
.b2b-csv-import-modal__stat-label {
    color: #333;
}
.b2b-csv-import-modal__stat-value {
    font-size: 16px;
    font-weight: 600;
}
/*
 * Modal footer: equal sizing for primary / secondary pairs.
 * IMPORTANT: Scope under .modals-wrapper — Magento renders popups ONLY there,
 * never inside .page-header. Broader selectors could theoretically affect UI
 * if stylesheets merge badly; this avoids any bleed to header/action.nav-toggle/minicart.
 */
.modals-wrapper aside.modal-popup.b2b-csv-import-modal-wrap .modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: stretch;
}

.modals-wrapper aside.modal-popup.b2b-csv-import-modal-wrap .modal-footer .action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 calc(50% - 0.375rem);
    margin: 0 !important;
    box-sizing: border-box;
}

@media (max-width: 479px) {
    .modals-wrapper aside.modal-popup.b2b-csv-import-modal-wrap .modal-footer .action {
        flex-basis: 100%;
    }
}

.b2b-csv-import-modal .fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.b2b-csv-import-modal__file-input[type="file"] {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
    min-height: 42px;
    line-height: 40px;
    border: 1px solid #c2c2c2;
    border-radius: 1px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}

.b2b-csv-import-modal__file-input[type="file"]::file-selector-button,
.b2b-csv-import-modal__file-input[type="file"]::-webkit-file-upload-button {
    margin-inline-end: 12px;
    padding: 0.5rem 1rem;
    font-size: inherit;
    line-height: 1.42857143;
    border: none;
    border-radius: 1px;
    background: #f0f0f0;
    color: #333;
    cursor: pointer;
}

.b2b-csv-import-modal__cancelled-note {
    margin: 12px 0 0;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #303030;
    background: #f5f5f5;
    border: 1px solid #cacaca;
    border-radius: 1px;
}
.b2b-csv-import-modal__failure-details {
    margin-top: 12px;
}
.b2b-csv-import-modal__failure-details summary {
    cursor: pointer;
    color: #1979c3;
    padding: 4px 0;
}
.b2b-csv-import-modal__failure-list {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 13px;
    max-height: 240px;
    overflow-y: auto;
}
.b2b-csv-import-modal__failure-list li {
    padding: 2px 0;
}
.b2b-csv-import-modal__failure-list code,
.b2b-csv-import-modal__substitution-list code {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    padding: 0 4px;
    font-size: 12px;
}
.b2b-csv-import-modal__failure-reason {
    color: #555;
}

/* Substitution list — same visual treatment as the failure list so the
   reader doesn't have to learn two formats. */
.b2b-csv-import-modal__substitution-details {
    margin-top: 12px;
}
.b2b-csv-import-modal__substitution-details summary {
    cursor: pointer;
    color: #1979c3;
    padding: 4px 0;
}
.b2b-csv-import-modal__substitution-list {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 13px;
    max-height: 240px;
    overflow-y: auto;
}
.b2b-csv-import-modal__substitution-list li {
    padding: 2px 0;
}

/* Post-import summary banner on cart */
.b2b-csv-import-summary {
    margin: 0 0 20px;
    padding: 12px 16px;
    border-left-width: 4px;
    border-left-style: solid;
}
.b2b-csv-import-summary.success { border-left-color: #2e7d32; }
.b2b-csv-import-summary.warning { border-left-color: #b78103; }
.b2b-csv-import-summary__title {
    margin-bottom: 6px;
}
.b2b-csv-import-summary__list {
    margin: 0;
    padding-left: 16px;
}
.b2b-csv-import-summary__list ul {
    margin: 4px 0 0;
    padding-left: 16px;
}

/**
 * Cart page layout (checkout): tighter summary width + slimmer QTY column.
 * Scoped to checkout-cart-index desktop (@screen__m, 768px) to mirror Porto checkout cart LESS.
 */
@media only screen and (min-width: 768px) {
    .checkout-cart-index .cart-summary {
        width: 29%;
        padding-left: 10px;
        padding-right: 10px;
        box-sizing: border-box;
    }

    .checkout-cart-index .cart-container .form-cart,
    .checkout-cart-index .cart-container .cart-gift-item,
    .checkout-cart-index .block-cart-failed,
    .checkout-cart-index .abs-shopping-cart-items-desktop {
        width: 71%;
        padding-right: 2%;
        box-sizing: border-box;
    }

    .checkout-cart-index .cart.table-wrapper thead .col.qty,
    .checkout-cart-index .cart.table-wrapper tbody .col.qty {
        width: 80px;
        max-width: 80px;
        box-sizing: border-box;
    }

    .checkout-cart-index .cart.table-wrapper .col.qty .input-text.qty {
        width: 100%;
        max-width: 72px;
        box-sizing: border-box;
        min-width: 0;
    }
}
