/* ASM Sconti Quantità — tier display (table / cards / list) */

/* Width is controlled from the Elementor widget, never hardcoded here,
   otherwise a percentage width set in the editor cannot win. */
.asm-qd-table-wrap {
    margin: 16px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.asm-qd-table-wrap *,
.asm-qd-table-wrap *::before,
.asm-qd-table-wrap *::after {
    box-sizing: border-box;
}

.asm-qd-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
}

.asm-qd-subtitle {
    font-size: 14px;
    color: #6b6b6b;
    margin: 0 0 12px;
    line-height: 1.5;
}

.asm-qd-note {
    font-size: 12px;
    color: #9b9a97;
    margin: 8px 0 0;
    line-height: 1.45;
}

.asm-qd-badge-best {
    display: inline-block;
    background: #2d8a4e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

/* ─── Product thumbnail with quantity indicator ─── */

.asm-qd-thumb {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    line-height: 0;
}

.asm-qd-thumb img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e5e3;
    border-radius: 8px;
    padding: 3px;
    display: block;
}

.asm-qd-thumb-qty {
    position: absolute;
    right: -6px;
    bottom: -6px;
    background: #37352f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 999px;
    border: 2px solid #fff;
    white-space: nowrap;
}

/* ─── Layout: table ─── */

.asm-qd-layout-table .asm-qd-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e5e3;
    font-size: 14px;
}

.asm-qd-layout-table .asm-qd-table th,
.asm-qd-layout-table .asm-qd-table td {
    padding: 9px 14px;
    text-align: left;
    border-bottom: 1px solid #eeeeec;
}

.asm-qd-layout-table .asm-qd-table thead th {
    background: #f7f6f3;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b6b6b;
    white-space: nowrap;
}

.asm-qd-layout-table .asm-qd-table tbody tr:last-child td {
    border-bottom: none;
}

.asm-qd-layout-table .asm-qd-qty-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ─── Layout: cards ─── */

.asm-qd-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.asm-qd-cards .asm-qd-card {
    position: relative;
    border: 1px solid #e5e5e3;
    border-radius: 10px;
    padding: 16px 14px;
    text-align: center;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.asm-qd-cards .asm-qd-thumb {
    margin: 0 auto 10px;
    display: block;
    width: fit-content;
}

.asm-qd-cards .asm-qd-card .asm-qd-qty {
    font-size: 13px;
    color: #6b6b6b;
    margin-bottom: 6px;
}

.asm-qd-cards .asm-qd-card .asm-qd-discount {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    color: #2d8a4e;
}

.asm-qd-cards .asm-qd-card .asm-qd-unit-price {
    font-size: 15px;
    margin-top: 6px;
}

.asm-qd-cards .asm-qd-card .asm-qd-savings {
    font-size: 12px;
    color: #9b9a97;
    margin-top: 4px;
}

.asm-qd-cards .asm-qd-card .asm-qd-badge-best {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
}

/* ─── Layout: list ─── */

.asm-qd-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asm-qd-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #e5e5e3;
    border-radius: 8px;
    padding: 11px 14px;
    background: #fff;
    font-size: 14px;
}

.asm-qd-list li .asm-qd-qty {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.asm-qd-list li .asm-qd-values {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    white-space: nowrap;
}

.asm-qd-list li .asm-qd-unit-price {
    font-weight: 600;
}

.asm-qd-list li .asm-qd-savings {
    font-size: 12px;
    color: #9b9a97;
}

/* ─── Shared value styling ─── */

.asm-qd-discount {
    font-weight: 600;
    color: #2d8a4e;
    white-space: nowrap;
}

.asm-qd-unit-price,
.asm-qd-savings {
    white-space: nowrap;
}

/* ─── Highlight of the band the customer has reached ─── */

.asm-qd-has-highlight .asm-qd-table tbody tr.asm-qd-active td {
    background: #eefaf0;
}

.asm-qd-has-highlight .asm-qd-card.asm-qd-active {
    border-color: #2d8a4e;
    box-shadow: 0 0 0 2px rgba(45, 138, 78, 0.15);
}

.asm-qd-has-highlight .asm-qd-list li.asm-qd-active {
    border-color: #2d8a4e;
    background: #eefaf0;
}

.asm-qd-has-highlight .asm-qd-active .asm-qd-thumb img {
    border-color: #2d8a4e;
}

.asm-qd-has-highlight .asm-qd-active .asm-qd-thumb-qty {
    background: #2d8a4e;
}

.asm-qd-has-highlight:not(.asm-qd-no-check) .asm-qd-active .asm-qd-discount::after {
    content: " ✓";
}

/* ─── Cart: per-line discount explanation ─── */

.asm-qd-cart-note {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: #5a5a55;
}

.asm-qd-cart-tag {
    display: inline-block;
    background: #2d8a4e;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 4px;
    margin-right: 4px;
}

.asm-qd-cart-note strong {
    color: #2d8a4e;
    font-weight: 700;
}

.asm-qd-cart-next {
    color: #8a8a85;
    white-space: nowrap;
}

/* B2B checkout (newrico-checkout): the item row is a CSS grid whose children
   are promoted by `display: contents`, so an unplaced note claims a cell of
   its own and squeezes the product title. Give it a full-width row instead. */
.rc-checkout__item .asm-qd-cart-note {
    grid-column: 1 / -1;
    margin: 4px 0 0;
}

/* Full price above, discounted below. Stacked as blocks so they inherit the
   column's own alignment and survive a `white-space: nowrap` price cell
   (the B2B checkout sets one). */
.asm-qd-cart-price,
.asm-qd-cart-subtotal {
    display: block;
    line-height: 1.3;
}

.asm-qd-cart-price del,
.asm-qd-cart-subtotal del {
    display: block;
    font-size: 0.85em;
    font-weight: 400;
    opacity: 0.5;
}

.asm-qd-cart-price ins,
.asm-qd-cart-subtotal ins {
    display: block;
    text-decoration: none;
    font-weight: 700;
    color: #2d8a4e;
}

/* ─── Responsive ─── */

@media (max-width: 600px) {
    .asm-qd-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .asm-qd-layout-table .asm-qd-table th,
    .asm-qd-layout-table .asm-qd-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    .asm-qd-cards {
        grid-template-columns: 1fr;
    }
    .asm-qd-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}
