.rules-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

/* Colonne interne: impilano le card verticalmente */
.rules-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0; /* impedisce alla colonna di espandere la grid oltre il viewport */
}

/* Ogni colonna ha una sola card: la facciamo crescere per pareggiare l'altezza tra le colonne */
.rules-column .rules-card {
  flex: 1;
  min-width: 0;
}

/* Card container — overrides global .card glass to use custom structure */
.rules-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  border-radius: 0.75rem;
  overflow: hidden;
}

.rules-card-header {
  padding: 1rem 1.25rem;
  background: rgba(10, 25, 70, 0.07);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.rules-card-header h5, .rules-card-header .h5 {
  font-weight: 700;
  color: #0f2456;
  margin: 0;
}

.rules-card-body {
  padding: 1.25rem;
  min-width: 0;
}

/* Section titles */
.rules-section-title {
  font-weight: 700;
  color: #0f2456;
  border-left: 3px solid #1b6bd8;
  padding-left: 0.6rem;
  margin-bottom: 0.75rem;
}

/* Lists */
.rules-list {
  padding-left: 1.25rem;
  margin-bottom: 0;
}

.rules-list li {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: #2d3748;
}

.rules-list--warning li {
  color: #6b2323;
}

.rules-list--warning li::marker {
  color: #dc3545;
}

/* Table */
.rules-table {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.rules-table thead th {
  background: rgba(10, 25, 70, 0.07) !important;
  color: #0f2456;
  font-weight: 700;
  border-bottom: 2px solid rgba(10, 25, 70, 0.15) !important;
  text-align: left !important;
}

.rules-table tbody td {
  text-align: left !important;
  vertical-align: middle;
  border-color: rgba(0, 0, 0, 0.06) !important;
  padding: 0.55rem 0.75rem !important;
}

.rules-table tbody tr:last-child td {
  border-bottom: none;
}

/* Accordion tariffe: prezzo e nome sempre visibili, dettagli a comparsa */
.rules-accordion-item {
  border: 1px solid rgba(10, 25, 70, 0.1);
  border-radius: 0.5rem !important;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.rules-accordion-item:last-child {
  margin-bottom: 0;
}

.rules-accordion-button {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(10, 25, 70, 0.04);
  border: none;
  font-size: 0.9rem;
  text-align: left;
}

.rules-accordion-button:not(.collapsed) {
  background: rgba(27, 107, 216, 0.12);
  color: #0f2456;
  box-shadow: none;
}

.rules-accordion-button:focus {
  box-shadow: none;
}

.tariffa-name {
  font-weight: 700;
  color: #0f2456;
}

.tariffa-price {
  font-weight: 700;
  color: #155bb8;
  white-space: nowrap;
}

.tariffa-price small {
  font-weight: 500;
  color: #58626d;
}

.rules-accordion-item .accordion-body {
  padding: 0.9rem 1rem 1rem;
  background: #fff;
}

/* Sector grid */
.sectors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.sector-item {
  background: rgba(10, 25, 70, 0.04);
  border: 1px solid rgba(10, 25, 70, 0.1);
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.sector-badge {
  display: inline-block;
  background: #1b6bd8;
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  margin-bottom: 0.5rem;
}

.sector-badge-sm {
  display: inline-block;
  background: #1b6bd8;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 50px;
}

.sector-streets {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
  color: #2d3748;
}

.sector-streets li {
  padding: 0.1rem 0;
}

@media (max-width: 767.98px) {
  .rules-wrapper {
    grid-template-columns: 1fr;
    padding: 0.75rem 0.75rem 4rem;
  }

  .sectors-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rules-accordion-button {
    flex-direction: column;
    align-items: flex-start;
  }
}
