/* ============================================================
   Ficha de producto de las tres familias (plantillas/FichaProducto.astro).
   La galería (.gallery, .thumbs, .mainimg) y el texto enriquecido (.rich)
   vienen de traulux.css.
   ============================================================ */

.fp { --fp-borde: rgba(255, 255, 255, 0.1); --fp-panel: rgba(255, 255, 255, 0.025); padding: 132px 0 0; }
.fp-pestanas, .fp-caja, .fp-banda { padding-top: 0; padding-bottom: 0; } /* sin el relleno general de las secciones */
.fp svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fp [hidden] { display: none !important; }
.fp-btn-borde { border-color: var(--teal); display: inline-flex; align-items: center; gap: 10px; }
.fp-btn-borde:hover { background: rgba(0, 168, 148, 0.1); }
.fp .btn { display: inline-flex; align-items: center; gap: 10px; }
.fp .btn svg { width: 18px; height: 18px; }

/* migas */
.fp-migas { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 22px; font-size: 0.82rem; }
.fp-volver { display: inline-flex; align-items: center; gap: 7px; color: var(--teal-bright); font-weight: 700; text-decoration: none; padding-right: 22px; border-right: 1px solid var(--fp-borde); }
.fp-volver svg { width: 15px; height: 15px; }
.fp-migas ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-dim); }
.fp-migas li + li::before { content: '/'; margin-right: 8px; opacity: 0.5; }
.fp-migas a { color: var(--text-dim); text-decoration: none; }
.fp-migas a:hover { color: var(--text); }
.fp-migas [aria-current] { color: var(--text); font-weight: 700; }

/* galería y lo esencial */
.fp-heroe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: start; margin-bottom: 40px; }
.fp-heroe .gallery .mainimg { border-radius: 12px; }
.fp-heroe .gallery .thumbs button { border-radius: 8px; }
.fp-info { position: sticky; top: calc(var(--banner-h) + 130px); }
.fp-insignia {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; padding: 5px 12px 5px 10px; border-radius: 99px;
  background: #00866f; color: #fff; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 4px 12px -4px rgba(0, 134, 111, 0.6);
}
.fp-insignia svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.fp-nombre { font-family: inherit; font-size: clamp(1.45rem, 2.3vw, 2rem); font-weight: 800; line-height: 1.15; text-transform: uppercase; }
.fp-codigo { margin-top: 8px; font-size: 0.85rem; color: var(--text-dim); }
.fp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fp-chips span { font-size: 0.8rem; font-weight: 600; padding: 5px 12px; border: 1px solid var(--fp-borde); border-radius: 8px; background: var(--fp-panel); }
.fp-claves { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.fp-claves li {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 14px 8px; border: 1px solid var(--fp-borde); border-radius: 10px; background: var(--fp-panel);
}
.fp-claves svg { width: 24px; height: 24px; color: var(--teal-bright); margin-bottom: 4px; }
.fp-claves b { font-size: 0.92rem; line-height: 1.25; }
.fp-claves span { font-size: 0.72rem; color: var(--text-dim); }
.fp-botones { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.fp-botones .btn { flex: 1; justify-content: center; min-width: 210px; }
.fp-guardar { display: flex; gap: 22px; margin-top: 16px; }
.fp-guardar button { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 0.84rem; font-weight: 600; color: var(--text-dim); }
.fp-guardar button:hover, .fp-guardar button.is-on { color: var(--teal-bright); }
.fp-guardar svg { width: 17px; height: 17px; }
.fp-guardar #btn-fav.is-on svg { fill: currentColor; }

/* pestañas */
.fp-pestanas { border: 1px solid var(--fp-borde); border-radius: 14px; background: var(--fp-panel); margin-bottom: 24px; scroll-margin-top: calc(var(--banner-h) + 140px); }
.fp-tabs { display: flex; gap: 6px; padding: 0 20px; border-bottom: 1px solid var(--fp-borde); overflow-x: auto; }
.fp-tabs button {
  position: relative; flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 16px 16px 15px; cursor: pointer;
  background: none; border: 0; font: inherit; font-size: 0.9rem; font-weight: 700; color: var(--text-dim);
}
.fp-tabs button:hover { color: var(--text); }
.fp-tabs button[aria-selected="true"] { color: var(--teal-bright); }
.fp-tabs button[aria-selected="true"]::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--teal-bright); box-shadow: 0 0 10px rgba(47, 214, 188, 0.7); }
.fp-tabs small { font-size: 0.7rem; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); }
.fp-panel { padding: 28px 30px 30px; }
.fp-panel h3 { font-size: 1rem; font-weight: 800; margin: 24px 0 12px; }
.fp-panel-intro, .fp-nota { font-size: 0.88rem; color: var(--text-dim); margin-bottom: 18px; }
.fp-nota { margin: 18px 0 0; }

