/* ============================================================
   FRONTEND — Lippi Products shortcode
   ============================================================ */

.lippi-wrapper {
    margin: 30px 0;
}

/* Gruppo per categoria */
.lippi-group {
    margin-bottom: 36px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.09);
}

/* Intestazione categoria */
.lippi-group-title {
    background-color: var(--e-global-color-primary, #8c1437);
    color: var(--e-global-color-b904d09, #ffffff) !important;
    padding: 13px 20px;
    margin: 0;
    font-size: 0.85em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Tabella */
.lippi-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    table-layout: fixed;
}

/* Larghezze colonne desktop: 40% / 20% / 20% / 20% */
.lippi-table th.col-cod      { width: 40%; }
.lippi-table th.col-prodotto { width: 20%; }
.lippi-table th.col-prezzo   { width: 20%; }
.lippi-table th.col-listino  { width: 20%; }

.lippi-table thead th {
    padding: 10px 20px;
    background: #f7f7f7;
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    border-bottom: 2px solid #e8e8e8;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lippi-table thead th.col-prezzo,
.lippi-table thead th.col-listino {
    text-align: right;
}

/* Righe dati */
.lippi-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s ease;
}

.lippi-table tbody tr:last-child {
    border-bottom: none;
}

.lippi-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.lippi-table tbody tr:hover {
    background: #f3f3f3;
}

/* Celle dati */
.lippi-table td {
    padding: 12px 20px;
    font-size: 0.95em;
    line-height: 1.45;
    vertical-align: middle;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Colonna prezzo club — destra, in evidenza */
.lippi-table td.col-prezzo {
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
    color: var(--e-global-color-primary, #8c1437);
}

/* Colonna prezzo listino — destra, attenuata */
.lippi-table td.col-listino {
    text-align: right;
    white-space: nowrap;
    color: #999;
    font-size: 0.88em;
}

/* ============================================================
   RESPONSIVE — mobile (≤ 600px)
   Layout a card: ogni riga diventa un blocco verticale
   ============================================================ */
@media screen and (max-width: 600px) {

    .lippi-group {
        border-radius: 4px;
    }

    /* Nascondi intestazioni colonne */
    .lippi-table thead {
        display: none;
    }

    .lippi-table tbody tr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
    }

    .lippi-table td {
        display: block;
        padding: 0;
        border: none;
        overflow: visible;
        text-overflow: clip;
    }

    /* Colonna E (prima) — occupa lo spazio disponibile */
    .lippi-table td.col-cod {
        flex: 1;
        font-size: 0.9em;
        text-align: left;
        white-space: normal;
    }

    /* Prodotto — nascosto su mobile (col E è il descrittore principale) */
    .lippi-table td.col-prodotto {
        display: none;
    }

    /* Prezzo club */
    .lippi-table td.col-prezzo {
        flex-shrink: 0;
        text-align: right;
        font-size: 1em;
    }

    /* Prezzo listino — nascosto su mobile */
    .lippi-table td.col-listino {
        display: none;
    }
}

/* ============================================================
   ADMIN — pagina impostazioni plugin
   ============================================================ */

#test-result {
    font-weight: 600;
}

.debug-log {
    background: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 14px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
