/*
Theme Name: Tecnoshop Tech
Theme URI: https://tecnoshopsrl.it
Author: Ing. Claudio Lombardo
Description: Tema e-commerce retail completo con Mega Menu grafico, video player, dendrogramma a 5 livelli e pannello carrello.
Version: 6.0.0
Text Domain: tecnoshop-tech
*/

:root {
    --ts-yellow: #FFC107;
    --ts-yellow-hover: #e0a800;
    --ts-dark: #1e242d;
    --ts-gray-bg: #f8fafc;
    --ts-border: #e2e8f0;
    --ts-text: #334155;
    --ts-text-muted: #64748b;
    --ts-radius: 12px;
    --ts-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    --ts-shadow-hover: 0 20px 30px -10px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--ts-gray-bg);
    color: var(--ts-text);
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; transition: all 0.2s ease; }
ul { list-style: none; padding: 0; margin: 0; }

/* --- 1. TOP ANNOUNCEMENT BAR --- */
.top-announcement {
    background: var(--ts-dark);
    color: #fff;
    font-size: 0.85rem;
    padding: 8px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--ts-yellow);
}
.top-announcement a { color: var(--ts-yellow); font-weight: 700; }
.top-announcement a:hover { color: #fff; }
.top-contact-info { display: flex; gap: 20px; align-items: center; }

/* --- 2. MAIN HEADER --- */
.site-header {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}
.brand-logo a {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--ts-dark);
}
.brand-logo a span { color: var(--ts-yellow); }

/* Barra Ricerca */
.retail-search { flex: 1; max-width: 650px; }
.retail-search form {
    display: flex;
    border: 2px solid var(--ts-dark);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s;
}
.retail-search form:focus-within {
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3);
    border-color: var(--ts-yellow);
}
.retail-search input {
    flex: 1;
    border: none;
    padding: 12px 18px;
    font-size: 0.95rem;
    outline: none;
}
.retail-search button {
    background: var(--ts-yellow);
    border: none;
    padding: 0 25px;
    cursor: pointer;
    font-weight: 800;
    color: var(--ts-dark);
    transition: background 0.2s;
}
.retail-search button:hover { background: var(--ts-yellow-hover); }

/* Icone Utente - RESET TOTALE BORDI BRUTTI */
.user-actions { display: flex; gap: 15px; align-items: center; }
.action-item {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px;
    color: var(--ts-text) !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    cursor: pointer;
    padding: 8px 12px !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.action-item i {
    font-size: 1.4rem;
    color: var(--ts-dark);
    transition: all 0.2s ease;
}
.action-item:hover {
    background: #f1f5f9 !important;
}
.action-item:hover i {
    color: var(--ts-yellow);
    transform: translateY(-2px);
}

/* --- 3. NAVBAR E MEGA MENU VISIVO --- */
.main-nav-bar {
    background: #ffffff;
    border-top: 1px solid var(--ts-border);
    position: relative;
}
.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 25px;
}
.nav-container > ul {
    display: flex;
    gap: 30px;
    align-items: center;
}
.nav-container > ul > li > a {
    display: inline-block;
    padding: 16px 0;
    font-weight: 800;
    font-size: 0.95rem;
    text-transform: uppercase;
    color: var(--ts-dark);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.nav-container > ul > li:hover > a {
    color: var(--ts-yellow-hover);
    border-bottom-color: var(--ts-yellow);
}

/* Mega Menu Full Width */
.has-mega-menu { position: static; }
.mega-dropdown-panel {
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    background: #fff;
    box-shadow: 0 25px 50px rgba(0,0,0,0.12);
    border-top: 3px solid var(--ts-yellow);
    padding: 40px 25px;
    display: none;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.has-mega-menu:hover .mega-dropdown-panel {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.mega-visual-grid {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}
.mega-visual-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    border-radius: var(--ts-radius);
    background: var(--ts-gray-bg);
    border: 1px solid var(--ts-border);
    transition: all 0.3s ease;
}
.mega-visual-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--ts-shadow-hover);
    border-color: var(--ts-yellow);
    background: #fff;
}
.mega-visual-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mega-visual-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.mega-visual-card:hover .mega-visual-img img { transform: scale(1.15); }
.mega-visual-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--ts-dark);
    line-height: 1.2;
}

