/* ===================================================
   Stile EAN / PN e compatibilità - HappyTec 2025
   =================================================== */

.ht-eanpn-wrapper {
  margin: 10px 0 20px 0;
  font-family: "Maven Pro", sans-serif;
  font-size: 14px;
  color: #222;
}

.ht-eanpn b {
  color: #000;
}

/* --- Griglia compatibilità --- */
.ht-compat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}

.ht-compat-box {
  flex: 1 1 300px;
  min-width: 250px;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ht-compat-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* --- Logo marca --- */
.ht-compat-logo img {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  margin: 0 auto 10px auto;
  display: block;
}

/* --- Lista modelli --- */
.ht-compat-models {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.ht-compat-models li {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.4em;
}

.ht-compat-models a.ht-compat-name {
  font-weight: 600;
  color: #0073aa;
  text-decoration: none;
}

.ht-compat-models a.ht-compat-name:hover {
  text-decoration: underline;
}

.ht-compat-extra {
  color: #555;
  font-weight: 400;
  font-size: 13px;
}

.ht-compat-scheda {
  font-size: 13px;
  color: #0073aa;
}

.ht-compat-scheda:hover {
  text-decoration: underline;
}

/* --- Separatore e note --- */
.wp-block-separator {
  margin: 25px 0;
  border-top: 1px solid #ddd;
  opacity: 0.6;
}

/* --- Tabella errori --- */
.tabella_errori {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}

.tabella_errori th,
.tabella_errori td {
  border: 1px solid #e0e0e0;
  padding: 8px 10px;
  text-align: left;
}

.tabella_errori th {
  background: #f9b313;
  color: #000;
}

.tabella_errori tr:nth-child(even) {
  background: #fafafa;
}

/* --- FAQ --- */
.ht-faq-wrapper {
  margin: 30px 0;
}

.ht-faq-toggle {
  background: #f9b313;
  color: #000;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.ht-faq-toggle:hover {
  background: #ffcc33;
}

.ht-faq {
  margin-top: 15px;
  display: none;

}

.ht-faq-item {
  margin-bottom: 12px;
  display: block;

}

/* --- Responsive --- */
@media (max-width: 768px) {
  .ht-compat-box {
    flex: 1 1 100%;
    text-align: left;
  }

  .ht-compat-logo img {
    max-width: 80px;
    margin: 0 0 10px 0;
  }

  .ht-compat-models li {
    margin-bottom: 8px;
  }
}

/*Walter*/
/* Wrapper generale */
.targhetta-wrapper {
  margin-top: 25px;
}

/* GRIGLIA 3 COLONNE */
.targhetta-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

/* CARD */
.targhetta-card {
  background: #fff;
  border-radius: 14px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 180px;
  /* altezza minima */
  max-height: 280px;
  /* 🔥 limita altezza delle card */
}

/* CARD FULL (esempio targhetta) */
.targhetta-card.full {
  grid-column: span 3;
  max-height: 320px;
  /* un po’ più alto solo questo */
  text-align: center;
}

/* IMMAGINI – versione compatta */
.targhetta-card img {
  width: auto;
  height: 140px !important;
  /* 🔥 forza dimensione molto più piccola */
  max-width: 100%;
  object-fit: contain;
  /* evita distorsioni */
  margin: 10px auto 0;
  display: block;
}

/* Testi */
.targhetta-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.targhetta-card p {
  font-size: 14px;
  line-height: 1.4;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .targhetta-grid-3 {
    grid-template-columns: 1fr;
  }

  .targhetta-card.full {
    grid-column: span 1;
  }
}

/* --- Search compatibilità --- */
.ht-compat-search-box {
  margin-bottom: 15px;
}

.ht-compat-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.ht-compat-search:focus {
  border-color: #0073aa;
  box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
  outline: none;
}
/* --- risultati ricerca --- */
.ht-compat-count {
  margin-top: 8px;
  font-size: 13px;
  color: #555;
}

.ht-compat-no-results {
  display: none;
  margin-top: 10px;
  padding: 10px;
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 6px;
  font-size: 14px;
}

/* --- highlight --- */
.ht-highlight {
  background: #ffeb3b;
  padding: 1px 2px;
  border-radius: 3px;
}

/* ===================================================
   COMPATIBILITA' PRODOTTO - RESTYLING HAPPYTEC 2026
   =================================================== */
.ht-compat-section {
  --ht-yellow: #f9c600;
  --ht-yellow-dark: #e7b700;
  --ht-black: #111111;
  --ht-text: #272727;
  --ht-muted: #6f7378;
  --ht-border: #e5e7eb;
  --ht-soft: #f7f8f9;
  --ht-green: #18863b;
  --ht-green-soft: #e9f7ed;
  margin: 28px 0 32px;
  font-family: "Maven Pro", sans-serif;
  color: var(--ht-text);
}

.ht-compat-heading {
  margin-bottom: 18px;
}

.ht-compat-heading h3 {
  margin: 0;
  color: var(--ht-black);
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
  font-weight: 700;
}

.ht-compat-heading-accent {
  display: block;
  width: 46px;
  height: 4px;
  margin: 12px 0 14px;
  border-radius: 999px;
  background: var(--ht-yellow);
}

.ht-compat-heading p {
  margin: 2px 0;
  color: var(--ht-muted);
  font-size: 14px;
  line-height: 1.55;
}

.ht-compat-search-box {
  position: relative;
  margin: 0 0 20px;
}

.ht-compat-search-icon {
  position: absolute;
  left: 17px;
  top: 17px;
  width: 18px;
  height: 18px;
  border: 2px solid #1f2933;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

.ht-compat-search-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -5px;
  bottom: -2px;
  background: #1f2933;
  transform: rotate(45deg);
  border-radius: 2px;
}

.ht-compat-search {
  width: 100%;
  min-height: 54px;
  padding: 13px 16px 13px 49px !important;
  border: 1.5px solid #d9dde2 !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: var(--ht-black) !important;
  font-family: inherit;
  font-size: 15px !important;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.04) !important;
  transition: border-color .2s ease, box-shadow .2s ease !important;
}

.ht-compat-search:hover {
  border-color: #c7ccd2 !important;
}

.ht-compat-search:focus {
  outline: none !important;
  border-color: var(--ht-yellow) !important;
  box-shadow: 0 0 0 3px rgba(249, 198, 0, .16), 0 5px 16px rgba(17, 24, 39, .05) !important;
}

.ht-compat-search::placeholder {
  color: #8b9096;
  opacity: 1;
}

.ht-compat-count {
  min-height: 18px;
  margin-top: 7px;
  color: var(--ht-muted);
  font-size: 13px;
}

.ht-compat-no-results {
  display: none;
  flex-direction: column;
  gap: 3px;
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid #f0d575;
  border-radius: 10px;
  background: #fff9df;
  color: #4d4216;
  font-size: 14px;
}

.ht-compat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.ht-compat-box {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--ht-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(17, 24, 39, .035);
  text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.ht-compat-box:hover {
  transform: translateY(-2px);
  border-color: #d8dce1;
  box-shadow: 0 8px 22px rgba(17, 24, 39, .07);
}

.ht-compat-brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ht-compat-brand-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ht-compat-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  margin: 0;
  border: 1px solid #edf0f2;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
}

.ht-compat-logo img {
  display: block;
  width: 48px;
  height: 48px;
  max-width: 48px;
  max-height: 48px;
  margin: 0;
  object-fit: contain;
}

.ht-compat-logo-placeholder {
  color: #777;
  background: var(--ht-soft);
  font-size: 24px;
  font-weight: 700;
}

.ht-compat-brand-copy {
  min-width: 0;
}

.ht-compat-brand-copy h4 {
  margin: 1px 0 6px !important;
  color: var(--ht-black);
  font-size: 17px !important;
  line-height: 1.2;
  font-weight: 700;
}

.ht-compat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--ht-green-soft);
  color: var(--ht-green);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.ht-compat-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.ht-compat-model-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--ht-border);
  border-radius: 999px;
  color: #5c6168;
  background: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.ht-compat-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ht-black);
  cursor: pointer;
}

