/* =====================================================
   ITNETCOM – PAGINA PRODOTTI
   ===================================================== */

/* ===============================
   STRUTTURA GENERALE
   =============================== */

.itn-product-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.itn-product-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.itn-product-price {
  font-size: 16px;
  font-weight: 700;
  color: #e30613; /* rosso Itnetcom */
}

/* ===============================
   CARD PRODOTTO
   =============================== */

.itn-product-card {
  padding: 0;
}

.itn-product-img {
  padding: 0;
}

.itn-product-body {
  padding: 12px;
}

/* ===============================
   FILTRI CATALOGO
   =============================== */

.itn-filter-block {
  margin-bottom: 18px;
}

/* titolo sezione filtri */
.itn-filter-block strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ===============================
   VOCE FILTRO BASE
   =============================== */

.itn-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 14px;
  color: #222;
  cursor: pointer;
  text-decoration: none;
}

.itn-filter-item:hover {
  color: #e30613;
}

.itn-filter-item.is-active {
  font-weight: 700;
  color: #000;
}

/* ===============================
   CATEGORIE (LIVELLO 1)
   =============================== */

.itn-filter-cat {
  font-weight: 500;
}

/* freccia UNICA */
.itn-filter-cat::before {
  content: "▸";
  font-size: 14px;
  color: #666;
  transition: transform 0.25s ease;
}

/* categoria aperta */
.itn-filter-cat[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

/* ===============================
   SOTTOCATEGORIE
   =============================== */

.itn-filter-subcats {
  display: none;
  margin-left: 14px;
  margin-top: 6px;
}

/* mostra sottocategorie solo se aperta */
.itn-filter-cat[aria-expanded="true"] + .itn-filter-subcats {
  display: block;
}

/* sottocategoria livello 1 */
.itn-filter-sub {
  display: block;
  padding-left: 12px;
  font-size: 14px;
  color: #444;
}

/* sottocategoria livello 2 */
.itn-filter-sub2 {
  display: block;
  padding-left: 24px;
  font-size: 13px;
  color: #666;
}

.itn-filter-sub2:hover {
  text-decoration: underline;
}

.itn-filter-sub2.is-active {
  font-weight: 600;
  color: #000;
}

/* ===============================
   RESET SICUREZZA
   =============================== */

.itn-filter-item,
.itn-filter-item * {
  list-style: none;
}

/* ===============================
   RESPONSIVE (mantiene layout)
   =============================== */

@media (max-width: 768px) {
  .itn-filter-block {
    margin-bottom: 14px;
  }
}
/* ===============================
   MOBILE – TITOLO PRODOTTO SINGOLO
   =============================== */
@media (max-width: 768px) {

  .itn-product-page .itn-product-title {
    font-size: 22px;
    line-height: 1.25;
    min-height: auto;
  }

}
/* =====================================================
   BREADCRUMB PRODOTTO – UX MODERNA
   ===================================================== */

/* DESKTOP */
.itn-breadcrumb--single {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
}

.itn-breadcrumb--single a {
  color: #666;
  text-decoration: none;
}

.itn-breadcrumb--single a:hover {
  text-decoration: underline;
}

/* MOBILE */
@media (max-width: 768px) {

  .itn-breadcrumb--single {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 8px 12px;
    margin: 0 -12px 12px;

    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;

    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .itn-breadcrumb--single::-webkit-scrollbar {
    display: none;
  }

  .itn-breadcrumb--single a,
  .itn-breadcrumb--single span {
    flex: 0 0 auto;
    font-size: 13px;
  }

  /* separatore più leggero */
  .itn-breadcrumb--single span {
    color: #aaa;
    margin: 0 2px;
  }
}
/* =====================================================
   BREADCRUMB MOBILE – FIX HEADER + OVERFLOW
   ===================================================== */

@media (max-width: 768px) {

  /* contenitore breadcrumb */
  .itn-breadcrumb--single {
    position: relative;

    /* spazio reale sotto header */
    margin-top: 12px;
    margin-bottom: 12px;

    padding: 8px 12px;

    /* niente margini negativi */
    margin-left: 0;
    margin-right: 0;

    display: flex;
    align-items: center;
    gap: 8px;

    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;

    box-sizing: border-box;

    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .itn-breadcrumb--single::-webkit-scrollbar {
    display: none;
  }

  .itn-breadcrumb--single a,
  .itn-breadcrumb--single span {
    flex: 0 0 auto;
    font-size: 13px;
  }
}
/* =====================================================
   OFFSET CONTENUTO PER HEADER MOBILE FIXED
   ===================================================== */

@media (max-width: 768px) {

  /* contenuto pagina prodotto */
  .itn-product-page {
    padding-top: 64px; /* altezza header mobile */
  }

}
/* =====================================================
   UX MOBILE – CARRELLO & CHECKOUT
   ===================================================== */

@media (max-width: 768px) {

  /* ===============================
     OFFSET CONTENUTO (HEADER FIXED)
     =============================== */
  .itn-cart-page,
  .itn-checkout-page {
    padding-top: 72px;
  }

  /* ===============================
     TITOLI PAGINA
     =============================== */
  .itn-cart-page h1,
  .itn-checkout-page h1 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 16px;
  }

  /* ===============================
     CARRELLO → DA TABELLA A CARD
     =============================== */
  .itn-cart-table thead {
    display: none;
  }

  .itn-cart-table tr {
    display: block;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
  }

  .itn-cart-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
  }

  .itn-cart-table td::before {
    content: attr(data-label);
    font-size: 13px;
    color: #666;
  }

  /* ===============================
     TOTALE + AZIONI CARRELLO
     =============================== */
  .itn-cart-total {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin: 20px 0;
  }

  .itn-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .itn-cart-actions a,
  .itn-cart-actions button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: 10px;
  }

  /* ===============================
     CHECKOUT → LAYOUT MOBILE-FIRST
     =============================== */
  .itn-checkout-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .itn-checkout-section {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
  }

  .itn-checkout-form input,
  .itn-checkout-form select,
  .itn-checkout-form textarea {
    padding: 14px;
    font-size: 16px;
    border-radius: 10px;
  }

  /* ===============================
     CTA CHECKOUT
     =============================== */
  .itn-checkout-submit {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    border-radius: 12px;
    margin-top: 20px;
  }

}
/* =====================================================
   UX MOBILE DEFINITIVA – CHECKOUT HEADER
   ===================================================== */

