
:root {
  --ib-dir-f: rgba(245, 158, 11, 0.2);     --ib-dir-t: #fcd34d;
  --ib-test-f: rgba(253, 164, 175, 0.2);   --ib-test-t: #fda4af;
  --ib-grupos-f: rgba(37, 211, 102, 0.18); --ib-grupos-t: #5ee38f;
  --ib-pisos-f: rgba(147, 197, 253, 0.18); --ib-pisos-t: #93c5fd;
  --ib-promo-f: rgba(196, 181, 253, 0.18); --ib-promo-t: #c4b5fd;
  --ib-rest-f: rgba(253, 186, 116, 0.19);  --ib-rest-t: #fdba74;
  --ib-bar-f: rgba(250, 204, 21, 0.15);    --ib-bar-t: #fde047;
  --ib-cafe-f: rgba(231, 199, 164, 0.18);  --ib-cafe-t: #e7c7a4;
  --ib-ocio-f: rgba(196, 181, 253, 0.18);  --ib-ocio-t: #c4b5fd;
  --ib-dep-f: rgba(125, 211, 252, 0.18);   --ib-dep-t: #7dd3fc;
  --ib-bel-f: rgba(249, 168, 212, 0.18);   --ib-bel-t: #f9a8d4;
  --ib-tie-f: rgba(94, 234, 212, 0.17);    --ib-tie-t: #5eead4;
  --ib-otro-f: rgba(212, 212, 216, 0.13);  --ib-otro-t: #d4d4d8;
  --ib-velo: rgba(0, 0, 0, 0.55);
  --ib-sombra: 0 24px 48px -20px rgba(0, 0, 0, 0.7);
}
@media (prefers-color-scheme: light) {
  :root {
    --ib-dir-f: rgba(217, 119, 6, 0.13);    --ib-dir-t: #b45309;
    --ib-test-f: rgba(225, 29, 72, 0.12);   --ib-test-t: #be123c;
    --ib-grupos-f: rgba(22, 163, 74, 0.13); --ib-grupos-t: #15803d;
    --ib-pisos-f: rgba(37, 99, 235, 0.12);  --ib-pisos-t: #1e40af;
    --ib-promo-f: rgba(124, 58, 237, 0.12); --ib-promo-t: #6d28d9;
    --ib-rest-f: rgba(234, 88, 12, 0.12);   --ib-rest-t: #c2410c;
    --ib-bar-f: rgba(202, 138, 4, 0.14);    --ib-bar-t: #a16207;
    --ib-cafe-f: rgba(146, 64, 14, 0.11);   --ib-cafe-t: #92400e;
    --ib-ocio-f: rgba(124, 58, 237, 0.12);  --ib-ocio-t: #6d28d9;
    --ib-dep-f: rgba(2, 132, 199, 0.12);    --ib-dep-t: #0369a1;
    --ib-bel-f: rgba(219, 39, 119, 0.12);   --ib-bel-t: #be185d;
    --ib-tie-f: rgba(13, 148, 136, 0.12);   --ib-tie-t: #0f766e;
    --ib-otro-f: rgba(82, 82, 91, 0.1);     --ib-otro-t: #52525b;
    --ib-velo: rgba(25, 23, 20, 0.35);
    --ib-sombra: 0 24px 48px -22px rgba(25, 23, 20, 0.35);
  }
}
:root[data-theme="dark"] {
  --ib-dir-f: rgba(245, 158, 11, 0.2);     --ib-dir-t: #fcd34d;
  --ib-test-f: rgba(253, 164, 175, 0.2);   --ib-test-t: #fda4af;
  --ib-grupos-f: rgba(37, 211, 102, 0.18); --ib-grupos-t: #5ee38f;
  --ib-pisos-f: rgba(147, 197, 253, 0.18); --ib-pisos-t: #93c5fd;
  --ib-promo-f: rgba(196, 181, 253, 0.18); --ib-promo-t: #c4b5fd;
  --ib-rest-f: rgba(253, 186, 116, 0.19);  --ib-rest-t: #fdba74;
  --ib-bar-f: rgba(250, 204, 21, 0.15);    --ib-bar-t: #fde047;
  --ib-cafe-f: rgba(231, 199, 164, 0.18);  --ib-cafe-t: #e7c7a4;
  --ib-ocio-f: rgba(196, 181, 253, 0.18);  --ib-ocio-t: #c4b5fd;
  --ib-dep-f: rgba(125, 211, 252, 0.18);   --ib-dep-t: #7dd3fc;
  --ib-bel-f: rgba(249, 168, 212, 0.18);   --ib-bel-t: #f9a8d4;
  --ib-tie-f: rgba(94, 234, 212, 0.17);    --ib-tie-t: #5eead4;
  --ib-otro-f: rgba(212, 212, 216, 0.13);  --ib-otro-t: #d4d4d8;
  --ib-velo: rgba(0, 0, 0, 0.55);
  --ib-sombra: 0 24px 48px -20px rgba(0, 0, 0, 0.7);
}
:root[data-theme="light"] {
  --ib-dir-f: rgba(217, 119, 6, 0.13);    --ib-dir-t: #b45309;
  --ib-test-f: rgba(225, 29, 72, 0.12);   --ib-test-t: #be123c;
  --ib-grupos-f: rgba(22, 163, 74, 0.13); --ib-grupos-t: #15803d;
  --ib-pisos-f: rgba(37, 99, 235, 0.12);  --ib-pisos-t: #1e40af;
  --ib-promo-f: rgba(124, 58, 237, 0.12); --ib-promo-t: #6d28d9;
  --ib-rest-f: rgba(234, 88, 12, 0.12);   --ib-rest-t: #c2410c;
  --ib-bar-f: rgba(202, 138, 4, 0.14);    --ib-bar-t: #a16207;
  --ib-cafe-f: rgba(146, 64, 14, 0.11);   --ib-cafe-t: #92400e;
  --ib-ocio-f: rgba(124, 58, 237, 0.12);  --ib-ocio-t: #6d28d9;
  --ib-dep-f: rgba(2, 132, 199, 0.12);    --ib-dep-t: #0369a1;
  --ib-bel-f: rgba(219, 39, 119, 0.12);   --ib-bel-t: #be185d;
  --ib-tie-f: rgba(13, 148, 136, 0.12);   --ib-tie-t: #0f766e;
  --ib-otro-f: rgba(82, 82, 91, 0.1);     --ib-otro-t: #52525b;
  --ib-velo: rgba(25, 23, 20, 0.35);
  --ib-sombra: 0 24px 48px -22px rgba(25, 23, 20, 0.35);
}