.ht-compat-chevron {
  display: block;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .2s ease;
}

.ht-compat-toggle[aria-expanded="true"] .ht-compat-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.ht-compat-models-wrap {
  display: block;
}

.ht-compat-models {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ht-compat-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.ht-compat-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--ht-green-soft);
  color: var(--ht-green);
  font-size: 11px;
  font-weight: 700;
}

.ht-compat-item-copy {
  min-width: 0;
}

.ht-compat-item-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 5px;
}

.ht-compat-name,
.ht-compat-models a.ht-compat-name {
  color: #1a66b3;
  font-weight: 600;
  text-decoration: none;
}

.ht-compat-models a.ht-compat-name:hover {
  color: #0f4f92;
  text-decoration: underline;
}

.ht-model-code {
  color: #6e747a;
  font-size: 12px;
  font-weight: 400;
}

.ht-compat-scheda {
  display: inline-block;
  margin-top: 3px;
  color: #7b6410;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.ht-compat-scheda:hover {
  color: #3f340a;
  text-decoration: underline;
}

.ht-compat-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #ece7cf;
  border-radius: 11px;
  background: #fffdf4;
}

.ht-compat-note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ht-yellow);
  color: #111;
  font-size: 13px;
  font-weight: 800;
}

.ht-compat-note p {
  margin: 0;
  color: #5f5a48;
  font-size: 13px;
  line-height: 1.4;
}

