html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

#inicio,
#academia,
#galeria,
#producto,
#locales,
#contacto {
  scroll-margin-top: 96px;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 86px;
  }

  .container {
    width: min(100% - 28px, 1180px);
  }

  .header {
    min-height: 74px;
  }

  .header-container {
    min-height: 74px;
    flex-direction: row;
    justify-content: center;
    padding: 0 14px;
  }

  .header-brand-text,
  .header-brand-image {
    display: none !important;
  }

  .logo-container img {
    width: 54px;
  }

  .social-links-header {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    z-index: 180;
    display: block !important;
    width: 100%;
    height: 38px;
    padding: 0;
    transform: none !important;
    pointer-events: none;
  }

  .social-links-header a {
    position: absolute;
    top: 0;
    width: 36px;
    height: 36px;
    pointer-events: auto;
  }

  .social-links-header a:nth-child(1) {
    left: 36px;
  }

  .social-links-header a:nth-child(2) {
    left: 96px;
  }

  .social-links-header a:nth-child(3) {
    right: 96px;
  }

  .social-links-header a:nth-child(4) {
    right: 36px;
  }

  .social-links-header svg {
    width: 16px;
    height: 16px;
  }

  .tubelight-navbar {
    top: calc(100dvh - 62px) !important;
    bottom: auto !important;
    left: 10px;
    right: 10px;
    width: auto;
    transform: none;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 14px 7px 7px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    border-radius: 22px;
  }

  .tubelight-navbar::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    padding: 10px 14px;
    font-size: 0.78rem;
    white-space: nowrap;
    scroll-snap-align: center;
  }

  .nav-item.active::before {
    top: -6px;
    width: 30px;
    height: 3px;
  }

  .nav-item.active::after {
    top: -14px;
    width: 58px;
    height: 24px;
  }

  .inicio-hero {
    min-height: 100svh;
    padding: 118px 18px 96px;
    align-items: center;
  }

  .inicio-logo {
    width: min(58vw, 250px);
    margin-bottom: 28px;
  }

  .inicio-hero-actions {
    width: min(100%, 360px);
    margin: 0 auto;
    gap: 8px;
  }

  .btn-reserva {
    width: 100%;
    padding: 15px 22px;
    font-size: 1rem;
    text-align: center;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats article {
    min-height: 132px;
    padding: 20px 12px;
  }

  .stats strong {
    font-size: 2rem;
  }

  .stats p {
    font-size: 0.66rem;
    letter-spacing: 0.1em;
  }

  .academia-section {
    padding: 86px 0 72px;
  }

  .academia-content > .locales-premium-tag,
  .gallery-heading .label,
  .product-kicker,
  .contact-panel-header span,
  .locales-premium-tag {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-align: center;
  }

  .academia-content > h2,
  .gallery-heading h2,
  .contact-panel-header h2,
  .locales-premium-intro h1 {
    width: fit-content;
    max-width: 100%;
    font-size: clamp(2.8rem, 15vw, 4.5rem);
    line-height: 0.92;
    text-align: center;
    white-space: normal;
  }

  .price-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .price-card,
  .price-card.featured {
    --base-lift: 0px;
    min-height: auto;
    padding: 28px 22px;
    border-radius: 20px;
  }

  .price-card h3 {
    font-size: 1.45rem;
  }

  .price-card strong {
    font-size: 2.35rem;
  }

  .price-card p,
  .price-card li {
    font-size: 0.95rem;
  }

  .gallery-section {
    min-height: auto;
    padding-top: 86px;
    padding-bottom: 150px;
  }

  .gallery-heading {
    margin-bottom: 18px;
  }

  .gallery-heading h2 {
    font-size: clamp(3rem, 19vw, 5rem);
  }

  .gallery-heading p:last-child {
    font-size: 0.94rem;
    padding: 0 8px;
  }

  .fan-gallery-shell {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "gallery gallery"
      "dots dots"
      "prev next"
      ;
    min-height: 500px;
    gap: 12px;
  }

  .fan-gallery {
    height: 395px;
  }

  .fan-card {
    width: min(62vw, 230px);
    height: min(88vw, 340px);
    border-radius: 14px;
  }

  .fan-prev {
    justify-self: end;
    transform: translateY(-140px);
  }

  .fan-next {
    justify-self: start;
    transform: translateY(-140px);
  }

  .fan-arrow {
    display: none;
  }

  .fan-arrow:hover {
    transform: translateY(-143px);
  }

  .fan-dots {
    margin-top: 0;
    margin-bottom: 2px;
  }

  .product-showcase {
    padding: 66px 0 150px;
  }

  .product-showcase-container {
    width: min(100% - 28px, 1180px);
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "carousel carousel"
      "prev next"
      "dots dots";
    gap: 12px;
  }

  .product-carousel {
    min-height: 820px;
    padding-top: 106px;
  }

  .product-carousel > .locales-premium-tag {
    left: 50% !important;
    max-width: calc(100vw - 32px);
    transform: translateX(-50%) !important;
    white-space: nowrap;
  }

  .product-carousel > h2 {
    top: 46px;
    left: 50% !important;
    width: calc(100vw - 32px);
    max-width: 358px;
    font-size: clamp(2.05rem, 10vw, 3rem);
    line-height: 0.92;
    text-align: center;
    white-space: normal;
    transform: translateX(-50%) !important;
  }

  .product-slide {
    grid-template-columns: 1fr;
    align-content: start;
    inset: 112px 0 0;
    gap: 12px;
    text-align: center;
  }

  .product-visual {
    min-height: 160px;
  }

  .product-ring {
    width: min(52vw, 195px);
  }

  .product-visual img {
    width: min(48vw, 180px);
    max-height: 185px;
  }

  .product-copy {
    text-align: center;
  }

  .product-copy h2 {
    margin-left: auto;
    margin-right: auto;
    max-width: 340px;
    font-size: clamp(1.62rem, 7.4vw, 2.25rem);
    line-height: 0.95;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .product-copy p {
    font-size: 0.86rem;
    line-height: 1.38;
  }

  .product-price {
    margin: 10px 0 12px;
    font-size: 1.95rem;
  }

  .product-buy-button {
    min-height: 50px;
    width: min(100%, 260px);
    margin-bottom: 10px;
  }

  .product-slide .product-copy {
    width: min(100%, 300px);
    margin-inline: auto;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .product-slide .product-copy > :not(.product-buy-button):not(.product-price) {
    grid-column: auto;
  }

  .product-slide .product-price {
    grid-column: 1 / -1;
    justify-self: center;
    text-align: center;
  }

  .product-slide .product-buy-button {
    min-height: 48px;
    width: 100%;
    margin: 0;
    padding: 8px 14px;
    font-size: 0.76rem;
    line-height: 1.25;
  }

  .product-prev {
    justify-self: end;
  }

  .product-next {
    justify-self: start;
  }

  .product-arrow {
    display: none;
  }

  .locales-premium {
    padding: 86px 14px 70px;
  }

  .locales-premium-intro {
    margin-bottom: 34px;
  }

  .locales-premium-intro h1 {
    font-size: clamp(3rem, 16vw, 4.8rem);
  }

  .locales-premium-intro p {
    font-size: 0.96rem;
  }

  .locales-premium-gallery {
    gap: 16px;
    margin-bottom: 38px;
  }

  .locales-premium-gallery figure {
    height: 250px;
    border-radius: 18px;
  }

  .local-block {
    margin-bottom: 28px;
  }

  .local-block-card {
    border-radius: 20px;
    gap: 0;
  }

  .local-block-info {
    padding: 24px 18px;
  }

  .local-block h2 {
    font-size: clamp(2.5rem, 14vw, 4.2rem);
  }

  .local-block-address {
    font-size: 0.96rem;
  }

  .local-block-box,
  .local-block-prices {
    padding: 18px;
    border-radius: 16px;
  }

  .local-block-prices div {
    gap: 12px;
    font-size: 0.92rem;
  }

  .local-block iframe {
    min-height: 280px;
  }

  .local-block-actions {
    padding: 18px;
  }

  .contact-section {
    padding: 70px 0 74px;
  }

  .contact-panel {
    width: calc(100% - 28px);
    padding: 26px 18px;
    border-radius: 20px;
  }

  .contact-panel-header {
    margin-bottom: 24px;
  }

  .contact-panel-header h2 {
    font-size: clamp(3rem, 17vw, 4.6rem);
    white-space: normal;
  }

  .contact-panel-header p {
    font-size: 0.96rem;
  }

  .contact-form-grid {
    grid-template-columns: 1fr;
  }

  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    border-radius: 14px;
    padding: 14px;
  }

  .footer {
    padding-bottom: 92px;
  }

  .galeria-prev,
  .galeria-next {
    display: none !important;
  }

  .galeria-modal-box {
    width: calc(100vw - 20px);
    height: min(82svh, 760px);
  }

  .galeria-modal-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    touch-action: pan-y;
  }

  .galeria-close {
    top: 12px;
    right: 12px;
  }
}

