/* Picieffe Sync — Product Table v1.2 */

.psync-product-table-wrap { margin: 20px 0; overflow-x: auto; }

/* Notifica carrello */
.psync-cart-notice {
    background: #e8f5e9; border: 1px solid #a5d6a7; border-radius: 4px;
    padding: 10px 16px; margin-bottom: 12px; font-size: 13px;
    display: flex; align-items: center; gap: 12px;
}
.psync-cart-notice a { color: #2e7d32; font-weight: 600; text-decoration: underline; }
.psync-hidden { display: none !important; }

/* ── TABELLA DESKTOP ───────────────────────────────── */
.psync-product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    font-family: inherit;
}
.psync-product-table thead tr {
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}
.psync-product-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}
.psync-product-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.psync-product-table tbody tr:hover { background: #fafafa; }
.psync-product-table tbody tr:last-child td { border-bottom: none; }

/* Larghezze colonne */
.psync-col-sku        { width: 120px; }
.psync-col-unita      { width: 70px;  text-align: center; }
.psync-col-stock      { width: 90px;  text-align: center; }
.psync-col-prezzo     { width: 110px; text-align: right; white-space: nowrap; }
.psync-col-acquista   { width: 190px; }

/* SKU */
.psync-sku {
    font-family: monospace; font-size: 11px;
    background: #f0f0f0; padding: 2px 6px;
    border-radius: 3px; color: #333;
    display: inline-block; word-break: break-all;
}

/* Stock */
.psync-stock { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 12px; white-space: nowrap; }
.psync-stock--in   { background: #e8f5e9; color: #2e7d32; }
.psync-stock--back { background: #fff8e1; color: #f57f17; }
.psync-stock--out  { background: #fce4ec; color: #c62828; }

/* Prezzo */
.psync-col-prezzo .price  { font-weight: 700; color: #333; }
.psync-col-prezzo .amount { font-size: 14px; }

/* Add to cart */
.psync-add-wrap { display: flex; align-items: center; gap: 6px; }
.psync-qty {
    width: 52px !important; padding: 6px 4px !important;
    border: 1px solid #ddd !important; border-radius: 4px !important;
    text-align: center; font-size: 13px !important;
    -moz-appearance: textfield;
}
.psync-qty::-webkit-outer-spin-button,
.psync-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.psync-add-to-cart {
    background: #e8750a !important; color: #fff !important;
    border: none !important; border-radius: 4px !important;
    padding: 7px 14px !important; font-size: 12px !important;
    font-weight: 700 !important; cursor: pointer;
    white-space: nowrap; text-transform: uppercase;
    letter-spacing: .5px; transition: filter .15s;
    flex-shrink: 0;
}
.psync-add-to-cart:hover    { filter: brightness(.88); }
.psync-add-to-cart:disabled { opacity: .6; cursor: not-allowed; }
.psync-add-to-cart.added    { background: #2e7d32 !important; }
.psync-unavailable { color: #aaa; font-size: 12px; }

/* ── MOBILE: layout a card sotto i 680px ───────────── */
@media (max-width: 680px) {

    .psync-product-table thead { display: none; }

    .psync-product-table,
    .psync-product-table tbody,
    .psync-product-table tr,
    .psync-product-table td { display: block; width: 100%; }

    .psync-product-table tbody tr {
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 12px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,.06);
    }

    .psync-product-table td {
        padding: 4px 0;
        border-bottom: none;
        text-align: left;
        font-size: 13px;
    }

    /* Etichetta inline prima del valore */
    .psync-product-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .4px;
        color: #888;
        display: inline-block;
        min-width: 100px;
        margin-right: 6px;
    }

    /* Colonne che non hanno etichetta visibile su mobile */
    .psync-col-acquista::before { display: none; }
    .psync-col-sku::before      { display: none; }

    /* SKU in testa alla card */
    .psync-col-sku {
        margin-bottom: 6px;
        padding-bottom: 6px !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    .psync-col-sku .psync-sku { font-size: 12px; padding: 3px 8px; }

    /* Add to cart full width */
    .psync-col-acquista { margin-top: 8px; }
    .psync-add-wrap     { width: 100%; }
    .psync-qty          { width: 64px !important; font-size: 15px !important; padding: 8px !important; }
    .psync-add-to-cart  {
        flex: 1;
        font-size: 14px !important;
        padding: 10px 16px !important;
        text-align: center;
    }

    /* Stock */
    .psync-col-stock { display: flex; align-items: center; }

    /* Prezzo */
    .psync-col-prezzo { font-size: 15px; font-weight: 700; }
    .psync-col-prezzo .amount { font-size: 15px !important; }
}