/* --- 4. HOMEPAGE: TRUST BADGES & VIDEO --- */
.trust-badges-bar {
    max-width: 1440px;
    margin: 30px auto;
    padding: 0 25px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.trust-card {
    background: #fff;
    padding: 20px;
    border-radius: var(--ts-radius);
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--ts-shadow);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}
.trust-card:hover {
    transform: translateY(-4px);
    border-bottom-color: var(--ts-yellow);
    box-shadow: var(--ts-shadow-hover);
}
.trust-card .t-icon { font-size: 2rem; color: var(--ts-yellow); }
.trust-card h5 { font-size: 0.95rem; font-weight: 800; color: var(--ts-dark); margin-bottom: 4px; }
.trust-card p { font-size: 0.8rem; color: var(--ts-text-muted); margin: 0; }

.company-video-section {
    background: #ffffff;
    padding: 60px 25px;
    margin: 50px 0;
    border-top: 1px solid var(--ts-border);
    border-bottom: 1px solid var(--ts-border);
}
.video-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
    align-items: center;
}
.video-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    margin-bottom: 15px;
}
.video-text-content h2 {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--ts-dark);
    line-height: 1.2;
    margin-bottom: 20px;
}
.video-features-list { display: flex; flex-direction: column; gap: 10px; margin: 25px 0; }
.video-features-list li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.95rem; }
.video-features-list li::before {
    content: "✓";
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    background: var(--ts-yellow);
    color: var(--ts-dark);
    border-radius: 50%;
    font-weight: 900;
}
.video-player-frame {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    background: #000;
    aspect-ratio: 16 / 9;
}
.video-player-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Banner Community WhatsApp VIP */
.whatsapp-club-section { max-width: 1440px; margin: 50px auto; padding: 0 25px; }
.whatsapp-banner-card {
    background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
    color: #fff;
    border-radius: 20px;
    padding: 45px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
    box-shadow: 0 20px 35px rgba(18, 140, 126, 0.25);
}
.whatsapp-banner-card .wen-optin-box {
    background: #ffffff !important;
    color: var(--ts-dark) !important;
    border-radius: 14px !important;
    padding: 30px !important;
    border: none !important;
    margin: 0 !important;
    max-width: 100% !important;
}

/* --- 5. SHOP: DENDROGRAMMA A 5 LIVELLI & CAROSELLO --- */
.ts-retail-shop-wrap {
    max-width: 1500px;
    margin: 30px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}
