/* === CONTENITORE PRINCIPALE === */
.tabella-prezzi-container {
  width: 100%;
  border: 2px solid #247477;
  border-radius: 10px;
  padding: 1.5rem;
  background-color: #FFF;
}

/* === TABELLA UNICA (CLIENTI RES/NON RES) === */
.tabella-prezzi.tabella-unificata table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

/* === STILI CELLE TABELLA === */
.tabella-prezzi th,
.tabella-prezzi td {
  text-align: center;
  padding: 10px;
  border-bottom: 1px solid #DDD;
  color: #333;
}

.tabella-prezzi th {
  background-color: #247477;
  color: #FFF;
  font-weight: 600;
}

/* === BOTTONI SWITCH TRA RESIDENZIALE / NON RESIDENZIALE === */
.tabella-switch {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  gap: 10px;
}

/* === STILI TESTO E PREZZO DINAMICO (opzionale, se presenti) === */
.tabella-prezzo-testo {
  text-align: center;
  margin-top: 1.5rem;
}

.prezzo-dinamico {
  font-weight: 600;
  color: #247477;
  margin-bottom: 0.5rem;
}

.testo-dinamico {
  color: #333;
}

/* === RESPONSIVE === */

/* TABLET GRANDI (max 1024px) */
@media (max-width: 1024px) {
  .tabella-switch {
    flex-wrap: wrap;
    gap: 8px;
  }

  .tabella-prezzi-container {
    padding: 1.2rem;
  }

  .tabella-prezzo-testo {
    font-size: 0.95rem;
  }
}

/* TABLET MEDI (max 820px) */
@media (max-width: 820px) {
  .tabella-switch button {
    padding: 6px 12px;
    font-size: 0.9rem;
  }

  .tabella-prezzi-container {
    padding: 1rem;
  }

  .tabella-prezzi th,
  .tabella-prezzi td {
    padding: 6px;
  }
}

/* TABLET PICCOLI E MOBILE STANDARD (max 768px) */
@media (max-width: 768px) {
  /* Tabella diventa blocchi per facilitare la lettura su mobile */
  .tabella-prezzi table,
  .tabella-prezzi thead,
  .tabella-prezzi tbody,
  .tabella-prezzi th,
  .tabella-prezzi td,
  .tabella-prezzi tr {
    display: block;
  }

  .tabella-prezzi tr {
    margin-bottom: 1rem;
    border-bottom: 1px solid #DDD;
  }

  .tabella-prezzi td {
    text-align: right;
    position: relative;
    padding-left: 50%;
  }

  /* Mostra intestazioni colonne su mobile usando data-label */
  .tabella-prezzi td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    width: 45%;
    text-align: left;
    font-weight: bold;
    color: #247477;
  }
}

/* SMARTPHONE GRANDI (max 430px) */
@media (max-width: 430px) {
  .tabella-switch {
    flex-direction: column;
    align-items: center;
  }

  .tabella-switch button {
    width: 100%;
  }

  .tabella-prezzo-testo {
    margin-top: 1rem;
  }

  .prezzo-dinamico {
    font-size: 1rem;
  }

  .testo-dinamico {
    font-size: 0.9rem;
  }
}