/* descripción (+ vídeo) */
.fp-desc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.fp-desc:has(.fp-video) { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.fp-desc .rich { font-size: 0.95rem; }
.fp-desc .rich a { color: var(--teal-bright); }
.fp-recortada { max-height: 440px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.fp-leer { margin-top: 10px; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 0.88rem; font-weight: 700; color: var(--teal-bright); }
.fp-leer:hover { text-decoration: underline; }
.fp-esencial { list-style: none; display: grid; gap: 8px; }
.fp-esencial li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text-dim); }
.fp-esencial b { color: var(--text); }
.fp-esencial svg { width: 17px; height: 17px; color: var(--teal-bright); stroke-width: 2.6; flex-shrink: 0; }
.fp-video { align-self: start; border: 1px solid var(--fp-borde); border-radius: 12px; overflow: hidden; background: #0b0d0c; }
.fp-video button { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; cursor: pointer; background: #000; }
.fp-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.fp-video button img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: opacity 0.2s ease; }
.fp-video button:hover img { opacity: 1; }
.fp-video-boton {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: 66px; height: 66px; border-radius: 50%; background: rgba(12, 14, 13, 0.55); border: 2px solid rgba(255, 255, 255, 0.85); color: #fff;
  box-shadow: 0 0 30px rgba(47, 214, 188, 0.45);
}
.fp-video-boton svg { width: 28px; height: 28px; fill: currentColor; margin-left: 3px; }
.fp-video p { display: grid; gap: 2px; padding: 14px 16px; font-size: 0.84rem; color: var(--text-dim); }
.fp-video p b { color: var(--text); font-size: 0.92rem; }

/* especificaciones: tabla en dos columnas */
.fp-tabla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 36px; }
.fp-tabla div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--fp-borde); font-size: 0.86rem; }
.fp-tabla dt { color: var(--text-dim); }
.fp-tabla dd { font-weight: 600; }
.fp-docs ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.fp-docs a {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--fp-borde); border-radius: 9px;
  color: var(--text); text-decoration: none; font-size: 0.84rem; font-weight: 700; word-break: break-word;
}
.fp-docs a:hover { border-color: var(--teal); color: var(--teal-bright); }
.fp-doc-logo { width: 20px; height: 20px; flex-shrink: 0; object-fit: contain; }
.fp-docs small { font-size: 0.68rem; color: var(--text-dim); font-weight: 600; white-space: nowrap; flex-shrink: 0; } /* en móvil partía «PDF» en dos líneas */

/* aplicaciones */
.fp-app-ico { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 9px; border: 1px solid rgba(47, 214, 188, 0.4); color: var(--teal-bright); }
.fp-app-ico svg { width: 20px; height: 20px; }
.fp-apps-rejilla { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fp-apps-rejilla a {
  display: flex; align-items: center; gap: 12px; height: 100%; padding: 14px; border: 1px solid var(--fp-borde); border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 0.88rem; font-weight: 700;
}
.fp-apps-rejilla a:hover { border-color: var(--teal); }
.fp-apps-rejilla small { display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-dim); }
.fp-app-flecha { width: 16px; height: 16px; margin-left: auto; color: var(--teal-bright); flex-shrink: 0; }

