/* ============================================================================
   SNIFFER4D NANO 2+ — CONFIGURATORE (CSS)
   ============================================================================
   Da incollare nel Customizer > CSS Aggiuntivo.
   Convenzione di scoping: tutte le regole sono prefissate con .db-cfg per
   evitare conflitti col tema Electro e altri plugin.
   Niente display:flex/grid in inline styles (verrebbero strippati da WP Rocket).
   ============================================================================ */

#configuratore .db-cfg-intro {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}
#configuratore .db-cfg-intro .section-desc {
  margin: 0 auto;
}

/* ===== Container principale ===== */
.db-cfg {
  max-width: 1000px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #dde6ee;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  font-family: Roboto, -apple-system, sans-serif;
  color: #1a2637;
}

/* ===== Header ===== */
.db-cfg-header {
  background: #070d14;
  color: #ffffff;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.db-cfg-header-info {
  font-size: 14px;
}
.db-cfg-header-info strong {
  color: #4DB8F0;
  font-weight: 700;
}
.db-cfg-header-note {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.3px;
}

/* ===== Note tecnica ===== */
.db-cfg-tech-note {
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  padding: 12px 24px;
  font-size: 12px;
  color: #795548;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}
.db-cfg-tech-icon {
  font-size: 14px;
  flex-shrink: 0;
  font-weight: 700;
}

/* ===== Slot counter ===== */
.db-cfg-slots {
  padding: 18px 24px 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.db-cfg-slot-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.db-cfg-slot-bars {
  flex: 1;
  display: flex;
  gap: 4px;
}
.db-cfg-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  transition: background 0.18s ease;
}
.db-cfg-bar.is-filled {
  background: #0096DB;
}
.db-cfg-bar.is-tsp {
  background: linear-gradient(90deg, #0096DB, #00b8e6);
}
.db-cfg-slot-count {
  font-size: 13px;
  font-weight: 800;
  color: #0096DB;
  letter-spacing: 0;
  min-width: 36px;
  text-align: right;
}
.db-cfg-slot-count.is-full {
  color: #d65656;
}

/* ===== Presets ===== */
.db-cfg-presets {
  padding: 6px 24px 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.db-cfg-presets-label {
  font-size: 11px;
  color: #6b7280;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.db-cfg-preset {
  background: #f7fafc;
  border: 1px solid #dde6ee;
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #4a5a6b;
  font-family: Roboto, sans-serif;
  transition: all 0.15s ease;
}
.db-cfg-preset:hover {
  background: #e8f4fa;
  border-color: #0096DB;
  color: #0096DB;
}
.db-cfg-preset-reset {
  background: transparent;
  color: #8a95a3;
  border-color: #e5e7eb;
}
.db-cfg-preset-reset:hover {
  background: #fef2f2;
  color: #d65656;
  border-color: #d65656;
}

/* ===== Gruppi modulo ===== */
.db-cfg-group {
  padding: 14px 24px;
  border-top: 1px solid #f0f4f8;
}
.db-cfg-group-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

/* Grid auto-responsive senza display:grid in inline (richiesto da WP Rocket) */
.db-cfg-mods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

/* ===== Card modulo / kit ===== */
.db-cfg-mod,
.db-cfg-kit {
  background: #ffffff;
  border: 1px solid #dde6ee;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
}
.db-cfg-mod:hover,
.db-cfg-kit:hover {
  border-color: #0096DB;
  background: #f7fcff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 150, 219, 0.08);
}
.db-cfg-mod.is-selected,
.db-cfg-kit.is-selected {
  border-color: #0096DB;
  background: #e8f4fa;
  box-shadow: inset 0 0 0 1px #0096DB;
}
.db-cfg-mod.is-selected::before,
.db-cfg-kit.is-selected::before {
  content: '\2713';
  position: absolute;
  top: 6px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0096DB;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.db-cfg-mod.is-disabled,
.db-cfg-kit.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f7fafc;
  pointer-events: none;
}
.db-cfg-mod.is-disabled:hover,
.db-cfg-kit.is-disabled:hover {
  border-color: #dde6ee;
  background: #f7fafc;
  transform: none;
  box-shadow: none;
}

.db-cfg-mod-name {
  font-weight: 700;
  font-size: 13px;
  color: #1a2637;
  letter-spacing: -0.2px;
}
.db-cfg-mod-desc {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
  line-height: 1.4;
}
.db-cfg-mod-price {
  font-weight: 700;
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
}
.db-cfg-mod.is-selected .db-cfg-mod-price,
.db-cfg-kit.is-selected .db-cfg-mod-price {
  color: #0096DB;
}

/* TSP — card con stile speciale (esclusivo) */
.db-cfg-mod[data-module="tsp"] {
  border-left: 3px solid #f59e0b;
}
.db-cfg-mod[data-module="tsp"].is-selected {
  border-left-color: #0096DB;
}

.db-cfg-kit-note {
  margin-top: 10px;
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
}

/* ===== Opzioni (chip) ===== */
.db-cfg-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.db-cfg-option {
  background: #ffffff;
  border: 1px solid #dde6ee;
  border-radius: 100px;
  padding: 8px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  transition: all 0.15s ease;
  user-select: none;
}
.db-cfg-option:hover {
  border-color: #0096DB;
  background: #f7fcff;
}
.db-cfg-option.is-selected {
  background: #e8f4fa;
  border-color: #0096DB;
  color: #0096DB;
}
.db-cfg-option-name {
  font-weight: 600;
}
.db-cfg-option-price {
  font-weight: 700;
  color: #6b7280;
}
.db-cfg-option.is-selected .db-cfg-option-price {
  color: #0096DB;
}

/* ===== Totale + CTA ===== */
.db-cfg-total {
  background: #070d14;
  color: #ffffff;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 8px;
}
.db-cfg-total-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}
.db-cfg-total-price {
  font-family: Roboto, sans-serif;
  font-size: 36px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 4px 0;
}
.db-cfg-total-price small {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0;
  margin-left: 2px;
}
.db-cfg-total-note {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.db-cfg-cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.db-cfg-cta-cart {
  background: #0096DB;
  border: none;
  color: #ffffff;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 8px;
  font-family: Roboto, sans-serif;
  transition: all 0.18s ease;
  position: relative;
  min-width: 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.db-cfg-cta-cart:hover {
  background: #0078b0;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 150, 219, 0.4);
}
.db-cfg-cta-cart:disabled,
.db-cfg-cta-cart.is-loading {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}
.db-cfg-cta-cart.is-loading .db-cfg-cta-label {
  visibility: hidden;
}
.db-cfg-cta-spinner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: none;
  animation: db-cfg-spin 0.7s linear infinite;
}
.db-cfg-cta-cart.is-loading .db-cfg-cta-spinner {
  display: inline-block;
}
@keyframes db-cfg-spin {
  to { transform: rotate(360deg); }
}

.db-cfg-cta-quote {
  background: transparent;
  color: #ffffff;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
}
.db-cfg-cta-quote:hover {
  border-color: #0096DB;
  color: #0096DB;
}

/* ===== Feedback ===== */
.db-cfg-feedback {
  padding: 16px 24px;
  font-size: 14px;
  border-top: 1px solid #f0f4f8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.db-cfg-feedback.is-success {
  background: #ecfdf5;
  color: #065f46;
}
.db-cfg-feedback.is-error {
  background: #fef2f2;
  color: #991b1b;
}
.db-cfg-feedback a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .db-cfg-header {
    padding: 14px 18px;
    flex-direction: column;
    align-items: flex-start;
  }
  .db-cfg-tech-note,
  .db-cfg-slots,
  .db-cfg-presets,
  .db-cfg-group {
    padding-left: 18px;
    padding-right: 18px;
  }
  .db-cfg-mods-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .db-cfg-total {
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .db-cfg-cta-row {
    justify-content: center;
  }
  .db-cfg-cta-cart {
    width: 100%;
  }
  .db-cfg-cta-quote {
    width: 100%;
    justify-content: center;
  }
}
