.sco-category-block {
    margin: 1.5rem 0;
}

.sco-category-title {
    margin: 0 0 1rem;
}

/* Il contenitore non crea mai uno scroll orizzontale. */
.sco-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.sco-product-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
}

.sco-product-table th,
.sco-product-table td {
    padding: .75rem;
    border: 1px solid rgba(0, 0, 0, .14);
    text-align: left;
    vertical-align: middle;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Prima riga / intestazione richiesta. */
.sco-product-table thead th {
    font-weight: 700;
    background: #069991;
    color: #fff;
}


.sco-qty-heading,
.sco-qty-cell {
    width: 150px;
    text-align: center !important;
}

.sco-qty-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.sco-qty-button {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.sco-qty-button:hover,
.sco-qty-button:focus-visible {
    background: rgba(0, 0, 0, .08);
}

.sco-qty-input {
    width: 58px;
    height: 38px;
    padding: 0 .25rem;
    border: 0;
    border-left: 1px solid rgba(0, 0, 0, .14);
    border-right: 1px solid rgba(0, 0, 0, .14);
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

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

.sco-cart-bar {
    position: fixed;
    z-index: 99990;
    left: 50%;
    bottom: 18px;
    width: min(720px, calc(100% - 28px));
    transform: translate(-50%, calc(100% + 50px));
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
}

.sco-cart-bar.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.sco-cart-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border-radius: 16px;
    background: #069991;
    color: #fff;
    box-shadow: 0 18px 55px rgba(0, 0, 0, .28);
}

.sco-cart-bar.is-pulse .sco-cart-bar-inner {
    animation: scoPulse .35s ease;
}

@keyframes scoPulse {
    50% { transform: scale(1.025); }
}

.sco-complete-order,
.sco-submit-order {
    border: 0;
    border-radius: 999px;
    padding: .75rem 1rem;
    font-weight: 700;
    cursor: pointer;
}

.sco-complete-order {
    background: #fff;
    color: #111;
}

.sco-modal {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sco-modal.is-open {
    display: flex;
}

.sco-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .62);
}

.sco-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    max-height: min(90vh, 820px);
    overflow: auto;
    padding: 1.5rem;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

.sco-modal-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .08);
    cursor: pointer;
    font-size: 1.5rem;
}

.sco-checkout-list {
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(0, 0, 0, .12);
}

.sco-checkout-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, .12);
}

.sco-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.sco-form-grid label {
    display: grid;
    gap: .35rem;
    font-weight: 600;
}

.sco-form-grid input {
    width: 100%;
    box-sizing: border-box;
    padding: .8rem .9rem;
    border: 1px solid rgba(0, 0, 0, .25);
    border-radius: 10px;
    font: inherit;
}

.sco-submit-order {
    width: 100%;
    margin-top: 1rem;
    background: #171717;
    color: #fff;
}

.sco-submit-order:disabled {
    opacity: .6;
    cursor: wait;
}

.sco-form-message {
    min-height: 1.5em;
    margin-top: .85rem;
    font-weight: 600;
}

.sco-form-message.is-success {
    color: #0a6d2a;
}

.sco-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.sco-modal-open {
    overflow: hidden;
}

.sco-notice {
    padding: .9rem 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, .055);
}

.sco-notice-error {
    border-left: 4px solid #b42318;
}

/*
 * Responsive senza scroll orizzontale:
 * ogni riga della tabella diventa una scheda e ogni cella mostra la propria etichetta.
 */
@media (max-width: 820px) {
    .sco-product-table,
    .sco-product-table tbody,
    .sco-product-table tr,
    .sco-product-table th,
    .sco-product-table td {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .sco-product-table {
        border: 0;
    }

    .sco-product-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .sco-product-table tbody {
        display: grid;
        gap: 1rem;
    }

    .sco-product-table tbody tr {
        overflow: hidden;
        border: 1px solid rgba(0, 0, 0, .14);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 5px 18px rgba(0, 0, 0, .06);
    }

    .sco-product-table tbody th,
    .sco-product-table tbody td {
        display: grid;
        grid-template-columns: minmax(95px, 36%) minmax(0, 1fr);
        gap: .75rem;
        align-items: start;
        padding: .72rem .85rem;
        border: 0;
        border-bottom: 1px solid rgba(0, 0, 0, .1);
        text-align: left !important;
        min-width: 0;
    }

    .sco-product-table tbody th::before,
    .sco-product-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #3b3b3b;
    }


    .sco-product-table tbody .sco-qty-cell {
        grid-template-columns: minmax(95px, 36%) minmax(0, 1fr);
        align-items: center;
        width: 100%;
        border-bottom: 0;
    }

    .sco-qty-control {
        justify-self: start;
    }
}

@media (max-width: 480px) {
    .sco-product-table tbody th,
    .sco-product-table tbody td,
    .sco-product-table tbody .sco-qty-cell {
        grid-template-columns: 1fr;
        gap: .35rem;
    }

    .sco-product-table tbody th::before,
    .sco-product-table tbody td::before {
        font-size: .82em;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: #616161;
    }


    .sco-form-grid {
        grid-template-columns: 1fr;
    }

    .sco-cart-bar-inner {
        align-items: stretch;
        flex-direction: column;
    }

    .sco-complete-order {
        width: 100%;
    }
}
