/* TableCombz — Fardamento Edition
 * Melhorias visuais e de usabilidade sem alterar a lógica de compra.
 */

:root {
    --fardamento-orange: #e67525;
    --fardamento-yellow: #fdb813;
    --fardamento-black: #000000;
    --fardamento-border: #dedede;
    --fardamento-soft: #f7f7f7;
}

.tablecombz-heading {
    margin: 0 0 1rem;
}

.tablecombz-heading h3 {
    margin: 0 0 .35rem;
    color: var(--fardamento-black);
    font-size: 1.25rem;
    font-weight: 700;
}

.tablecombz-heading p {
    margin: 0;
    color: #555;
    line-height: 1.45;
}

.tablecombz-scroll-hint {
    display: none;
    margin-top: .4rem !important;
    color: #666 !important;
    font-size: .875rem;
}

.tablecombz-scroll-container {
    position: relative;
    width: 100%;
    max-height: 560px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--fardamento-border);
    border-radius: 6px;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

.tablecombz-scroll-container:focus {
    outline: 2px solid var(--fardamento-orange);
    outline-offset: 2px;
}

.tablecombz-table {
    width: max-content;
    min-width: 100%;
    margin: 0 !important;
    border: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
}

.tablecombz-table tr th {
    width: 130px !important;
    min-width: 130px;
}

.tablecombz-table td,
.tablecombz-table th {
    vertical-align: top !important;
    border-color: var(--fardamento-border) !important;
}

.tablecombz-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--fardamento-black) !important;
    color: #fff !important;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 1px 0 rgba(255,255,255,.15);
}

.tablecombz-table tbody > tr > td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 150px;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0,0,0,.06);
}

.tablecombz-table tbody > tr:nth-child(even) > td:first-child {
    background: var(--fardamento-soft);
}

.tablecombz-table tbody > tr:hover > td {
    background-color: #fff9f3;
}

.tablecombz-table tbody > tr:hover > td:first-child {
    background-color: #fff3e7;
}

.tablecombz-quantity-wanted .qty .quantity-input-group {
    width: auto !important;
    display: block !important;
    text-align: left !important;
}

.tablecombz-quantity-wanted .qty,
.tablecombz-grid .input-quantity-wanted {
    width: 100% !important;
}

.tablecombz-grid .input-quantity-wanted {
    min-width: 64px;
    min-height: 42px;
    padding: .5rem;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    background: #fff;
    color: var(--fardamento-black);
    font-size: 1rem;
    font-weight: 700;
    text-align: center !important;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.tablecombz-grid .input-quantity-wanted:hover {
    border-color: var(--fardamento-orange);
}

.tablecombz-grid .input-quantity-wanted:focus {
    border-color: var(--fardamento-orange);
    outline: 0;
    background: #fffaf6;
    box-shadow: 0 0 0 3px rgba(230, 117, 37, .18);
}

.tablecombz-quantity-wanted .qty .tablecombz-quantity {
    margin: 0;
    padding-top: 6px;
    font-size: 10px;
    font-weight: 700;
}

.tablecombz-quantity,
.tablecombz-price {
    text-align: left !important;
}

.tablecombz-quantity,
.tablecombz-price .price-initial {
    margin-bottom: 6px;
    font-weight: 700;
}

.tablecombz-discount .discount-quantity {
    font-size: smaller;
    font-style: italic;
    font-weight: 700;
}

.tablecombz-table .total {
    background: #fff7ef !important;
    color: var(--fardamento-black);
    font-size: 1.05rem;
    font-weight: 700;
}

.tablecombz-table .total > span {
    color: var(--fardamento-orange);
    font-size: 1.2rem;
}

.tablecombz-table .total .note {
    margin-top: .35rem;
    color: #555;
    font-size: .82rem;
    font-weight: 400;
}

/* Resumo do pedido e compra em lote */
.tablecombz-batch-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--fardamento-border);
    border-radius: 6px;
    background: #fff;
}

.tablecombz-order-summary {
    flex: 1 1 auto;
    min-width: 220px;
}

.tablecombz-order-total {
    display: flex;
    align-items: baseline;
    gap: .65rem;
}

.tablecombz-order-total-label {
    color: #333;
    font-size: .95rem;
    font-weight: 700;
}

.tablecombz-order-total-value {
    color: var(--fardamento-orange);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.1;
}

.tablecombz-order-tax-note {
    margin-top: .3rem;
    color: #666;
    font-size: .78rem;
    line-height: 1.35;
}

.tablecombz-batch-controls {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .75rem;
}

.tablecombz-batch-message {
    max-width: 340px;
    min-height: 1.5em;
    margin: 0;
    color: #333;
    font-size: .9rem;
}

.tablecombz-batch-message:empty {
    display: none;
}