/* accesorios */
.fp-acc-grupo h3:first-child { margin-top: 0; }
.fp-acc { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.fp-acc a { display: grid; gap: 6px; height: 100%; padding: 10px; border: 1px solid var(--fp-borde); border-radius: 10px; color: var(--text); text-decoration: none; }
.fp-acc a:hover { border-color: var(--teal); }
.fp-acc-foto { display: grid; place-items: center; aspect-ratio: 4 / 3; max-height: 130px; border-radius: 7px; background: #fff; overflow: hidden; }
.fp-acc-foto img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.fp-acc b { font-size: 0.74rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fp-acc small { font-size: 0.72rem; color: var(--text-dim); }

/* preguntas frecuentes */
.fp-faqs details { border-bottom: 1px solid var(--fp-borde); padding: 14px 4px; }
.fp-faqs details:first-child { padding-top: 0; }
.fp-faqs summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.fp-faqs summary::-webkit-details-marker { display: none; }
.fp-faqs summary::after { content: '+'; color: var(--teal-bright); font-size: 1.2rem; line-height: 1; }
.fp-faqs details[open] summary::after { content: '–'; }
.fp-faqs .rich { padding: 10px 0 4px; font-size: 0.92rem; }

/* resumen de especificaciones + aplicaciones */
.fp-resumen { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 24px; margin-bottom: 24px; }
.fp-resumen.sin-apps { grid-template-columns: minmax(0, 1fr); }
.fp-caja { border: 1px solid var(--fp-borde); border-radius: 14px; background: var(--fp-panel); padding: 24px 26px; }
.fp-caja h2 { font-family: inherit; font-size: 1.15rem; font-weight: 800; margin-bottom: 14px; }
.fp-mas { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--teal-bright); font-weight: 700; font-size: 0.85rem; text-decoration: none; }
.fp-mas svg { width: 15px; height: 15px; }
.fp-apps ul { list-style: none; display: grid; gap: 10px; }
.fp-apps a { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.fp-apps a:hover { color: var(--teal-bright); }

/* bandas finales */
.fp-bandas { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; margin-bottom: 70px; }
.fp-banda { position: relative; overflow: hidden; border: 1px solid rgba(47, 214, 188, 0.3); border-radius: 14px; background: var(--bg-raise); padding: 28px 30px; }
.fp-banda h2 { font-family: inherit; font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.fp-banda p { font-size: 0.88rem; color: var(--text-dim); margin-bottom: 20px; max-width: 46ch; }
.fp-banda-dudas { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 26px; align-items: center; padding: 0 30px 0 0; }
.fp-banda-dudas > img { width: 100%; height: 100%; min-height: 190px; object-fit: cover; -webkit-mask-image: linear-gradient(90deg, #000 60%, transparent); mask-image: linear-gradient(90deg, #000 60%, transparent); }
.fp-banda-dudas > div { padding: 26px 0; }
.fp-banda-dudas h2 { font-size: clamp(1.25rem, 1.8vw, 1.55rem); }

@media (max-width: 1100px) {
  .fp-apps-rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fp-claves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .fp-heroe, .fp-desc:has(.fp-video), .fp-resumen, .fp-bandas { grid-template-columns: minmax(0, 1fr); }

  /* las pestañas, en acordeón: cada cabecera a todo el ancho y su panel justo debajo
     (los botones y los paneles se intercalan con «order»; el script de pestañas no cambia) */
  .fp-pestanas { display: flex; flex-direction: column; overflow: hidden; }
  .fp-tabs { display: contents; }
  .fp-tabs button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 16px 20px; margin: 0;
    text-align: left; border: 0; border-top: 1px solid var(--fp-borde); border-radius: 0; background: transparent;
  }
  .fp-tabs button:first-of-type { border-top: 0; }
  .fp-tabs button[aria-selected="true"] { background: rgba(47, 214, 188, 0.06); }
  .fp-tabs button::after, .fp-tabs button[aria-selected="true"]::after { /* la flecha sustituye al subrayado de escritorio */
    content: ''; position: static; left: auto; right: auto; bottom: auto; margin-left: auto; width: 8px; height: 8px; margin-top: -4px; box-shadow: none; background: none;
    border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg);
    transition: transform 0.2s ease; flex-shrink: 0;
  }
  .fp-tabs button[aria-selected="true"]::after { transform: rotate(225deg); margin-top: 4px; }
  .fp-panel { padding: 6px 20px 26px; border-top: 0; }
  #tab-descripcion { order: 1; } #panel-descripcion { order: 2; }
  #tab-especificaciones { order: 3; } #panel-especificaciones { order: 4; }
  #tab-documentacion { order: 5; } #panel-documentacion { order: 6; }
  #tab-aplicaciones { order: 7; } #panel-aplicaciones { order: 8; }
  #tab-accesorios { order: 9; } #panel-accesorios { order: 10; }
  #tab-faqs { order: 11; } #panel-faqs { order: 12; }
  .fp-info { position: static; }
  .fp-tabla { grid-template-columns: minmax(0, 1fr); }
  .fp-banda-dudas { grid-template-columns: minmax(0, 1fr); padding: 0; }
  /* alto fijo (con height: 100 % Safari la estiraba hasta pisar el texto) y fundido hacia el texto */
  .fp-banda-dudas > img {
    height: 190px; min-height: 0;
    -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent);
  }
  .fp-banda-dudas > div { padding: 0 24px 26px; }
}
