/* shared/responsive.css — Altiora responsive foundation v54 */

@media (max-width: 1199px) {
  :root {
    --outer-gap: 20px;
    --country-panel-width: 320px;
  }

  .layout {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .sidebar {
    padding: 24px 20px 18px;
  }

  .mini-product {
    flex-basis: 156px;
  }

  .product-wordmark {
    font-size: 23px;
  }

  .product-wordmark.product-amd,
  .product-wordmark.product-aiservices {
    font-size: 20px;
  }

  .workspace-content {
    gap: 14px;
  }

  .preview-card {
    width: 292px;
    left: 20px;
  }
}

@media (max-width: 767px) {
  html,
  body {
    min-height: 100%;
    overflow-x: hidden;
  }

  body.has-mobile-menu,
  body.has-altiora-overlay {
    overflow: hidden;
  }

  .app {
    height: auto;
    min-height: 100dvh;
    display: block;
    overflow: visible;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: auto;
    min-height: 64px;
    padding: 10px 12px;
    gap: 10px;
    justify-content: space-between;
    overflow: visible;
  }

  .brand {
    gap: 10px;
    min-width: 0;
  }

  .brand-mark {
    width: 27px;
    height: 32px;
    flex: 0 0 auto;
  }

  .brand-title {
    font-size: 22px;
    letter-spacing: .02em;
  }

  .brand-sep,
  .brand-subtitle {
    display: none;
  }

  .header-right {
    gap: 8px;
    margin-left: auto;
  }

  .lang-switcher {
    height: 32px;
    padding: 2px;
  }

  .lang-btn {
    height: 26px;
    padding: 0 8px;
    font-size: 10px;
  }

  .theme-toggle {
    height: 34px;
    padding: 0 10px;
    font-size: 10px;
  }

  .nav {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .nav > a,
  .markets-theme-group > a {
    display: none;
  }

  .markets-theme-group {
    display: inline-flex;
  }

  .markets-theme-group .theme-toggle {
    display: inline-flex;
    height: 34px;
    padding: 0 10px;
    font-size: 10px;
    white-space: nowrap;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .layout {
    display: block;
    height: auto;
    min-height: calc(100dvh - 64px);
    overflow: visible;
  }

  .sidebar {
    display: none;
  }

  .main {
    display: block;
    height: auto;
    min-height: calc(100dvh - 64px);
    overflow: visible;
  }

  .metrics {
    height: auto;
    min-height: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 8px 10px;
    gap: 6px;
    overflow: visible;
  }

  .metric {
    min-height: 54px;
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 7px 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-align: center;
    background: rgba(255,255,255,.025);
  }

  .metric-icon {
    display: none;
  }

  .metric-label {
    font-size: 8.5px;
    margin-bottom: 0;
  }

  .metric-value {
    font-size: 17px;
  }

  .metric-note {
    display: none;
  }

  .workspace-content {
    display: block;
    min-height: 0;
    padding: 0 10px 12px;
  }

  .center-column {
    display: block;
    min-height: 0;
    overflow: visible;
  }

  .map-wrap {
    height: calc(100dvh - 170px);
    min-height: 410px;
    margin: 8px 0 0;
    --map-height: 108%;
    --map-overscan-x: 8%;
    --map-scale: 1;
    border-radius: 14px;
    clip-path: inset(0 round 14px);
  }

  .map-toolbar {
    top: 10px;
    left: 10px;
    right: 10px;
    transform: none;
    justify-content: flex-start;
  }

  .ghost-btn {
    height: 38px;
    padding: 0 12px;
    font-size: 10px;
  }

  .map-legend {
    top: 58px;
    left: 10px;
    max-width: calc(100% - 20px);
    gap: 6px;
  }

  .legend-item {
    font-size: 9px;
    padding: 5px 7px;
  }

  .zoom-controls {
    right: 10px;
    bottom: 10px;
  }

  .zoom-btn {
    width: 36px;
    height: 36px;
  }

  .footer-band {
    display: none;
  }

  .markets-panel-backdrop {
    position: fixed;
    z-index: 88;
  }

  .markets-panel {
    position: fixed;
    z-index: 89;
    inset: 10px !important;
    width: auto;
    max-height: none;
    border-radius: 16px;
  }

  .panel-head {
    padding: 16px 16px 10px;
  }

  .panel-controls {
    grid-template-columns: 1fr;
  }

  .filter-row {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .market-list {
    padding: 0 12px 14px;
  }

  .market-row {
    min-height: 62px;
  }

  .market-card,
  .preview-card {
    position: fixed;
    z-index: 76;
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    width: auto;
    max-height: 72dvh;
    margin: 0;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 -18px 50px rgba(0,0,0,.34);
  }

  .market-card.open,
  .preview-card.open {
    display: block;
  }

  .card-head {
    position: sticky;
    top: -16px;
    z-index: 2;
    padding-top: 4px;
    background: inherit;
  }

  .card-close,
  .panel-close {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .preview-title,
  .country-title {
    font-size: 18px;
  }

  .event-preview-cover {
    height: 116px;
  }

  .altiora-overlay {
    padding: 0 !important;
    align-items: stretch !important;
  }

  .altiora-modal,
  .altiora-modal.compact {
    width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
  }

  .altiora-modal-head {
    padding: 18px 16px 14px !important;
  }

  .altiora-modal-body {
    padding: 16px !important;
  }

  .altiora-catalog-grid,
  .altiora-catalog-grid.events {
    grid-template-columns: 1fr !important;
  }

  .altiora-catalog-actions {
    flex-direction: column;
  }

  .altiora-catalog-btn {
    min-height: 42px;
  }
}

@media (max-width: 479px) {
  .topbar {
    min-height: 58px;
    padding: 8px 10px;
  }

  .brand-title {
    font-size: 20px;
  }

  .lang-btn {
    padding: 0 6px;
  }

  .metrics {
    padding: 7px 8px;
  }

  .metric-value {
    font-size: 15px;
  }

  .map-wrap {
    height: calc(100dvh - 156px);
    min-height: 360px;
  }

  .market-card,
  .preview-card {
    max-height: 76dvh;
    left: 6px;
    right: 6px;
    bottom: 6px;
  }
}

/* Mobile menu component */
.altiora-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: none;
}

.altiora-mobile-menu.open {
  display: block;
}

.altiora-mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(8px);
}

.altiora-mobile-menu-panel {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  border: 1px solid var(--line-2, rgba(112,149,210,.24));
  border-radius: 18px;
  background: rgba(4, 12, 27, .94);
  box-shadow: 0 22px 68px rgba(0,0,0,.38);
  padding: 16px;
}

.altiora-mobile-menu-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.altiora-mobile-menu-title {
  margin: 0 0 5px;
  color: var(--text, #f5f8ff);
  font-size: 20px;
  line-height: 1.1;
}

.altiora-mobile-menu-subtitle {
  margin: 0;
  color: var(--muted, rgba(240,244,255,.62));
  font-size: 12px;
  line-height: 1.4;
}

.altiora-mobile-menu-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  background: rgba(255,255,255,.04);
  color: var(--muted, rgba(240,244,255,.72));
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.altiora-mobile-menu-actions {
  display: grid;
  gap: 8px;
}

.altiora-mobile-menu-actions button {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(255,255,255,.10));
  background: rgba(255,255,255,.045);
  color: var(--text, #f5f8ff);
  text-align: left;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

html[data-theme="light"] .altiora-mobile-menu-backdrop {
  background: rgba(8,20,38,.18);
}

html[data-theme="light"] .altiora-mobile-menu-panel {
  background: rgba(255,255,255,.96);
  border-color: rgba(25,48,82,.14);
  box-shadow: 0 22px 68px rgba(33,57,93,.18);
}

html[data-theme="light"] .altiora-mobile-menu-actions button,
html[data-theme="light"] .altiora-mobile-menu-close {
  background: rgba(244,248,255,.78);
  color: #0c1728;
  border-color: rgba(25,48,82,.12);
}


/* v55 — mobile bottom sheet refinement */
@media (max-width: 767px) {
  .header-right {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  .map-toolbar .ghost-btn {
    min-width: 92px;
  }

  .map-legend {
    flex-wrap: wrap;
    pointer-events: none;
  }

  .market-card,
  .preview-card {
    display: block;
    visibility: hidden;
    opacity: 0;
    transform: translateY(112%);
    transition: transform .24s ease, opacity .2s ease, visibility .2s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 28px;
  }

  .market-card.open,
  .preview-card.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .altiora-bottom-sheet.is-bottom-sheet-top {
    z-index: 78;
  }

  .altiora-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 74;
    display: none;
    border: 0;
    background: rgba(0, 0, 0, .24);
    backdrop-filter: blur(2px);
    padding: 0;
  }

  .altiora-sheet-backdrop.open {
    display: block;
  }

  html[data-theme="light"] .altiora-sheet-backdrop {
    background: rgba(8, 20, 38, .12);
  }

  .altiora-sheet-handle {
    position: sticky;
    top: -20px;
    left: 50%;
    z-index: 5;
    display: block;
    width: 48px;
    height: 24px;
    margin: -18px auto 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .altiora-sheet-handle::before {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 99px;
    background: rgba(240,244,255,.34);
  }

  html[data-theme="light"] .altiora-sheet-handle::before {
    background: rgba(12,23,40,.28);
  }

  .market-card .card-head,
  .preview-card .card-head {
    top: -28px;
  }

  body.has-bottom-sheet .zoom-controls {
    opacity: .35;
    pointer-events: none;
  }

  body.has-bottom-sheet .map-toolbar {
    opacity: .62;
  }

  .market-card .preview-actions,
  .preview-card .preview-actions {
    position: sticky;
    bottom: -16px;
    padding: 10px 0 0;
    background: linear-gradient(0deg, rgba(4,12,27,.96) 0%, rgba(4,12,27,.90) 72%, transparent 100%);
  }

  html[data-theme="light"] .market-card .preview-actions,
  html[data-theme="light"] .preview-card .preview-actions {
    background: linear-gradient(0deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.92) 72%, transparent 100%);
  }

  .card-cta,
  .preview-secondary,
  .view-link {
    min-height: 42px;
  }

  .market-product-carousel {
    min-height: 44px;
  }

  .country-card-carousel-controls {
    margin-top: 8px;
  }

  .event-market-row {
    align-items: flex-start;
  }
}

@media (max-width: 479px) {
  .header-right {
    gap: 6px;
  }

  .markets-theme-group .theme-toggle {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .map-toolbar .ghost-btn {
    min-width: 82px;
    padding: 0 10px;
  }

  .map-legend {
    top: 54px;
  }

  .legend-item {
    max-width: 110px;
  }
}


/* v56 — mobile first-screen quick actions and calmer initial state */
.mobile-quick-actions {
  display: none;
}

@media (max-width: 767px) {
  .mobile-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 10px 0;
  }

  .mobile-quick-actions button {
    min-width: 0;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line, rgba(255,255,255,.10));
    background: rgba(255,255,255,.045);
    color: var(--text, #f5f8ff);
    font: inherit;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    padding: 0 8px;
  }

  .mobile-quick-actions #mobilePriorityBtn {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    padding: 0 12px;
    background: rgba(255,189,90,.11);
    border-color: rgba(255,189,90,.22);
  }

  .mobile-quick-actions #mobilePriorityBtn span {
    color: var(--muted, rgba(240,244,255,.62));
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 9.5px;
  }

  .mobile-quick-actions #mobilePriorityBtn strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 650;
    color: var(--amber, #ffbd5a);
  }

  html[data-theme="light"] .mobile-quick-actions button {
    background: rgba(244,248,255,.78);
    color: #0c1728;
    border-color: rgba(25,48,82,.12);
  }

  html[data-theme="light"] .mobile-quick-actions #mobilePriorityBtn {
    background: rgba(255,189,90,.16);
    border-color: rgba(191,125,22,.22);
  }

  html[data-theme="light"] .mobile-quick-actions #mobilePriorityBtn span {
    color: rgba(12,23,40,.56);
  }

  html[data-theme="light"] .mobile-quick-actions #mobilePriorityBtn strong {
    color: #754604;
  }

  .workspace-content {
    padding-top: 8px;
  }

  .map-wrap {
    height: calc(100dvh - 232px);
    min-height: 330px;
  }
}

