/* Radio Eibiza — responsive and PWA additions */
:root {
  --eibiza-safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

.header {
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}

.header nav a,
.header .nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.pwa-install {
  position: fixed;
  z-index: 10020;
  top: 88px;
  right: max(18px, env(safe-area-inset-right, 0px));
  display: none;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(0, 232, 255, .58);
  border-radius: 999px;
  color: #fff;
  background: rgba(13, 8, 31, .94);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .34), 0 0 22px rgba(0, 232, 255, .16);
  font: 800 13px/1 system-ui, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.pwa-install.is-visible {
  display: inline-flex;
}

.pwa-install::before {
  content: "↓";
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #071018;
  background: linear-gradient(135deg, #00e8ff, #b84dff);
  font-size: 17px;
}

.pwa-install-message {
  position: fixed;
  z-index: 10030;
  left: 50%;
  bottom: calc(176px + var(--eibiza-safe-bottom));
  width: min(430px, calc(100% - 28px));
  transform: translateX(-50%);
  padding: 14px 48px 14px 16px;
  border: 1px solid rgba(0, 232, 255, .42);
  border-radius: 16px;
  color: #fff;
  background: rgba(12, 7, 28, .97);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .48);
  font: 700 14px/1.45 system-ui, sans-serif;
}

.pwa-install-message button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  font-size: 20px;
  cursor: pointer;
}

@media (max-width: 1080px) {
  .header nav.open,
  .header .nav.open {
    position: absolute;
    z-index: 10010;
    top: calc(100% + 8px);
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    display: grid !important;
    gap: 3px;
    max-height: min(72vh, 620px);
    padding: 12px;
    overflow-y: auto;
    border: 1px solid rgba(0, 232, 255, .28);
    border-radius: 18px;
    background: rgba(10, 6, 25, .98);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
    backdrop-filter: blur(18px);
  }

  .header nav.open a,
  .header .nav.open a {
    width: 100%;
    justify-content: flex-start;
    padding: 11px 14px;
    border-radius: 11px;
  }

  .pwa-install {
    top: 78px;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: calc(174px + var(--eibiza-safe-bottom));
  }

  main,
  .container,
  .page-shell,
  .page-wrap,
  .section-inner {
    min-width: 0;
  }

  .header {
    min-height: 66px;
  }

  .header .logo img,
  .header-logo img {
    max-height: 48px;
    width: auto;
  }

  input,
  select,
  textarea {
    max-width: 100%;
    font-size: 16px !important;
  }

  .grid,
  .cards,
  .radio-grid,
  .stations-grid,
  .partners-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .footer-player,
  #footerPlayer,
  .player-bar {
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(9px + var(--eibiza-safe-bottom));
  }

  #stationDropdown,
  .station-dropdown,
  .stations-dropdown {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(164px + var(--eibiza-safe-bottom)) !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(58vh, 480px) !important;
  }

  .pwa-install {
    top: auto;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(178px + var(--eibiza-safe-bottom));
    padding: 10px 13px;
  }

  .pwa-install-message {
    bottom: calc(178px + var(--eibiza-safe-bottom));
  }
}

@media (max-width: 420px) {
  .header {
    padding-left: 12px;
    padding-right: 12px;
  }

  h1 {
    overflow-wrap: anywhere;
  }

  .pwa-install {
    font-size: 12px;
  }
}

@media (display-mode: standalone) {
  .pwa-install {
    display: none !important;
  }
}

