/* TK Vetrina Federata — Wishlist & Compare CSS v1.4.0 */

/* ================================================================
   OVERLAY
================================================================ */
.tkv-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9998;
    backdrop-filter: blur(2px);
}
.tkv-overlay.aperto { display: block; }

/* ================================================================
   PANEL BASE (wishlist e compare)
================================================================ */
.tkv-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 460px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0,0,0,.15);
    transition: right .3s ease;
    border-radius: 0;
	z-index: 99999;
}
.tkv-panel.aperto { right: 0; }

.tkv-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--global-palette1, #1a1a1a);
    color: var(--global-palette-btn, #fff);
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}
.tkv-panel-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: .8;
    transition: opacity .15s;
}
.tkv-panel-close:hover { opacity: 1; }

.tkv-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.tkv-panel-vuoto {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

/* ================================================================
   WISHLIST — righe prodotto
================================================================ */
.tkv-wl-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.tkv-wl-item:last-child { border-bottom: none; }

.tkv-wl-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #f5f5f5;
}

.tkv-wl-info {
    flex: 1;
    min-width: 0;
}
.tkv-wl-nome {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
}
.tkv-wl-nome:hover { color: #2e4057; }
.tkv-wl-sito {
    font-size: 11px;
    color: #888;
    margin: 2px 0;
}
.tkv-wl-prezzo {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
}
.tkv-wl-prezzo del { color: #aaa; font-size: 11px; margin-right: 4px; }
.tkv-wl-prezzo ins { text-decoration: none; }

.tkv-wl-remove {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    line-height: 1;
}
.tkv-wl-remove:hover { background: #d63638; color: #fff; border-color: #d63638; }

/* ================================================================
   COMPARE — tabella attributi
================================================================ */
.tkv-cp-panel { width: 90vw; max-width: 900px; right: -92vw; }
.tkv-cp-panel.aperto { right: 0; }

.tkv-cp-table-wrap {
    overflow-x: auto;
}

.tkv-cp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 400px;
}
.tkv-cp-table th,
.tkv-cp-table td {
    padding: 10px 12px;
    border: 1px solid #eee;
    vertical-align: top;
    text-align: left;
}
.tkv-cp-table th {
    background: #f6f7f7;
    font-weight: 600;
    color: #3c434a;
    width: 110px;
}
.tkv-cp-table td { background: #fff; }

/* Riga immagine */
.tkv-cp-img-row td { text-align: center; padding: 14px 8px; }
.tkv-cp-img-row img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
}
.tkv-cp-img-row .tkv-cp-nome {
    font-size: 12px;
    font-weight: 700;
    margin-top: 6px;
    color: #1a1a1a;
    text-decoration: none;
    display: block;
    line-height: 1.3;
}
.tkv-cp-img-row .tkv-cp-sito {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}
.tkv-cp-img-row .tkv-cp-rimuovi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 3px 10px;
    transition: background .15s, color .15s;
    text-decoration: none;
    gap: 4px;
}
.tkv-cp-img-row .tkv-cp-rimuovi:hover { background: #d63638; color: #fff; border-color: #d63638; }

/* Riga prezzo */
.tkv-cp-prezzo del { color: #aaa; font-size: 11px; display: block; }
.tkv-cp-prezzo ins { text-decoration: none; font-weight: 700; }

/* Stelle mini */
.tkv-cp-stars { color: #f5a623; font-size: 13px; letter-spacing: 1px; }
.tkv-cp-stars-vuoto { color: #e0e0e0; }

/* Badge sito */
.tkv-cp-badge-sito {
    display: inline-block;
    background: #f0f4ff;
    color: #2e4057;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
}

/* ================================================================
   BOTTONI TRIGGER nella vetrina
================================================================ */
.tkv-btn-wl,
.tkv-btn-cp {
    /* usano le stesse classi CSS dei bottoni azione card */
}

/* Stato "aggiunto" dei bottoni card: gestito in vetrina.css
   (cerchio bianco + icona colorata). Qui NON si stampa piu la
   pseudo-emoji ::before che causava il doppio cuore. */

/* Icona SVG nelle intestazioni dei pannelli */
.tkv-panel-title { display: inline-flex; align-items: center; gap: 8px; }
.tkv-panel-ico { flex-shrink: 0; }

/* ================================================================
   TRIGGER COMPARE FISSO (stesso stile wishlist, sotto di essa)
================================================================ */
#tkv-cp-trigger {
    position: fixed;
    top: calc(50% + 70px);
    right: 0;
    background: #2e4057;
    color: #fff;
    border: none;
    padding: 12px 8px;
    border-radius: 6px 0 0 6px;
    cursor: pointer;
    z-index: 9990;
    font-size: 18px;
    line-height: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: background .15s;
}
#tkv-cp-trigger:hover { background: #1a1a1a; }
#tkv-cp-trigger .tkv-cp-badge {
    font-size: 11px;
    font-weight: 700;
    background: #d63638;
    color: #fff;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
#tkv-cp-trigger .tkv-cp-badge.visibile { display: flex; }

/* ================================================================
   TRIGGER FISSI — WISHLIST (sopra) e COMPARE (sotto), 5px gap
   Gestisce wp-admin-bar (32px) e mobile (46px)
================================================================ */
#tkv-wl-trigger,
#tkv-cp-trigger {
    position: fixed;
    right: 0;
    border: none;
    padding: 10px 8px;
    border-radius: 6px 0 0 6px;
    cursor: pointer;
    z-index: 9990;
    line-height: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: background .15s;
}

/* Wishlist: sopra il centro */
#tkv-wl-trigger {
    bottom: calc(50% + 3px);
    background: var(--global-palette-btn-bg, #2e4057);
    color: var(--global-palette-btn, #fff);
}
#tkv-wl-trigger:hover { background: var(--global-palette1, #1a1a1a); }

/* Compare: sotto il centro */
#tkv-cp-trigger {
    top: calc(50% + 3px);
    background: var(--global-palette-btn-bg, #2e4057);
    color: var(--global-palette-btn, #fff);
}
#tkv-cp-trigger:hover { background: var(--global-palette1, #1a1a1a); }

/* Compenso admin bar desktop (32px) */
.admin-bar #tkv-wl-trigger { bottom: calc(50% + 3px - 16px); }
.admin-bar #tkv-cp-trigger  { top:    calc(50% + 3px + 16px); }

/* Admin bar mobile (46px) */
@media screen and (max-width: 782px) {
    .admin-bar #tkv-wl-trigger { bottom: calc(50% + 3px - 23px); }
    .admin-bar #tkv-cp-trigger  { top:    calc(50% + 3px + 23px); }
}

/* Badge contatore */
#tkv-wl-trigger .tkv-wl-badge,
#tkv-cp-trigger .tkv-cp-badge {
    font-size: 11px;
    font-weight: 700;
    background: #d63638;
    color: #fff;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
#tkv-wl-trigger .tkv-wl-badge.visibile { display: flex; }
#tkv-cp-trigger .tkv-cp-badge.visibile { display: flex; }