@media (max-width: 479px) {
  .mobile-quick-actions {
    gap: 6px;
    padding: 7px 8px 0;
  }

  .mobile-quick-actions button {
    min-height: 38px;
    font-size: 10.5px;
  }

  .map-wrap {
    height: calc(100dvh - 218px);
    min-height: 300px;
  }
}


/* v57 — mobile touch scroll fix */
@media (max-width: 767px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
  }

  body.has-mobile-menu,
  body.has-altiora-overlay {
    overflow: hidden;
    touch-action: none;
  }

  body.has-bottom-sheet {
    overflow-y: auto;
  }

  .app,
  .layout,
  .main,
  .workspace-content,
  .center-column {
    height: auto;
    overflow: visible;
    touch-action: pan-y;
  }

  .map-wrap,
  .map-stage,
  #world-map {
    touch-action: pan-y;
  }

  .country,
  .fallback-marker {
    touch-action: manipulation;
  }

  .market-card,
  .preview-card,
  .markets-panel,
  .market-list,
  .events-list,
  .altiora-modal-body,
  .altiora-catalog-grid,
  .altiora-mobile-menu-panel {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .market-card.open,
  .preview-card.open {
    overflow-y: auto;
  }

  .markets-panel.open {
    overflow: hidden;
  }

  .markets-panel .market-list {
    overflow-y: auto;
  }

  .altiora-overlay.open {
    touch-action: none;
  }

  .altiora-modal {
    touch-action: pan-y;
  }

  .altiora-modal-body {
    overflow-y: auto;
  }

  .altiora-sheet-backdrop,
  .markets-panel-backdrop,
  .altiora-mobile-menu-backdrop {
    touch-action: none;
  }
}


/* v58 — mobile header with real logo */
@media (max-width: 767px) {
  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-right {
    flex: 0 0 auto;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}
