/* shared/entity-overlay.css — mobile entity overlay, catalog-style container v94 */

.altiora-entity-overlay {
  display: none;
}

@media (max-width: 767px) {
  body.has-entity-overlay {
    overflow: hidden !important;
    touch-action: none !important;
  }

  .altiora-entity-overlay {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: none;
    pointer-events: none;
  }

  .altiora-entity-overlay.open {
    display: block;
    pointer-events: auto;
  }

  .altiora-entity-overlay-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(0,0,0,.54);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
  }

  .altiora-entity-overlay-panel {
    position: absolute;
    inset: 0;
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    background: #050f20;
    color: var(--text, #fff);
    border: 0;
    padding: 0;
  }

  .altiora-entity-overlay-content {
    min-height: 100dvh;
    padding: 16px 14px 18px;
    background: #050f20;
    color: var(--text, #fff);
  }

  .altiora-entity-overlay .altiora-entity-head {
    position: sticky;
    top: -16px;
    z-index: 8;
    margin: -16px -14px 12px;
    padding: 16px 14px 12px;
    background: #050f20;
    border-bottom: 1px solid rgba(112,149,210,.14);
  }

  .altiora-entity-overlay .altiora-entity-actions {
    position: sticky;
    bottom: -18px;
    margin: 14px -14px -18px;
    padding: 12px 14px 18px;
    background: #050f20;
    border-top: 1px solid rgba(112,149,210,.14);
    display: grid;
    gap: 8px;
  }

  .altiora-entity-overlay .altiora-entity-section,
  .altiora-entity-overlay .altiora-entity-cover {
    background: #071a33 !important;
    border: 1px solid rgba(112,149,210,.16) !important;
  }

  .altiora-entity-overlay .card-close {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    background: rgba(255,255,255,.06) !important;
    color: #fff !important;
    font-size: 0 !important;
    position: relative !important;
  }

  .altiora-entity-overlay .card-close::before {
    content: "×";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    transform: translateY(-1px);
  }

  .altiora-entity-overlay .card-cta,
  .altiora-entity-overlay .preview-secondary {
    min-height: 42px;
  }

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

  html[data-theme="light"] .altiora-entity-overlay-panel,
  html[data-theme="light"] .altiora-entity-overlay-content {
    background: #ffffff;
    color: #0c1728;
  }

  html[data-theme="light"] .altiora-entity-overlay .altiora-entity-head,
  html[data-theme="light"] .altiora-entity-overlay .altiora-entity-actions {
    background: #ffffff;
    border-color: rgba(25,48,82,.10);
  }

  html[data-theme="light"] .altiora-entity-overlay .altiora-entity-section,
  html[data-theme="light"] .altiora-entity-overlay .altiora-entity-cover {
    background: #f5f8ff !important;
    border-color: rgba(25,48,82,.12) !important;
  }

  html[data-theme="light"] .altiora-entity-overlay .card-close {
    background: rgba(244,248,255,.90) !important;
    border-color: rgba(25,48,82,.14) !important;
    color: #0c1728 !important;
  }
}


/* v71 — adapt country market preview to mobile entity overlay */
@media (max-width: 767px) {
  .altiora-entity-overlay-panel[data-entity-type="country"] .altiora-entity-overlay-content {
    padding-left: 12px;
    padding-right: 12px;
    overflow-x: hidden;
  }

  .altiora-country-preview {
    display: grid;
    gap: 0;
    max-width: 100%;
    min-width: 0;
  }

  .altiora-country-preview,
  .altiora-country-preview * {
    box-sizing: border-box;
  }

  .altiora-country-preview .altiora-entity-title {
    font-size: 22px;
    line-height: 1.08;
    letter-spacing: -.035em;
    word-break: break-word;
  }

  .altiora-country-preview .altiora-entity-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .altiora-country-preview .altiora-entity-content,
  .altiora-country-preview .mini-value,
  .altiora-country-preview .usd {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .altiora-country-preview .market-main-value {
    max-width: 100%;
    min-width: 0;
    font-size: clamp(22px, 7.5vw, 34px);
    line-height: 1.06;
    letter-spacing: -.04em;
    overflow-wrap: anywhere;
  }

  .altiora-country-preview .market-main-value span {
    display: block;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .altiora-country-preview .market-main-value-compact {
    font-size: 24px;
    line-height: 1.1;
  }

  .altiora-country-stats-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .altiora-country-stats-grid .market-stat {
    min-width: 0 !important;
    width: auto !important;
    padding: 10px !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,.045) !important;
    border: 1px solid rgba(112,149,210,.14) !important;
    overflow: hidden;
  }

  .altiora-country-stats-grid .market-stat b {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.25;
  }

  .altiora-country-product-strip {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    margin-top: 10px;
  }

  .altiora-country-product-strip .market-product-carousel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: 12px;
  }

  .altiora-country-product-strip .market-product-track {
    max-width: none;
    min-width: max-content;
  }

  .altiora-country-product-strip .market-product-logo-card {
    width: 74px !important;
    min-width: 74px !important;
    height: 38px !important;
    padding: 0 8px !important;
  }

  .altiora-country-product-strip .country-card-carousel-controls {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
  }

  .altiora-country-product-strip .carousel-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }

  .altiora-country-preview .chip-row {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .altiora-country-preview .soft-chip {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  html[data-theme="light"] .altiora-country-stats-grid .market-stat {
    background: rgba(255,255,255,.72) !important;
    border-color: rgba(25,48,82,.12) !important;
  }
}

@media (max-width: 380px) {
  .altiora-country-stats-grid {
    grid-template-columns: 1fr !important;
  }

  .altiora-country-preview .market-main-value {
    font-size: 24px;
  }
}


/* v91 — product preview inline actions should not become sticky in mobile overlay */
@media (max-width: 767px) {
  .altiora-entity-overlay .product-preview-actions-inline {
    position: static !important;
    bottom: auto !important;
    display: grid !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-top: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}


/* v92 — mobile product preview hero metric */
@media (max-width: 767px) {
  .product-preview-hero-metric strong {
    font-size: 20px;
  }

  .product-preview-hero-metric span {
    max-width: 132px;
  }
}


/* v93 — mobile overlay support for product preview split header */
@media (max-width: 767px) {
  .altiora-entity-overlay .product-preview-head-v93 {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px !important;
  }

  .altiora-entity-overlay .product-preview-head-v93 .product-preview-hero-metric span {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .altiora-entity-overlay .product-preview-plain-section {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
  }
}


/* v94 — mobile overlay header fix for product preview */
@media (max-width: 767px) {
  .altiora-entity-overlay .product-preview-head-v94 {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px !important;
  }

  .altiora-entity-overlay .product-preview-readiness-row {
    align-items: flex-end;
    gap: 8px;
  }

  .altiora-entity-overlay .product-preview-head-v94 .product-preview-hero-metric span {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}