.ib { display: flex; align-items: center; justify-content: center; padding-block: 8px; }
.ib-marco { width: 100%; max-width: 460px; aspect-ratio: 100 / var(--alto, 124); }
.ib-lienzo { position: relative; width: 100%; height: 100%; container-type: inline-size; }
.ib-grupo { position: absolute; inset: 0; }
.ib-grupo-dir { visibility: hidden; }
.ib[data-cats] .ib-grupo-dir { visibility: visible; }
.ib[data-estado="directorio"] .ib-grupo-inicio { visibility: hidden; }
.ib[data-estado="abriendo"] .ib-b, .ib[data-estado="cerrando"] .ib-b { pointer-events: none; }

.ib-b {
  position: absolute;
  left: calc((var(--x) - var(--d) / 2) * 1cqw); top: calc((var(--y) - var(--d) / 2) * 1cqw);
  width: calc(var(--d) * 1cqw); height: calc(var(--d) * 1cqw);
  padding: 0; border: 0; background: none; color: var(--b-t); font: inherit; text-decoration: none; cursor: pointer;
  -webkit-user-select: none; user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transform: translate(calc(var(--px, 0) * 1px), calc(var(--py, 0) * 1px)) scale(var(--s, 1));
  transition: transform 0.5s cubic-bezier(.2, .8, .2, 1);
}
.ib-forma { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ib-forma::before {
  content: ""; position: absolute; inset: 3%; background: var(--b-f);
  border-radius: var(--guijarro, 68% 32% 55% 45% / 42% 58% 42% 58%); transform: rotate(var(--giro, -8deg));
  transition: border-radius 0.6s ease, transform 0.6s ease;
}
.ib-forma svg {
  position: relative; width: 36%; height: 36%;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.ib-b.es-tocada .ib-forma::before { border-radius: 46% 54% 38% 62% / 55% 40% 60% 45%; transform: rotate(10deg) scale(1.04); }
.ib-b.es-tocada { --s: 0.95; transition-duration: 0.15s; }
@media (hover: hover) {
  .ib-b:hover .ib-forma::before { border-radius: 46% 54% 38% 62% / 55% 40% 60% 45%; transform: rotate(10deg) scale(1.04); }
}
.ib-et {
  position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); white-space: nowrap;
  font: 700 clamp(12.5px, calc(var(--d) * 0.1cqw), 15px)/1.2 var(--al-sans); color: var(--al-tinta); letter-spacing: -0.005em;
}
.ib-b:focus-visible { outline: none; }
.ib-b:focus-visible .ib-forma::before { outline: 2px solid var(--al-coral); outline-offset: 3px; }
.ib-b.es-pronto .ib-forma { opacity: 0.5; }
.ib-b.es-pronto .ib-et { color: var(--al-tinta-2); }
.ib-b[aria-disabled] { cursor: default; }

.ib-t-dir     { --b-f: var(--ib-dir-f);    --b-t: var(--ib-dir-t); }
.ib-t-test    { --b-f: var(--ib-test-f);   --b-t: var(--ib-test-t);   --guijarro: 38% 62% 44% 56% / 60% 38% 62% 40%; --giro: 7deg; }
.ib-t-grupos  { --b-f: var(--ib-grupos-f); --b-t: var(--ib-grupos-t); --guijarro: 57% 43% 63% 37% / 37% 62% 38% 63%; --giro: -5deg; }
.ib-t-pisos   { --b-f: var(--ib-pisos-f);  --b-t: var(--ib-pisos-t);  --guijarro: 44% 56% 35% 65% / 58% 42% 60% 40%; --giro: 9deg; }
.ib-t-promo   { --b-f: var(--ib-promo-f);  --b-t: var(--ib-promo-t);  --guijarro: 38% 62% 44% 56% / 60% 38% 62% 40%; --giro: -6deg; }
.ib-c-restaurante { --b-f: var(--ib-rest-f); --b-t: var(--ib-rest-t); }
.ib-c-bar       { --b-f: var(--ib-bar-f);  --b-t: var(--ib-bar-t);  --guijarro: 44% 56% 35% 65% / 58% 42% 60% 40%; --giro: 9deg; }
.ib-c-cafeteria { --b-f: var(--ib-cafe-f); --b-t: var(--ib-cafe-t); --guijarro: 57% 43% 63% 37% / 37% 62% 38% 63%; --giro: -5deg; }
.ib-c-ocio      { --b-f: var(--ib-ocio-f); --b-t: var(--ib-ocio-t); --guijarro: 38% 62% 44% 56% / 60% 38% 62% 40%; --giro: 7deg; }
.ib-c-deporte   { --b-f: var(--ib-dep-f);  --b-t: var(--ib-dep-t);  --guijarro: 57% 43% 63% 37% / 37% 62% 38% 63%; --giro: -5deg; }
.ib-c-belleza   { --b-f: var(--ib-bel-f);  --b-t: var(--ib-bel-t);  --guijarro: 44% 56% 35% 65% / 58% 42% 60% 40%; --giro: 9deg; }
.ib-c-tienda    { --b-f: var(--ib-tie-f);  --b-t: var(--ib-tie-t); }
.ib-c-otro      { --b-f: var(--ib-otro-f); --b-t: var(--ib-otro-t); --guijarro: 38% 62% 44% 56% / 60% 38% 62% 40%; --giro: 7deg; }
.ib-volver { --b-f: var(--ib-otro-f); --b-t: var(--al-tinta-2); --guijarro: 57% 43% 63% 37% / 37% 62% 38% 63%; --giro: -5deg; }
.ib-volver .ib-forma { opacity: 0.8; }
.ib-volver .ib-forma svg { width: 46%; height: 46%; stroke-width: 1.8; }

.ib-chispa { position: absolute; border-radius: 50%; pointer-events: none; }
#fabReportarBug { transition: opacity 0.2s ease; }
body:has(.ib[data-cats]) #fabReportarBug, body:has(.ib-hoja:not([hidden])) #fabReportarBug { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: no-preference) {
  .ib-grupo-inicio .ib-forma { animation: ib-entra 0.6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
  .ib-grupo-inicio .ib-et { animation: ib-entra-et 0.5s ease both; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
  @keyframes ib-entra { from { opacity: 0; transform: scale(0.8); } }
  @keyframes ib-entra-et { from { opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .ib-b, .ib-forma::before { transition: none; }
}

.ib-fondo { position: fixed; inset: var(--ib-cab, 61px) 0 var(--ib-barra, 0px); z-index: 1036; background: var(--ib-velo); }
.ib-hoja {
  position: fixed; z-index: 1037; top: var(--ib-cab, 61px); left: 0; right: 0; bottom: var(--ib-barra, 0px); margin: 0 auto; max-width: 560px;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 0 max(18px, env(safe-area-inset-right, 0px)) 24px max(18px, env(safe-area-inset-left, 0px));
  background: var(--al-noche); color: var(--al-tinta); font-family: var(--al-sans);
}
.ib-hoja-cab {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px;
  margin: 0 -2px 6px; padding: 14px 2px 12px; background: var(--al-noche);
}
.ib-hoja-ic { position: relative; flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--b-t); }
.ib-hoja-ic::before { content: ""; position: absolute; inset: 2px; background: var(--b-f); border-radius: 68% 32% 55% 45% / 42% 58% 42% 58%; transform: rotate(-8deg); }
.ib-hoja-ic svg { position: relative; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ib-hoja-tit { flex: 1; min-width: 0; margin: 0; font: 800 1.35rem/1.05 var(--al-display); letter-spacing: -0.02em; color: var(--al-tinta); }
.ib-cerrar {
  flex: none; width: 40px; height: 40px; margin-left: -6px; border-radius: 50%; border: 0; background: none;
  color: var(--al-tinta); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.ib-cerrar:hover { background: var(--al-hairline); }
.ib-cerrar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ib-cerrar:focus-visible { outline: 2px solid var(--al-coral); outline-offset: 2px; }
.ib-filas .al-fila:last-child { border-bottom: 0; }

@media (min-width: 992px) {
  .al-hub:has(> .ib) {
    max-width: 1640px;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    column-gap: clamp(40px, 4vw, 88px);
    padding: 40px clamp(40px, 4vw, 80px) 48px;
    --al-hero-alto: clamp(440px, calc(100vh - 280px), 760px);
    --ib-arriba: 72px;
  }
  .al-hub:has(> .ib) .al-saludo,
  .al-hub:has(> .ib) .al-nota,
  .al-hub:has(> .ib) .al-card { grid-column: 1; }
  .al-hub:has(> .ib) > .ib { grid-column: 2; grid-row: 1 / span 6; align-self: center; padding-block: 0; }
  .al-hub:has(> .ib) .ib-marco { max-width: none; width: min(100%, calc((var(--al-hero-alto) + var(--ib-arriba)) * 100 / var(--alto))); }
  .al-hub:has(> .ib):not(:has(.al-carrusel .al-slide)) { grid-template-columns: minmax(0, 760px); justify-content: start; }
  .al-hub:has(> .ib):not(:has(.al-carrusel .al-slide)) > .ib { grid-column: 1; grid-row: auto; align-self: start; }
  .al-hub:has(> .ib):not(:has(.al-carrusel .al-slide)) .ib-marco { width: min(100%, calc((100vh - 260px) * 100 / var(--alto))); }
  .ib { padding-block: 0 24px; }
  .ib-hoja { border-left: 1px solid var(--al-hairline); border-right: 1px solid var(--al-hairline); box-shadow: var(--ib-sombra); }
}