.tablecombz-batch-message.is-error {
    display: block;
    color: #b00020;
    font-weight: 600;
}

.min-qty-label {
    margin-top: 5px;
    color: #555;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
}

.tablecombz-batch-submit {
    min-height: 46px;
    padding: .75rem 1.35rem !important;
    border-color: var(--fardamento-orange) !important;
    border-radius: 4px;
    background: var(--fardamento-orange) !important;
    color: #fff !important;
    font-weight: 700;
    white-space: nowrap;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease, opacity .15s ease;
}

.tablecombz-batch-submit:hover,
.tablecombz-batch-submit:focus {
    border-color: var(--fardamento-yellow) !important;
    background: var(--fardamento-yellow) !important;
    color: var(--fardamento-black) !important;
}

.tablecombz-batch-submit:active {
    transform: translateY(1px);
}

.tablecombz-batch-submit.is-loading {
    cursor: wait;
    opacity: .78;
    pointer-events: none;
}

.tablecombz-batch-submit.is-loading::after {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: .55rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -.15em;
    content: '';
    animation: tablecombz-spin .7s linear infinite;
}

@keyframes tablecombz-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .tablecombz-scroll-container {
        max-height: 65vh;
    }

    .tablecombz-scroll-hint {
        display: block;
    }

    .tablecombz-table tr th {
        width: 112px !important;
        min-width: 112px;
    }

    .tablecombz-table tbody > tr > td:first-child {
        min-width: 132px;
    }

    .tablecombz-grid .input-quantity-wanted {
        min-width: 58px;
        min-height: 44px;
        font-size: 16px;
    }

    .tablecombz-batch-actions {
        position: relative;
        flex-direction: column;
        align-items: stretch;
        gap: .85rem;
        padding: .9rem;
    }

    .tablecombz-order-total {
        justify-content: space-between;
    }

    .tablecombz-order-total-value {
        font-size: 1.35rem;
    }

    .tablecombz-batch-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .tablecombz-batch-message,
    .tablecombz-batch-submit {
        width: 100%;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tablecombz-grid .input-quantity-wanted,
    .tablecombz-batch-submit {
        transition: none;
    }

    .tablecombz-batch-submit.is-loading::after {
        animation-duration: 1.4s;
    }
}


/* UX Sprint Final */
.tablecombz-grid input[type=number]{min-height:38px;padding:4px 6px;font-size:15px}
.tablecombz-grid .tc-minimum,
.tablecombz-grid .minimum-qty{font-size:.92rem;color:#666;font-weight:500}
.tablecombz-grid .price{margin-top:8px}
.tablecombz-summary{padding:16px 20px;border-radius:10px}
.tablecombz-summary .subtotal-value{font-size:1.45rem;font-weight:700}
.tablecombz-grid th:first-child::after{content:"Cor";font-weight:600}
@media (max-width:768px){
.tablecombz-grid td:first-child{padding:6px!important;line-height:1.2}
.tablecombz-grid .color-block,.tablecombz-grid .product-meta{margin:0}
.tablecombz-grid tr{min-height:56px}
.tablecombz-summary{padding:14px}
}

/* UX Mobile Compact — Fardamento Edition */
.tablecombz-color-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.tablecombz-color-main .attr-color-picker {
    flex: 0 0 auto;
    margin: 0 !important;
}

.tablecombz-color-caption {
    line-height: 1.25;
}

.tablecombz-color-reference {
    margin-top: 5px;
    line-height: 1.25;
}

@media (max-width: 767px) {
    .tablecombz-table tbody > tr > td:first-child {
        min-width: 148px;
        width: 148px;
        padding: 10px 8px !important;
        vertical-align: middle !important;
        font-size: 14px;
        line-height: 1.2;
        text-align: left;
    }

    .tablecombz-color-main {
        justify-content: flex-start;
        gap: 6px;
    }

    .tablecombz-color-main .attr-color-picker {
        width: 22px !important;
        height: 22px !important;
    }

    .tablecombz-color-caption {
        min-width: 0;
        font-size: 14px;
        font-weight: 600;
        overflow-wrap: normal;
        word-break: normal;
    }

    .tablecombz-color-reference {
        margin-top: 4px;
        font-size: 12px;
        white-space: nowrap;
        letter-spacing: -.1px;
    }

    .tablecombz-quantity-wanted {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        vertical-align: middle !important;
    }

    .tablecombz-grid .input-quantity-wanted {
        min-height: 42px;
        padding: 5px 6px;
    }

    .tablecombz-price {
        margin-top: 4px !important;
    }

    .tablecombz-price .price-initial {
        margin-bottom: 3px;
        line-height: 1.15;
    }

    .tablecombz-table .min-qty-label {
        margin-top: 3px;
        font-size: 12px;
        line-height: 1.2;
        white-space: nowrap;
    }
}