body.gallery-modal-open {
  overflow: hidden;
  touch-action: none;
}

@media (max-width: 420px) {
  .social-links-header {
    display: block !important;
  }

  .header-container {
    justify-content: center;
  }

  .inicio-logo {
    width: min(62vw, 230px);
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stats article {
    min-height: 108px;
  }

  .academia-content > h2,
  .gallery-heading h2,
  .contact-panel-header h2,
  .locales-premium-intro h1 {
    font-size: clamp(2.65rem, 17vw, 3.8rem);
  }

  .product-carousel {
    min-height: 820px;
  }

  .fan-gallery-shell {
    min-height: 470px;
  }

  .fan-gallery {
    height: 365px;
  }
}
/* iOS exige una pulsacion directa antes de permitir el movimiento del dispositivo. */
.gyro-permission {
  display: none;
}

@media (max-width: 768px) {
  .gyro-permission.is-visible {
    position: fixed;
    right: auto;
    left: 50%;
    bottom: calc(88px + env(safe-area-inset-bottom));
    z-index: 99990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 9px 14px 9px 10px;
    border: 1px solid rgba(224, 184, 52, 0.72);
    border-radius: 22px;
    background: rgba(6, 6, 6, 0.92);
    color: #f6d765;
    font: 700 0.78rem/1 Arial, sans-serif;
    letter-spacing: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
    transform: translateX(-50%);
    -webkit-tap-highlight-color: transparent;
  }

  .gyro-permission span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: #d8b52f;
    color: #080808;
    font-size: 0.7rem;
  }

  .gyro-permission.is-enabled {
    opacity: 0;
    transform: translateX(-50%) scale(0.92);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  .gyro-permission.is-denied {
    animation: gyroPermissionNudge 0.35s ease;
  }
}

@keyframes gyroPermissionNudge {
  0%,
  100% {
    transform: translateX(-50%);
  }

  40% {
    transform: translateX(calc(-50% - 5px));
  }

  70% {
    transform: translateX(calc(-50% + 4px));
  }
}
