/*
Theme Name: Uncode Child
Description: Child theme for Uncode theme
Author: Undsgn™
Author URI: http://www.undsgn.com
Template: uncode
Version: 1.0.0
Text Domain: uncode
*/

/* ---------------------------
   TERRANOVA TOPBAR (BEM)
--------------------------- */

.terranova-topbar {
    width: 100%;
    background: #395469;
    padding: 8px 36px;
    box-sizing: border-box;
    color: #ffffff;
    font-size: clamp(12px, 1vw + 10px, 14px);
    line-height: 1.4;
    z-index: 9999;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* BURGER + SOCIAL IN MOBILE */
/* Wrapper della riga superiore solo su mobile */
.terranova-topbar__mobile-row {
    display: none;
}

/* COLLAPSIBLE LEFT PART (indirizzo • telefono • mail) */
.terranova-topbar__collapsible {
    display: flex;
    align-items: center;
    gap: 25px;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

/* Desktop: sempre tutto visibile */
.terranova-topbar__collapsible {
    max-height: none;
    opacity: 1;
}

/* Desktop right side (social + mondo) */
.terranova-topbar__right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Items */
.terranova-topbar__item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.terranova-topbar__link {
    color: #ffffff;
    text-decoration: none;
}

.terranova-topbar__icon {
    color: #99cccc;
}

.terranova-topbar__separator {
    opacity: 0.4;
}

/* ---------------------------
   BURGER (ANIMATED)
--------------------------- */

.terranova-topbar__toggle {
    width: 24px;
    height: 20px;
    position: relative;
    cursor: pointer;
    display: none;
}

.terranova-topbar__toggle span {
    position: absolute;
    width: 100%;
    height: 3px;
    background: #99cccc;
    left: 0;
    transition: all 0.3s ease;
}

.terranova-topbar__toggle span:nth-child(1) { top: 0; }
.terranova-topbar__toggle span:nth-child(2) { top: 8px; }
.terranova-topbar__toggle span:nth-child(3) { top: 16px; }

.terranova-topbar--open .terranova-topbar__toggle span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.terranova-topbar--open .terranova-topbar__toggle span:nth-child(2) {
    opacity: 0;
}

.terranova-topbar--open .terranova-topbar__toggle span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ---------------------------
   RESPONSIVE
--------------------------- */

@media (max-width: 768px) {

    .terranova-topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 20px;
        gap: 10px;
    }

    /* Top row: burger + social + mondo */
    .terranova-topbar__mobile-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .terranova-topbar__toggle {
        display: block;
    }

    /* Social sempre visibili in mobile */
    .terranova-topbar__right {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    /* Collapsible area (indirizzo/tel/email) */
    .terranova-topbar__collapsible {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
    }

    /* Stato aperto */
    .terranova-topbar--open .terranova-topbar__collapsible {
        max-height: 300px;
        opacity: 1;
    }
}

/* Desktop-only visibility */
.desktop-only {
    display: flex;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .terranova-topbar__collapsible,
    .terranova-topbar__item,
    .terranova-topbar__item span,
    .terranova-topbar__item a {
        text-align: left !important;
        width: 100%;
    }
}

/* =================================================
   ICONS BASE (filters + Terranova menu)
   ================================================= */

.term-filter .term-filter-link,
.type-terranova .menu-item > a{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.term-filter .term-filter-link::before,
.type-terranova .menu-item > a::before{
  content: "";
  width: 30px;
  height: 30px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: inline-block;
  flex-shrink: 0;
}

/* =================================================
   CATEGORY ICONS (shared)
   ================================================= */

/* ACCESSORIES */
.term-794 .term-filter-link::before,
.type-terranova .menu-item-6704 > a::before{
  background-image: url("/wp-content/uploads/2026/02/ICONA-TYPE-ACCESORIES.png");
}

/* CONSISTENCY */
.term-812 .term-filter-link::before,
.type-terranova .menu-item-6705 > a::before{
  background-image: url("/wp-content/uploads/2025/12/Consistency.png");
}

/* DENSITY */
.term-813 .term-filter-link::before,
.type-terranova .menu-item-6706 > a::before{
  background-image: url("/wp-content/uploads/2025/12/Density.png");
}

/* DIFFERENTIAL PRESSURE */
.term-814 .term-filter-link::before,
.type-terranova .menu-item-6707 > a::before{
  background-image: url("/wp-content/uploads/2025/12/Differential-Pressure.png");
}

/* FLOW */
.term-815 .term-filter-link::before,
.type-terranova .menu-item-6708 > a::before{
  background-image: url("/wp-content/uploads/2025/12/Flow.png");
}

/* FLOW MULTIPHASE */
.term-816 .term-filter-link::before,
.type-terranova .menu-item-6710 > a::before{
  background-image: url("/wp-content/uploads/2025/12/Flow-Multifase.png");
}

/* GAUGES */
.term-796 .term-filter-link::before,
.type-terranova .menu-item-6711 > a::before{
  background-image: url("/wp-content/uploads/2026/02/ICONA-TYPE-GAUGES.png");
}

/* LEVEL CONTINUOUS */
.term-817 .term-filter-link::before,
.type-terranova .menu-item-6766 > a::before{
  background-image: url("/wp-content/uploads/2025/12/Level-Continuous.png");
}

/* LEVEL ON OFF */
.term-818 .term-filter-link::before,
.type-terranova .menu-item-6713 > a::before{
  background-image: url("/wp-content/uploads/2025/12/Level-On-Off.png");
}

/* MEASURING ELEMENTS */
.term-807 .term-filter-link::before,
.type-terranova .menu-item-6714 > a::before{
  background-image: url("/wp-content/uploads/2026/02/ICONA-TYPE-MEASURING-ELEMENTS.png");
}

/* OIL MIST */
.term-819 .term-filter-link::before,
.type-terranova .menu-item-6715 > a::before{
  background-image: url("/wp-content/uploads/2025/12/Oil-Mist.png");
}

/* OTHER MEASURES */
.term-809 .term-filter-link::before,
.type-terranova .menu-item-7123 > a::before{
  background-image: url("/wp-content/uploads/2026/02/ICONA-TYPE-MEASURING-ELEMENTS.png");
}

/* PNEUMATICS */
.term-793 .term-filter-link::before,
.type-terranova .menu-item-6717 > a::before{
  background-image: url("/wp-content/uploads/2026/02/ICONA-TYPE-PNEUMATICS.png");
}

/* PRESSURE */
.term-820 .term-filter-link::before,
.type-terranova .menu-item-6718 > a::before{
  background-image: url("/wp-content/uploads/2025/12/Pressure.png");
}

/* SWITCHES */
.term-784 .term-filter-link::before,
.type-terranova .menu-item-6720 > a::before{
  background-image: url("/wp-content/uploads/2026/02/ICONA-TYPE-SWITCHES.png");
}

/* SYSTEMS */
.term-822 .term-filter-link::before,
.type-terranova .menu-item-6721 > a::before{
  background-image: url("/wp-content/uploads/2026/02/ICONA-TYPE-SYTEMS.png");
}

/* TEMPERATURE */
.term-811 .term-filter-link::before,
.type-terranova .menu-item-6722 > a::before{
  background-image: url("/wp-content/uploads/2025/12/Temperature.png");
}

/* TRANSMITTERS */
.term-791 .term-filter-link::before,
.type-terranova .menu-item-6723 > a::before{
  background-image: url("/wp-content/uploads/2026/02/ICONA-TYPE-TRANSMITTERS.png");
}

/* VALVES */
.term-624 .term-filter-link::before,
.type-terranova .menu-item-6724 > a::before{
  background-image: url("/wp-content/uploads/2026/02/ICONA-TYPE-VALVES.png");
}

/* WATER IN OIL */
.term-823 .term-filter-link::before,
.type-terranova .menu-item-6725 > a::before{
  background-image: url("/wp-content/uploads/2025/12/Water-in-oil.png");
}

/* =================================================
   UNCODE AJAX FILTERS: PERSISTENZA (Ale)
   Forza la visibilità dei filtri anche con count 0
   ================================================= */

/* Blocca il display:none che Uncode applica via JS ai list items */
.filtri-type li.term-filter, 
.filtri-measure li.term-filter, 
.filtri-solutions li.term-filter {
    display: flex !important; 
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

/* Sovrascrive eventuali classi di hiding di Uncode */
.filtri-type li.hidden, .filtri-type li.empty,
.filtri-measure li.hidden, .filtri-measure li.empty,
.filtri-solutions li.hidden, .filtri-solutions li.empty {
    display: flex !important;
}

/* Forza l'allineamento icone per i termini visualizzati */
.filtri-type .term-filter-link,
.filtri-measure .term-filter-link,
.filtri-solutions .term-filter-link {
    display: inline-flex !important;
    align-items: center;
}



/* =================================================
   FIX FINALE MEGAMENU - TYPE (BLU BASE E STATI)
   ================================================= */

/* 1. Ingrandimento Icone (le tue ::before caricate via URL) */
.megamenu-demo .type-terranova .menu-item > a::before,
.megamenu-demo [class*="menu-item-"] > a::before {
    width: 45px !important;
    height: 45px !important;
    background-size: contain !important;
    margin-right: 12px !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    /* Assicuriamo che l'icona sia blu di base */
    filter: drop-shadow(0 0 0 #4a748d) !important;
}

/* 2. Colore BASE Blu per Testo e Icone */
.megamenu-demo .type-terranova .menu-item > a {
    display: flex !important;
    align-items: center !important;
    text-indent: 0 !important;
    padding: 5px 0 !important;
    /* COLORE BLU BASE */
    color: #4a748d !important; 
    font-weight: 400 !important;
    opacity: 0.9 !important; /* Leggermente opaco per look base */
}

/* 3. RESET STATO ATTIVO (Mantieni il blu, rimuovi grassetto) */
.megamenu-demo .type-terranova .menu-item.current-menu-item > a,
.megamenu-demo .type-terranova .menu-item.active > a,
.megamenu-demo .type-terranova .menu-item > a:active,
.megamenu-demo .type-terranova .menu-item > a:focus,
.megamenu-demo .type-terranova .menu-item > a.active {
    color: #4a748d !important;      /* Mantieni il blu */
    font-weight: 400 !important;     /* Peso normale, no grassetto */
    opacity: 1 !important;          /* Opacità piena quando attivo */
}

/* 4. Reset specifico per il colore del testo (forza blu) */
.megamenu-demo .type-terranova .menu-item > a span {
    color: #4a748d !important; /* Forza blu anche sullo span */
    line-height: 1 !important;
    display: inline-block !important;
}

/* =================================================
   FIX FINALE: FORZA COLORE ICONA STATO ATTIVO
   ================================================= */

/* Forza l'icona a rimanere del blu originale anche se il link è attivo/cliccato */
.megamenu-demo .type-terranova .menu-item.current-menu-item > a::before,
.megamenu-demo .type-terranova .menu-item.active > a::before,
.megamenu-demo .type-terranova .menu-item > a.active::before,
.megamenu-demo .type-terranova .menu-item > a:focus::before {
    /* Sostituisci #4a748d con il codice esatto del blu che desideri */
    filter: drop-shadow(0 0 0 #4a748d) !important; 
    opacity: 1 !important; /* Forza opacità piena */
}



/* =====================================================
   1. NASCONDERE PRODOTTO FANTASMA (ID 7247)
===================================================== */
.post-7247,
.product-id-7247,
.uncode-single-product-7247,
.tmb-id-7247 {
  display: none !important;
}

/* =====================================================
   2. FILTRI TYPE: ALLINEAMENTO ICONA + TESTO
===================================================== */
.term-filters-list li {
  display: flex !important;
  align-items: center !important;
  margin-bottom: 12px !important;
}

.term-filters-list li a {
  display: flex !important;
  align-items: center !important;
  text-indent: 0 !important;
  color: #999 !important;
  font-weight: 400 !important;
  opacity: 0.8 !important;
  transition: opacity 0.2s ease, color 0.2s ease, font-weight 0.2s ease;
}

.term-filters-list li.is-active a,
.term-filters-list li.active a,
.term-filters-list li a.active,
.term-filters-list li a.term-filter-link--active,
.term-filters-list li a.term-filter-link--checked {
  color: #4a748d !important;
  font-weight: 600 !important;
  opacity: 1 !important;
}

/* =====================================================
   3. FILTRI BRAND: LOGHI (PATH RELATIVI)
===================================================== */
.filtri-brand .term-filters-list li a {
  display: block !important;
  width: 180px !important;
  height: 60px !important;
  text-indent: -9999px !important;
  overflow: hidden !important;
  background-repeat: no-repeat !important;
  background-position: left center !important;
  background-size: contain !important;
  opacity: 0.35 !important;
  transition: opacity 0.2s ease;
}

.filtri-brand .term-filters-list li.is-active a,
.filtri-brand .term-filters-list li.active a,
.filtri-brand .term-filters-list li a.active,
.filtri-brand .term-filters-list li a.term-filter-link--active,
.filtri-brand .term-filters-list li a.term-filter-link--checked {
  opacity: 1 !important;
}

/* Mapping loghi con path relativi */
.filtri-brand .term-filters-list li:nth-child(1) a {
  background-image: url("/wp-content/uploads/2026/01/spriano-brand.png") !important;
}

.filtri-brand .term-filters-list li:nth-child(2) a {
  background-image: url("/wp-content/uploads/2026/01/valcom-brand.png") !important;
}

.filtri-brand .term-filters-list li:nth-child(3) a {
  background-image: url("/wp-content/uploads/2026/01/mecrela-brand.png") !important;
}

/* Nasconde eventuali voci extra inutili sotto i brand */
.filtri-brand .term-filters-list li:nth-child(4),
.filtri-brand .term-filters-list li:nth-child(5) {
  display: none !important;
}

/* =====================================================
   4. PULIZIA ELEMENTI SUPERFLUI NEI FILTRI
===================================================== */
.term-filters-list li.term-filter input[type="checkbox"] {
  display: none !important;
}

/* Nasconde "Show all" */
[data-filter="*"],
.filter-all,
.uncode-filter-list li:first-child {
  display: none !important;
}

/* =====================================================
   5. MEGAMENU: LINK ATTIVO SINCRONIZZATO CON SIDEBAR
===================================================== */
.megamenu-demo .type-terranova .menu-item.is-active > a,
.megamenu-demo .type-terranova .menu-item.active > a {
  color: #4a748d !important;
  font-weight: 600 !important;
  opacity: 1 !important;
}

.megamenu-demo .type-terranova .menu-item.is-active > a::before,
.megamenu-demo .type-terranova .menu-item.active > a::before {
  opacity: 1 !important;
  filter: drop-shadow(0 0 2px rgba(74, 116, 141, 0.5)) !important;
}

/* =====================================================
   6. HEADER FILTRI + RICERCA ALLINEATA
===================================================== */
.uncode-filter-container {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  position: relative !important;
  gap: 20px !important;
}

.uncode-filter-list {
  margin-bottom: 0 !important;
}

.ricerca-allineata-filtri {
  position: relative !important;
  margin-left: auto !important;
  width: 200px !important;
  z-index: 10 !important;
}

.ricerca-allineata-filtri input.search-field {
  height: 32px !important;
  padding: 0 35px 0 12px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  background-color: #f9f9f9 !important;
  font-size: 13px !important;
  color: #444 !important;
}

.ricerca-allineata-filtri .search-submit {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

/* =====================================================
   7. NASCONDERE AUTORE
===================================================== */
.post-author,
.author-node,
.vcard.author {
  display: none !important;
}