/* C041.2 Map detail panel architecture.
   This file owns only the provider quick-view panel used by mapa.html:
   compact bottom sheet, laptop/desktop on-demand overlay and extra-wide rail. */

:root {
  --detail-panel-width: 388px;
}

.map-detail-panel {
  display: none;
  background: #ffffff;
  color: #0f172a;
}

.map-detail-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(216, 229, 232, 0.92);
}

.map-detail-panel-kicker,
.company-panel-kicker {
  margin: 0;
  color: var(--map-accent-dark, #006f76);
  font-size: 0.6875rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.map-detail-panel-header h2 {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.map-detail-panel-close {
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(216, 229, 232, 0.95);
  border-radius: 1rem;
  background: #ffffff;
  color: #0f172a;
  font-size: 1.25rem;
  font-weight: 950;
}

.map-detail-panel-body {
  min-height: 0;
  overflow-y: auto;
}

.map-detail-sheet-handle,
.map-detail-rail-toggle {
  display: none;
}

.company-panel-card {
  padding: 1rem;
}

.company-panel-cover {
  margin: -1rem -1rem 1rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e2e8f0;
}

.company-panel-cover-picture,
.company-panel-cover-img {
  display: block;
  width: 100%;
  height: 100%;
}

.company-panel-cover-img {
  object-fit: cover;
}

.company-panel-summary {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.company-panel-logo {
  display: flex;
  width: 4rem;
  height: 4rem;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 4px solid #ffffff;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(5, 8, 22, 0.16);
}

.company-panel-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.company-panel-title-block {
  min-width: 0;
}

.company-panel-title-block h3 {
  margin: 0.12rem 0;
  font-size: 1.1rem;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.company-panel-rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 850;
}

.company-panel-rating span:first-child {
  color: #f59e0b;
  letter-spacing: -0.08em;
}

.company-panel-description {
  margin: 0.85rem 0 0;
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.55;
}

.company-panel-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.company-panel-action {
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(216, 229, 232, 0.95);
  border-radius: 0.9rem;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 950;
  text-decoration: none;
}

.company-panel-action.is-primary {
  border-color: rgba(0, 118, 129, 0.38);
  background: var(--map-accent-dark, #006f76);
  color: #ffffff;
}

.company-panel-action.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}

.company-panel-action span[aria-hidden="true"] {
  display: inline-flex;
  width: 1rem;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
}

.company-panel-action strong {
  font: inherit;
}

.company-panel-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 1rem;
}

.company-panel-gallery-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.75rem;
  object-fit: cover;
  background: #e2e8f0;
}

.company-panel-offerings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.company-panel-offerings .company-panel-kicker {
  flex-basis: 100%;
}

.company-panel-offerings span:not(.company-panel-kicker) {
  border: 1px solid rgba(216, 229, 232, 0.95);
  border-radius: 999px;
  background: #f6fbfc;
  color: #334155;
  padding: 0.35rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 900;
}

@media (max-width: 1023px) {
  body.page-mapa.responsive-list-view .map-detail-panel {
    display: none !important;
  }

  body.page-mapa.responsive-map-view.map-detail-panel-open .map-detail-panel {
    position: fixed;
    right: 0.65rem;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 5rem);
    left: 0.65rem;
    z-index: 1210;
    display: flex;
    max-height: min(58vh, 460px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(216, 229, 232, 0.95);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 70px rgba(5, 8, 22, 0.24);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition:
      max-height 0.2s ease,
      transform 0.2s ease,
      border-radius 0.2s ease;
  }

  .map-detail-panel-header {
    min-height: 1.15rem;
    align-items: center;
    border-bottom: 0;
    padding: 0.45rem 0.7rem 0;
  }

  .map-detail-panel-header > div {
    display: none;
  }

  .map-detail-sheet-handle {
    display: inline-flex;
    width: 100%;
    min-height: 1.15rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
  }

  .map-detail-sheet-handle span {
    display: block;
    width: 2.85rem;
    height: 0.28rem;
    border-radius: 999px;
    background: #cbd5e1;
  }

  .map-detail-panel-close {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    font-size: 1rem;
    box-shadow: none;
  }

  .map-detail-panel-body {
    overflow: hidden;
  }

  body.page-mapa.map-detail-sheet-peek .map-detail-panel {
    max-height: 8.35rem;
  }

  body.page-mapa.map-detail-sheet-mid .map-detail-panel {
    max-height: min(45vh, 390px);
  }

  body.page-mapa.map-detail-sheet-expanded .map-detail-panel {
    top: calc(var(--header-height) + 0.75rem);
    max-height: calc(100vh - var(--header-height) - 6.2rem);
    border-radius: 1.35rem;
  }

  body.page-mapa.map-detail-sheet-mid .map-detail-panel-body,
  body.page-mapa.map-detail-sheet-expanded .map-detail-panel-body {
    overflow-y: auto;
  }

  .company-panel-card.is-mobileSheet {
    padding: 0.55rem 0.8rem 0.85rem;
  }

  .company-panel-card.is-mobileSheet .company-panel-cover,
  .company-panel-card.is-mobileSheet .company-panel-gallery,
  .company-panel-card.is-mobileSheet .company-panel-offerings {
    display: none;
  }

  .company-panel-card.is-mobileSheet .company-panel-summary {
    gap: 0.65rem;
  }

  .company-panel-card.is-mobileSheet .company-panel-logo {
    width: 2.75rem;
    height: 2.75rem;
    border-width: 3px;
    box-shadow: 0 10px 22px rgba(5, 8, 22, 0.12);
  }

  .company-panel-card.is-mobileSheet .company-panel-title-block h3 {
    display: -webkit-box;
    margin-top: 0.05rem;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    font-size: 0.98rem;
    line-height: 1.05;
  }

  .company-panel-card.is-mobileSheet .company-panel-kicker {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    color: #64748b;
    font-size: 0.64rem;
  }

  .company-panel-card.is-mobileSheet .company-panel-rating {
    margin-top: 0.1rem;
    font-size: 0.7rem;
  }

  .company-panel-card.is-mobileSheet .company-panel-description {
    margin-top: 0.65rem;
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .company-panel-card.is-mobileSheet .company-panel-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.38rem;
    margin-top: 0.55rem;
  }

  .company-panel-card.is-mobileSheet .company-panel-action {
    min-height: 2.05rem;
    gap: 0.25rem;
    border-radius: 0.78rem;
    padding: 0 0.4rem;
    font-size: 0.68rem;
  }

  body.page-mapa.map-detail-sheet-peek .company-panel-card.is-mobileSheet .company-panel-description,
  body.page-mapa.map-detail-sheet-peek
    .company-panel-card.is-mobileSheet
    .company-panel-action[data-action-kind="detail"] {
    display: none;
  }

  body.page-mapa.map-detail-sheet-peek .company-panel-card.is-mobileSheet .company-panel-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.page-mapa.map-detail-sheet-mid .company-panel-card.is-mobileSheet .company-panel-description {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.page-mapa.map-detail-sheet-expanded .company-panel-card.is-mobileSheet .company-panel-description {
    display: block;
  }

  body.page-mapa.map-detail-panel-open .map-photo-tray,
  body.page-mapa.map-detail-panel-open .photo-tray-restore {
    display: none !important;
  }
}

@media (min-width: 1024px) and (max-width: 1919px) {
  body.page-mapa.map-detail-panel-open .map-detail-rail-toggle {
    position: fixed;
    top: calc(var(--header-height) + 50% - 68px);
    right: 0.55rem;
    z-index: 940;
    display: inline-flex;
    width: 2.8rem;
    min-width: 2.8rem;
    min-height: 7rem;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.9rem 0 0 0.9rem;
    background: linear-gradient(180deg, var(--map-accent-dark, #007681), #00565d);
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(0, 86, 93, 0.2);
    writing-mode: vertical-rl;
  }

  body.page-mapa.map-detail-panel-open .map-detail-rail-toggle .map-detail-rail-toggle-icon {
    display: inline-flex;
    width: 1.2rem;
    min-width: 1.2rem;
    height: 1.2rem;
    min-height: 1.2rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 950;
    line-height: 1;
    box-shadow: none;
  }

  body.page-mapa.map-detail-panel-open .map-detail-rail-toggle strong {
    color: inherit;
    font-size: 0.68rem;
    font-weight: 950;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  body.page-mapa.map-detail-panel-open.map-detail-panel-forced-open .map-detail-panel {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    z-index: 920;
    display: flex;
    width: min(var(--detail-panel-width), 360px);
    flex-direction: column;
    border-left: 1px solid rgba(216, 229, 232, 0.95);
    background: #ffffff;
    box-shadow: -18px 0 54px rgba(5, 8, 22, 0.16);
  }

  body.page-mapa.map-detail-panel-open.map-detail-panel-forced-open .map-detail-rail-toggle {
    right: min(var(--detail-panel-width), 360px);
  }

  .map-detail-rail-badge {
    display: inline-flex;
    min-width: 1.3rem;
    height: 1.3rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--map-accent-dark, #006f76);
    font-size: 0.65rem;
    font-style: normal;
    font-weight: 950;
    line-height: 1;
    writing-mode: horizontal-tb;
  }

  .map-detail-rail-badge[hidden] {
    display: none !important;
  }
}

@media (min-width: 1920px) {
  body.page-mapa.map-detail-panel-open .map-detail-panel {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    z-index: 760;
    display: flex;
    width: var(--detail-panel-width);
    flex-direction: column;
    border-left: 1px solid rgba(216, 229, 232, 0.95);
    box-shadow: -16px 0 48px rgba(5, 8, 22, 0.09);
  }

  body.page-mapa.map-detail-panel-open .map-detail-rail-toggle {
    display: none;
  }
}