.ts-retail-sidebar {
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--ts-shadow);
    border: 1px solid #f1f5f9;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
}
.ts-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 20px;
}
.ts-category-tree ul { list-style: none; padding: 0; margin: 0; }
.ts-acc-item { border-bottom: 1px solid #f8fafc; }
.ts-acc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}
.ts-acc-header a {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    flex: 1;
    display: flex;
    justify-content: space-between;
}
.ts-acc-header a:hover { color: var(--ts-yellow-hover); }
.ts-count { font-size: 0.8rem; color: #94a3b8; }
.ts-acc-toggle {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}
.ts-acc-toggle:hover {
    background: var(--ts-yellow);
    color: #fff;
    border-color: var(--ts-yellow);
}
.ts-acc-content {
    border-left: 2px solid #e2e8f0;
    padding-left: 15px;
    margin-left: 6px;
    margin-bottom: 10px;
    margin-top: 5px;
}

/* Carosello Sottocategorie Visivo (Stile Leroy Merlin) */
.ts-visual-subcats-wrapper {
    background: #f0f8f1;
    border: 1px solid #d1e8d5;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}
.ts-subcat-title { font-size: 1.2rem; font-weight: 900; color: var(--ts-dark); margin-bottom: 15px; }
.ts-visual-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
}
.ts-v-card {
    flex: 0 0 240px;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--ts-border);
    transition: all 0.3s;
}
.ts-v-card:hover {
    border-color: var(--ts-yellow);
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
}
.ts-v-img { width: 80px; height: 80px; flex-shrink: 0; background: #fff; }
.ts-v-img img { width: 100%; height: 100%; object-fit: cover; }
.ts-v-txt { padding: 12px; font-weight: 700; font-size: 0.9rem; color: var(--ts-dark); }

/* Barra Filtri a Pillola */
.ts-toolbar-pills {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--ts-border);
    margin-bottom: 30px;
}
.woocommerce-ordering select {
    appearance: none;
    background: #fff;
    border: 1px solid var(--ts-text-muted);
    padding: 8px 35px 8px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

/* --- 6. PAGINA PRODOTTO INTERATTIVA --- */
.ts-brand-badge { margin-bottom: 15px; }
.brand-logo-img { max-height: 55px; filter: grayscale(100%); opacity: 0.65; transition: all 0.3s; }
.brand-logo-img:hover { filter: grayscale(0%); opacity: 1; }
.brand-name-text { font-size: 1.1rem; font-weight: 800; color: #64748b; text-transform: uppercase; }

.ts-logged-in-price-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e0f2fe;
    color: #0369a1;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.woocommerce-tabs ul.tabs {
    padding: 0 !important;
    margin: 0 0 25px 0 !important;
    border-bottom: 2px solid #e2e8f0 !important;
    display: flex;
    gap: 30px;
}
.woocommerce-tabs ul.tabs::before { display: none !important; }
.woocommerce-tabs ul.tabs li {
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.woocommerce-tabs ul.tabs li a {
    padding: 12px 0 !important;
    font-weight: 700 !important;
    color: #64748b !important;
    border-bottom: 3px solid transparent !important;
    text-transform: uppercase;
}
.woocommerce-tabs ul.tabs li.active a {
    color: #0f172a !important;
    border-bottom-color: var(--ts-yellow) !important;
}

.ts-tech-sheet-wrapper {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
}
.ts-tech-table { width: 100%; border-collapse: collapse; margin-bottom: 25px; }
.ts-tech-table th {
    text-align: left;
    padding: 12px 0;
    border-bottom: 1px dotted #cbd5e1;
    width: 40%;
    color: #334155;
    font-weight: 600;
}
.ts-tech-table th i { color: var(--ts-yellow); width: 25px; }
.ts-tech-table td { padding: 12px 0; border-bottom: 1px dotted #cbd5e1; color: #0f172a; font-weight: 600; }
.ts-btn-download {
    background: #0f172a;
    color: #fff;
    border: none;
    padding: 14px 25px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.ts-btn-download:hover {
    background: var(--ts-yellow);
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,193,7,0.3);
}

/* --- 7. SMART RIGHT PANEL (CARRELLO & CASSETTO) --- */
.ts-rp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.ts-rp-container {
    position: fixed;
    top: 0;
    right: -500px;
    width: 450px;
    max-width: 100%;
    height: 100%;
    background: #fff;
    z-index: 1000000;
    box-shadow: -15px 0 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.ts-rp-overlay.active { opacity: 1; visibility: visible; }
.ts-rp-container.active { right: 0; }
.ts-rp-header {
    padding: 25px 30px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ts-rp-header h3 { font-size: 1.5rem; font-weight: 900; margin: 0; color: #1e242d; }
.ts-rp-close { background: none; border: none; font-size: 2.5rem; cursor: pointer; color: #64748b; line-height: 1; }
.ts-rp-close:hover { color: #ef4444; }
.ts-rp-content { padding: 30px; overflow-y: auto; flex: 1; }

.ts-cart-mini-item { display: flex; gap: 15px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #e2e8f0; }
.ts-cart-mini-item img { width: 75px; height: 75px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; }
.ts-cart-mini-item h5 { font-size: 1rem; font-weight: 700; margin: 0 0 6px 0; color: #1e242d; }
.ts-cart-totals-box { background: #f8fafc; padding: 25px; border-radius: 14px; margin-top: 20px; border: 1px solid #e2e8f0; }
.tot-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-weight: 700; color: #334155; }
.grand-total { font-size: 1.4rem; font-weight: 900; color: #1e242d; border-top: 2px solid #e2e8f0; padding-top: 15px; margin-top: 15px; }
.ts-rp-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--ts-yellow);
    color: var(--ts-dark);
    padding: 16px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 1.1rem;
    margin-top: 20px;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255,193,7,0.3);
    transition: all 0.2s;
}
.ts-rp-btn:hover { background: var(--ts-yellow-hover); transform: translateY(-2px); }

/* Responsiveness */
@media (max-width: 992px) {
    .header-wrapper { flex-wrap: wrap; }
    .retail-search { order: 3; max-width: 100%; width: 100%; }
    .trust-badges-bar { grid-template-columns: 1fr 1fr; }
    .video-inner { grid-template-columns: 1fr; }
    .ts-retail-shop-wrap { grid-template-columns: 1fr; }
    .whatsapp-banner-card { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
    .trust-badges-bar { grid-template-columns: 1fr; }
    .mega-visual-grid { grid-template-columns: repeat(2, 1fr); }
}
