/* shared/entity-sheet.css — unified entity preview sheet, catalog-like visual logic v94 */

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

.altiora-entity-title-block {
  min-width: 0;
}

.altiora-entity-eyebrow {
  color: var(--muted-2, rgba(240,244,255,.48));
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 10px;
  margin-bottom: 6px;
}

.altiora-entity-title {
  margin: 0 0 8px;
}

.altiora-entity-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.altiora-entity-body {
  display: grid;
  gap: 10px;
}

.altiora-entity-section {
  border: 1px solid rgba(112,149,210,.16);
  border-radius: 14px;
  background: #071a33;
  padding: 13px;
}

.altiora-entity-primary {
  background:
    radial-gradient(circle at 12% 0%, rgba(47,128,255,.12), transparent 32%),
    #071a33;
}

.altiora-entity-description {
  margin: 0;
}

.altiora-entity-description .preview-desc {
  margin: 0;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

.altiora-entity-label {
  margin-bottom: 8px;
}

.altiora-entity-content {
  min-width: 0;
}

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

.altiora-entity-cover {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(112,149,210,.16);
  background: #071a33;
}

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

html[data-theme="light"] .altiora-entity-primary {
  background:
    radial-gradient(circle at 12% 0%, rgba(47,128,255,.08), transparent 32%),
    #f5f8ff;
}

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

  .solid-entity-sheet.open .altiora-entity-body {
    padding-bottom: 8px;
  }

  .solid-entity-sheet.open .altiora-entity-section {
    background: #071a33 !important;
    border-color: rgba(112,149,210,.16) !important;
  }

  .solid-entity-sheet.open .altiora-entity-actions {
    position: sticky;
    bottom: -22px;
    margin: 14px -16px -22px;
    padding: 12px 16px 18px;
    background: #050f20;
    border-top: 1px solid rgba(112,149,210,.14);
  }

  .solid-entity-sheet.open .altiora-entity-actions .card-cta,
  .solid-entity-sheet.open .altiora-entity-actions .preview-secondary {
    min-height: 42px;
  }

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

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


/* v78 — contain country preview inside desktop/mobile panel */
.altiora-country-preview {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

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

.altiora-country-preview .altiora-entity-head,
.altiora-country-preview .altiora-entity-body,
.altiora-country-preview .altiora-entity-section,
.altiora-country-preview .altiora-entity-content,
.altiora-country-preview .altiora-entity-actions {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.altiora-country-preview .market-main-value,
.altiora-country-preview .market-main-value span,
.altiora-country-preview .usd,
.altiora-country-preview .mini-value,
.altiora-country-preview .muted-inline {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.altiora-country-preview .market-products-overview,
.altiora-country-preview .altiora-country-stats-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow-x: hidden;
}

.altiora-country-preview .market-stat {
  width: auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.altiora-country-preview .market-stat b {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

.altiora-country-preview .altiora-country-product-strip,
.altiora-country-preview .market-product-carousel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

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

.altiora-country-preview .market-product-logo-card {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-card.open .altiora-country-preview {
  contain: inline-size;
}

.market-card.open {
  max-width: min(var(--country-panel-width, 372px), calc(100vw - 32px));
  overflow-x: hidden;
}

@media (max-width: 767px) {
  .altiora-country-preview .market-products-overview,
  .altiora-country-preview .altiora-country-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .altiora-country-preview .market-main-value {
    font-size: clamp(22px, 7.5vw, 34px);
    line-height: 1.06;
  }
}

@media (max-width: 380px) {
  .altiora-country-preview .market-products-overview,
  .altiora-country-preview .altiora-country-stats-grid {
    grid-template-columns: 1fr;
  }
}


/* v91 — compact inline product preview actions */
.product-preview-actions-inline {
  position: static !important;
  display: grid !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.product-preview-actions-inline .preview-secondary,
.product-preview-actions-inline .card-cta {
  min-height: 42px;
}

.solid-entity-sheet.open .product-preview-actions-inline {
  position: static !important;
  bottom: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border-top: 0 !important;
  background: transparent !important;
}


/* v92 — product preview hero metric beside export badge */
.product-preview-hero-metric {
  display: grid;
  gap: 1px;
  margin-left: 8px;
  color: #19e0ad;
  align-self: flex-end;
  transform: translateY(1px);
  min-width: 0;
}

.product-preview-hero-metric strong {
  display: block;
  font-size: 22px;
  line-height: .86;
  font-weight: 800;
  letter-spacing: -.055em;
  white-space: nowrap;
}

.product-preview-hero-metric span {
  display: block;
  margin-top: 1px;
  color: currentColor;
  opacity: .76;
  font-size: 7px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.altiora-entity-badges:has(.product-preview-hero-metric) {
  align-items: flex-end;
  gap: 9px;
}


/* v93 — product preview split header and frameless primary sections */
.product-preview-head-v93 {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start !important;
  gap: 14px !important;
}

.product-preview-head-left {
  min-width: 0;
}

.product-preview-head-v93 .preview-title {
  margin-bottom: 8px;
}

.product-preview-readiness-row {
  display: flex;
  align-items: center;
  min-height: 24px;
}

.product-preview-head-right {
  align-self: center;
  min-width: 0;
  max-width: 220px;
  padding-right: 2px;
}

.product-preview-head-v93 .product-preview-hero-metric {
  margin: 0;
  transform: none;
  align-self: center;
  color: #19e0ad;
}

.product-preview-head-v93 .product-preview-hero-metric strong {
  font-size: clamp(26px, 4.1vw, 42px);
  line-height: .9;
  letter-spacing: -.06em;
}

.product-preview-head-v93 .product-preview-hero-metric span {
  max-width: 220px;
  margin-top: 4px;
  font-size: 9px;
  line-height: 1.12;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-preview-plain-section {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  min-width: 0;
}

.product-preview-plain-label {
  margin: 0;
}

.product-preview-plain-content {
  min-width: 0;
}

.product-preview-plain-section .chip-row {
  gap: 7px;
}

html[data-theme="light"] .product-preview-plain-section {
  background: transparent !important;
  border: 0 !important;
}

@media (max-width: 767px) {
  .product-preview-head-v93 {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px !important;
  }

  .product-preview-head-v93 .card-close {
    grid-column: 2;
    grid-row: 1;
  }

  .product-preview-head-left {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .product-preview-head-right {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
    max-width: 100%;
    margin-top: 2px;
  }

  .product-preview-head-v93 .product-preview-hero-metric {
    display: inline-grid;
  }

  .product-preview-head-v93 .product-preview-hero-metric strong {
    font-size: 28px;
  }

  .product-preview-head-v93 .product-preview-hero-metric span {
    max-width: min(260px, calc(100vw - 72px));
    font-size: 8px;
  }
}


/* v94 — product preview header fix: metric beside readiness badge, no title overlap */
.product-preview-head-v94 {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start !important;
  gap: 12px !important;
}

.product-preview-head-main {
  min-width: 0;
}

.product-preview-head-v94 .preview-title {
  margin-bottom: 8px;
}

.product-preview-readiness-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.product-preview-readiness-row .tag {
  flex: 0 0 auto;
}

.product-preview-head-v94 .product-preview-hero-metric {
  margin: 0 0 1px;
  transform: none;
  align-self: flex-end;
  color: #19e0ad;
  max-width: min(172px, 100%);
}

.product-preview-head-v94 .product-preview-hero-metric strong {
  font-size: clamp(22px, 3.1vw, 30px);
  line-height: .86;
  font-weight: 800;
  letter-spacing: -.055em;
  white-space: nowrap;
}

.product-preview-head-v94 .product-preview-hero-metric span {
  max-width: 172px;
  margin-top: 2px;
  font-size: 7px;
  line-height: 1.05;
  color: currentColor;
  opacity: .76;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-preview-head-v94 .card-close {
  grid-column: 2;
  grid-row: 1;
}

@media (max-width: 767px) {
  .product-preview-head-v94 {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px !important;
  }

  .product-preview-head-v94 .product-preview-hero-metric {
    max-width: min(176px, calc(100vw - 146px));
  }

  .product-preview-head-v94 .product-preview-hero-metric strong {
    font-size: 25px;
  }

  .product-preview-head-v94 .product-preview-hero-metric span {
    max-width: 176px;
    font-size: 7px;
  }
}

@media (max-width: 390px) {
  .product-preview-head-v94 .product-preview-hero-metric {
    max-width: 158px;
  }

  .product-preview-head-v94 .product-preview-hero-metric strong {
    font-size: 23px;
  }

  .product-preview-head-v94 .product-preview-hero-metric span {
    max-width: 158px;
  }
}