@media (max-width: 768px) {

  /* contenitore principale checkout */
  .itn-checkout-page {
    padding-top: 88px; /* aria header */
  }

  /* back link */
  .itn-product-back,
  .itn-checkout-page a[href*="carrello"] {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: #444;
    margin-bottom: 8px;
  }

  /* titolo checkout */
  .itn-checkout-page h1,
  .itn-checkout-page .itn-h2 {
    font-size: 22px;
    text-align: left;
    margin: 4px 0 16px;
    line-height: 1.3;
  }

}
/* =====================================================
   UX MOBILE – FILTRI CATALOGO (DESKTOP INVARIATO)
   ===================================================== */

@media (max-width: 768px) {

  /* ===============================
     NASCONDI FILTRI STATICI
     =============================== */
  .itn-filters {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 85%;
    max-width: 360px;
    background: #fff;
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }

  /* stato aperto */
  .itn-filters.is-open {
    transform: translateX(0);
  }

  /* ===============================
     OVERLAY
     =============================== */
  .itn-filters-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .itn-filters-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* ===============================
     BOTTONE FILTRI
     =============================== */
  .itn-filters-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    margin: 12px 0;
  }

  /* ===============================
     TITOLI FILTRO
     =============================== */
  .itn-filters h3 {
    font-size: 16px;
    margin: 16px 0 8px;
  }

  .itn-filter-item {
    padding: 10px 0;
    font-size: 15px;
  }

  /* ===============================
     CTA APPLICA FILTRI
     =============================== */
  .itn-filters-apply {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 16px 0;
  }

  .itn-filters-apply button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: 12px;
  }

}
/* =====================================================
   VISIBILITÀ FILTRI – DESKTOP vs MOBILE
   ===================================================== */

/* Desktop: nascondi elementi mobile */
@media (min-width: 769px) {

  .itn-filters-toggle,
  .itn-filters-overlay,
  .itn-filters-apply {
    display: none !important;
  }

}
@media (max-width: 768px) {

  .itn-filters-toggle {
    display: inline-flex;
  }

  .itn-filters-apply {
    display: block;
  }

}
/* =====================================================
   FIX DEFINITIVO DRAWER FILTRI MOBILE
   ===================================================== */

@media (max-width: 768px) {

  .itn-filters {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 360px;

    /* ✅ viewport dinamico */
    height: 100dvh;
    max-height: 100dvh;

    padding: 20px 16px 96px; /* spazio per CTA */
    overflow-y: auto;

    background: #fff;
    z-index: 9999;

    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .itn-filters.is-open {
    transform: translateX(0);
  }

  /* CTA sempre visibile */
  .itn-filters-apply {
    position: fixed;
    left: 0;
    bottom: env(safe-area-inset-bottom, 0);
    width: 85%;
    max-width: 360px;

    background: #fff;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    z-index: 10000;
  }

  .itn-filters-apply button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: 12px;
  }

}
