/* CMP del IETEC El Caroig (basado en el de Reductores/Aluminio). Autocontenido: no depende de style.css salvo las fuentes de la web. */
.cmp, .cmp *, .cmp *::before, .cmp *::after { box-sizing: border-box; }
.cmp {
  --cmp-ink: #5a4128; --cmp-mute: #5b6470; --cmp-acc: #98672a; --cmp-dark: #5a4128; --cmp-line: #e0d3a8; --cmp-tint: #f7edc9;
  font-family: 'Lato', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--cmp-ink);
}
.cmp p { margin: 0; }
.cmp-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #f7edc9; color: #98672a; }
.cmp-title { font: 700 15px/1.3 'Poppins', system-ui, sans-serif; color: var(--cmp-ink); }
.cmp-text { font-size: 14px; line-height: 1.5; color: var(--cmp-mute); }
.cmp-text a, .cmp-dlg-m a { color: var(--cmp-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.cmp a:focus-visible, .cmp button:focus-visible, .cmp input:focus-visible + .cmp-sw-ui { outline: 3px solid #98672a; outline-offset: 2px; }

/* botones: Aceptar y Rechazar con el mismo tamaño y peso visual */
.cmp-actions { flex: none; display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-btn {
  appearance: none; -webkit-appearance: none; cursor: pointer; min-height: 44px; padding: 10px 20px; border-radius: 999px;
  border: 1.5px solid var(--cmp-dark); background: #fff; color: var(--cmp-dark);
  font: 600 13px/1.2 'Poppins', system-ui, sans-serif; white-space: nowrap; transition: background-color .15s, color .15s, transform .15s;
}
.cmp-btn:hover { background: var(--cmp-tint); }
.cmp-btn--main { background: var(--cmp-dark); color: #fff; }
.cmp-btn--main:hover { background: #5a4128; }
.cmp-btn--alt { background: #f3ead0; }
.cmp-btn--alt:hover { background: #ece0b4; }
.cmp-btn--ghost { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; padding-inline: 12px; }
.cmp-btn--ghost:hover { background: var(--cmp-tint); }

/* ---- banner: variante A (barra) y B (tarjeta) ---- */
.cmp-banner {
  position: fixed; z-index: 1190; display: flex; align-items: center; gap: 16px; padding: 14px 18px 14px 16px;
  background: #fff; border: 1px solid var(--cmp-line); border-top: 3px solid var(--cmp-acc);
  box-shadow: 0 26px 46px -22px rgba(90, 65, 40, .55), 0 2px 8px rgba(90, 65, 40, .1);
  animation: cmp-in .28s ease-out both;
}
.cmp--bar { left: 12px; right: 12px; bottom: 12px; max-width: 1140px; margin: 0 auto; border-radius: 18px; }
.cmp--bar .cmp-body { flex: 1 1 auto; min-width: 0; }
.cmp--card { left: 16px; bottom: 16px; width: 396px; /*c*/ width: min(396px, calc(100vw - 32px)); flex-direction: column; align-items: stretch; gap: 12px; padding: 18px; border-radius: 22px; }
.cmp--card .cmp-ico { width: 38px; height: 38px; }
.cmp--card .cmp-actions .cmp-btn--main, .cmp--card .cmp-actions .cmp-btn--alt { flex: 1 1 calc(50% - 4px); order: 1; }
.cmp--card .cmp-actions .cmp-btn--ghost { flex: 1 1 100%; order: 2; }
@keyframes cmp-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* el botón «subir» no queda tapado por el banner */
html.cmp-on #gotoTop { bottom: 112px !important; }

/* ---- diálogo de preferencias ---- */
.cmp-ov { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1200; display: grid; place-items: center; padding: 16px; background: transparent; animation: cmp-fade .18s ease-out both; }
.cmp-dlg { width: 580px; /*c*/ width: min(580px, 100%); max-height: 90vh; /*c*/ max-height: min(90vh, 740px); overflow: auto; padding: 20px 22px 18px; border-radius: 22px; border: 1px solid var(--cmp-line); border-top: 4px solid var(--cmp-acc); background: #fff; box-shadow: 0 34px 70px -22px rgba(90, 65, 40, .5), 0 4px 18px rgba(90, 65, 40, .14); outline: 0; }
.cmp-dlg-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cmp-dlg-h h2 { margin: 0; font: 700 20px/1.25 'Poppins', system-ui, sans-serif; color: var(--cmp-ink); }
.cmp-x { appearance: none; flex: none; width: 44px; height: 44px; margin: -8px -10px 0 0; border: 0; border-radius: 50%; background: transparent; color: var(--cmp-dark); font: 400 28px/1 'Lato', sans-serif; cursor: pointer; }
.cmp-x:hover { background: var(--cmp-tint); }
.cmp-dlg-i { margin: 6px 0 14px; font-size: 14px; line-height: 1.5; color: var(--cmp-mute); }
.cmp-it { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--cmp-line); border-radius: 16px; background: #fff; }
.cmp-it + .cmp-it { margin-top: 10px; }
.cmp-it-tx { flex: 1 1 auto; min-width: 0; }
.cmp-it h3 { margin: 0 0 3px; font: 600 14px/1.3 'Poppins', system-ui, sans-serif; color: var(--cmp-ink); }
.cmp-it p { font-size: 13.5px; line-height: 1.45; color: var(--cmp-mute); }
.cmp-fixed { flex: none; padding: 4px 10px; border-radius: 999px; background: #f3ead0; color: var(--cmp-dark); font: 600 11.5px/1.4 'Poppins', sans-serif; white-space: nowrap; }
.cmp-sw { position: relative; flex: none; display: inline-block; width: 50px; height: 30px; cursor: pointer; }
.cmp-sw input { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cmp-sw-ui { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 999px; background: #cfc39a; transition: background-color .15s; }
.cmp-sw-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .15s; }
.cmp-sw input:checked + .cmp-sw-ui { background: var(--cmp-dark); }
.cmp-sw input:checked + .cmp-sw-ui::after { transform: translateX(20px); }
.cmp-dlg-f { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.cmp-dlg-m { margin-top: 12px; font-size: 13px; text-align: right; }
@keyframes cmp-fade { from { opacity: 0; } to { opacity: 1; } }
html.cmp-lock { overflow: hidden; }

/* ---- marcador de contenido externo (mapa, vídeo) ---- */
.cmp-embed {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 100%; min-height: 320px; padding: 26px 20px; text-align: center;
  background: repeating-linear-gradient(135deg, #fbf7ea 0 14px, #faf3dc 14px 28px); border-radius: inherit;
}
.cmp-embed .cmp-text { max-width: 46ch; }
.cmp-embed .cmp-actions { justify-content: center; }


/* ---- vídeo de Vimeo en ventana propia ---- */
.cmp-dlg--sm { width: 480px; /*c*/ width: min(480px, 100%); }
.cmp-vid { background: #5a4128; }
.cmp-vid-box { position: relative; width: 960px; /*c*/ width: min(960px, 100%); aspect-ratio: 16 / 9; border-radius: 16px; background: #000; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); outline: 0; }
.cmp-vid-box iframe { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; border: 0; border-radius: 16px; }
.cmp-vid-x { position: absolute; top: -52px; right: -6px; margin: 0; color: #fff; }
.cmp-vid-x:hover { background: rgba(255, 255, 255, .16); }

/* ---- móvil ---- */
@media (max-width: 767.98px) {
  .cmp--bar { left: 8px; right: 8px; bottom: 8px; flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; }
  .cmp--bar .cmp-ico { display: none; }
  .cmp--card { left: 8px; bottom: 8px; width: calc(100vw - 16px); padding: 14px; }
  .cmp--card .cmp-ico { display: none; }
  .cmp-banner .cmp-actions { flex-wrap: wrap; gap: 6px; }
  .cmp-banner .cmp-actions .cmp-btn { flex: 1 1 88px; min-width: 0; padding-inline: 8px; }
  .cmp-banner .cmp-actions .cmp-btn--ghost { order: 0; }
  .cmp-text { font-size: 13.5px; }
  html.cmp-on #gotoTop { bottom: 168px !important; }
  .cmp-dlg-f .cmp-btn { flex: 1 1 100%; }
  .cmp-dlg-m { text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .cmp-banner, .cmp-ov { animation: none; } .cmp-btn, .cmp-sw-ui, .cmp-sw-ui::after { transition: none; } }

/* ---- IETEC: filete superior y botón de reproducir en caramelo ---- */
.cmp { --cmp-red: #98672a; }
.cmp-banner, .cmp-dlg { border-top: 3px solid var(--cmp-red); }
.cmp-btn--main { background: #98672a; border-color: #98672a; color: #fff; }
.cmp-btn--main:hover { background: #5a4128; border-color: #5a4128; }
.fx-embed > .cmp-embed { position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: 0; overflow: auto; }
/* botones del diálogo siempre a la vista (en móvil el contenido hace scroll dentro del diálogo) */
.cmp-dlg-f { position: sticky; bottom: -1px; z-index: 2; padding: 12px 0 4px; background: #fff; box-shadow: 0 -12px 14px -12px rgba(90, 65, 40, .28); }

/* ---- vídeo con portada propia (botón de reproducir) ---- */
.cmp-embed.cmp-poster { position: relative; display: block; width: 100%; height: 100%; min-height: 0; padding: 0; overflow: hidden; text-align: left; background: #5a4128; cursor: pointer; }
.cmp-poster-img { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cmp-poster:hover .cmp-poster-img { transform: scale(1.04); }
.cmp-poster::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, rgba(46, 34, 22, .1) 30%, rgba(46, 34, 22, .88) 100%); pointer-events: none; }
.cmp-play { position: absolute; top: 46%; left: 50%; z-index: 2; display: grid; place-items: center; width: 74px; height: 74px; margin: -37px 0 0 -37px; padding: 0; border: 0; border-radius: 50%; background: #98672a; color: #fff; cursor: pointer; box-shadow: 0 0 0 8px rgba(255, 255, 255, .28), 0 16px 30px -10px rgba(0, 0, 0, .75); transition: transform .2s, box-shadow .2s; }
.cmp-play svg { width: 32px; height: 32px; margin-left: 4px; fill: currentColor; }
.cmp-poster:hover .cmp-play, .cmp-play:focus { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 255, 255, .34), 0 18px 32px -10px rgba(0, 0, 0, .8); }
.cmp-pbar { position: absolute; right: 0; bottom: 0; left: 0; z-index: 2; padding: 10px 14px 11px; color: rgba(255, 255, 255, .9); font: 400 .6875rem/1.5 "Lato", sans-serif; cursor: default; }
.cmp-pbar span { display: block; }
.cmp-pbar a, .cmp-pbar button { display: inline; margin: 0; padding: 0; border: 0; background: none; color: #fff; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.cmp-pbar a:hover, .cmp-pbar button:hover { color: #f3da9a; }
@media (max-width: 575.98px) { .cmp-play { width: 62px; height: 62px; margin: -31px 0 0 -31px; } }
@media (prefers-reduced-motion: reduce) { .cmp-poster-img, .cmp-play { transition: none; } }

/* mapa de la página Sede: recuadro hasta que se acepta y mapa a ancho completo después */
.map-box { max-width: 720px; margin: 24px auto 0; }
.map-box iframe { display: block; width: 100%; height: 450px; border: 0; border-radius: 14px; }
.map-box .cmp-embed { min-height: 300px; border-radius: 14px; }
