/*
 * v3.5.3 — phone-only Safety Poster configurator repair.
 * Desktop remains governed by the active Telly Safety theme.
 */
@media (max-width: 767px) {
  .telly-poster-lightbox:not([hidden]) {
    display: block !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 10px !important;
    align-items: initial !important;
    justify-content: initial !important;
  }

  .telly-poster-lightbox-backdrop {
    position: fixed !important;
  }

  .telly-poster-lightbox-dialog {
    display: block !important;
    width: min(430px, calc(100vw - 20px)) !important;
    height: auto !important;
    min-height: calc(100dvh - 20px) !important;
    max-height: none !important;
    margin: 0 auto 10px !important;
    overflow: visible !important;
    border-radius: 20px !important;
  }

  .telly-poster-lightbox-preview-column {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    padding: 54px 18px 20px !important;
    text-align: center !important;
  }

  .telly-poster-lightbox-media {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    touch-action: pan-y;
  }

  .telly-poster-lightbox-dialog .telly-poster-lightbox-media img {
    display: block !important;
    width: min(100%, 360px) !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center top !important;
    border-radius: 12px !important;
  }

  .telly-poster-lightbox-info {
    width: 100% !important;
    padding: 18px 4px 0 !important;
    text-align: center !important;
    align-self: auto !important;
    justify-content: flex-start !important;
  }

  .telly-poster-lightbox-info h2 {
    font-size: 1.35rem !important;
  }

  .poster-config-panel {
    overflow: visible !important;
    min-height: 0 !important;
  }

  .poster-config-scroll {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 20px !important;
  }

  .poster-language-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 440px) {
  .poster-language-grid,
  .config-language-qty-grid {
    grid-template-columns: 1fr !important;
  }
}