.ht-highlight {
  padding: 0 2px;
  border-radius: 3px;
  background: #ffdf58;
  color: inherit;
}

/* Tablet */
@media (max-width: 1100px) {
  .ht-compat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile: layout nativo, non desktop ristretto */
@media (max-width: 767px) {
  .ht-compat-section {
    margin: 24px 0 28px;
  }

  .ht-compat-heading {
    margin-bottom: 15px;
  }

  .ht-compat-heading h3 {
    font-size: 22px !important;
    line-height: 1.2;
  }

  .ht-compat-heading-accent {
    width: 38px;
    height: 4px;
    margin: 10px 0 12px;
  }

  .ht-compat-heading p {
    font-size: 13px;
    line-height: 1.45;
  }

  .ht-compat-search-box {
    margin-bottom: 15px;
  }

  .ht-compat-search {
    min-height: 50px;
    padding-left: 46px !important;
    padding-right: 12px !important;
    border-radius: 11px !important;
    font-size: 14px !important;
  }

  .ht-compat-search-icon {
    left: 15px;
    top: 16px;
    width: 17px;
    height: 17px;
  }

  .ht-compat-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ht-compat-box {
    padding: 13px 13px 12px;
    border-radius: 12px;
    box-shadow: none;
  }

  .ht-compat-box:hover {
    transform: none;
    box-shadow: none;
  }

  .ht-compat-brand-row {
    align-items: center;
    margin-bottom: 0;
  }

  .ht-compat-brand-main {
    gap: 10px;
  }

  .ht-compat-logo {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
  }

  .ht-compat-logo img {
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
  }

  .ht-compat-brand-copy h4 {
    margin-bottom: 5px !important;
    font-size: 16px !important;
  }

  .ht-compat-badge {
    padding: 4px 8px;
    font-size: 11px;
  }

  .ht-compat-model-count {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .ht-compat-toggle {
    display: inline-flex;
  }

  .ht-compat-models-wrap {
    padding-top: 12px;
  }

  .ht-compat-box.is-collapsed .ht-compat-models-wrap {
    display: none;
  }

  .ht-compat-models {
    gap: 9px;
  }

  .ht-compat-item {
    font-size: 13px;
  }

  .ht-model-code {
    display: block;
    width: 100%;
    margin-top: 1px;
    font-size: 11px;
  }

  .ht-compat-scheda {
    margin-top: 4px;
    font-size: 12px;
  }

  .ht-compat-note {
    align-items: flex-start;
    margin-top: 12px;
    padding: 11px 12px;
  }
}

@media (max-width: 390px) {
  .ht-compat-brand-row {
    gap: 7px;
  }

  .ht-compat-card-actions {
    gap: 1px;
  }

  .ht-compat-model-count {
    padding-left: 7px;
    padding-right: 7px;
  }
}

/* Alternative compatibili */
.ht-alternatives-commercial {
    margin: 22px auto 30px;
    max-width: 900px;
}

.ht-alternatives-commercial .ht-alternatives-heading {
    margin-bottom: 18px;
}

.ht-alternatives-commercial .ht-alternatives-heading h3 {
    margin: 0 0 6px;
}

.ht-alternatives-commercial .ht-alternatives-heading p {
    margin: 0;
}

.ht-alternatives-commercial ul.products {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    margin-left: auto !important;
    margin-right: auto !important;
}

.ht-alternatives-commercial ul.products li.product {
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

@media (max-width: 767px) {
    .ht-alternatives-commercial {
        max-width: 100%;
    }

    .ht-alternatives-commercial ul.products {
        gap: 18px;
        justify-content: flex-start;
    }
}
