/* Distilled parcel details for the public map */

.map-info-bubble.details-bubble {
  width: 380px;
  max-width: calc(100vw - 36px);
  max-height: min(70vh, 560px);
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  direction: rtl;
  border-radius: 16px;
  background: #070c18;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .46);
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 181, 253, .6) transparent;
}

.map-info-bubble.details-bubble::-webkit-scrollbar,
#detailsSheet.bottom-sheet::-webkit-scrollbar { width: 7px; }
.map-info-bubble.details-bubble::-webkit-scrollbar-thumb,
#detailsSheet.bottom-sheet::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(196, 181, 253, .58); }

.parcel-shell-head {
  position: sticky;
  z-index: 4;
  top: 0;
  min-height: 56px;
  margin: 0;
  padding: 6px 10px 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: #070c18;
}

.parcel-shell-heading { min-width: 0; }
.parcel-shell-heading strong { color: #f8fafc; font-size: 14px; font-weight: 900; line-height: 1.4; }
.parcel-shell-head .icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
.parcel-shell-head .icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.parcel-shell-body { min-width: 0; }
.parcel-detail-content { padding: 16px; display: grid; gap: 12px; }
.parcel-detail-head { margin: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.parcel-detail-head > div { min-width: 0; }
.parcel-detail-number { color: #fff; font-size: 20px; font-weight: 900; line-height: 1.3; font-variant-numeric: tabular-nums; }
.parcel-detail-location { margin-top: 3px; color: #b3bfd1; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.parcel-status-badge { min-height: 28px; padding: 4px 9px; flex: 0 0 auto; font-size: 12px; }

.parcel-key-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px 0;
  border-block: 1px solid rgba(255, 255, 255, .08);
}
.parcel-key-fact { min-width: 0; padding-inline: 10px; display: grid; gap: 4px; }
.parcel-key-fact + .parcel-key-fact { border-inline-start: 1px solid rgba(255, 255, 255, .08); }
.parcel-key-fact:first-child { padding-inline-start: 0; }
.parcel-key-fact:last-child { padding-inline-end: 0; }
.parcel-key-fact small { color: #b3bfd1; font-size: 12px; font-weight: 700; }
.parcel-key-fact strong { color: #f8fafc; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.parcel-disclosure { margin: 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.parcel-disclosure > summary {
  min-height: 52px;
  padding: 8px 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 9px;
  color: #f8fafc;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
}
.parcel-disclosure > summary::-webkit-details-marker { display: none; }
.parcel-disclosure > summary:hover { background: rgba(255, 255, 255, .035); }
.parcel-disclosure > summary:focus-visible { outline: 3px solid rgba(196, 181, 253, .48); outline-offset: 2px; }
.parcel-disclosure-title { min-width: 0; display: grid; gap: 2px; }
.parcel-disclosure-title strong { font-size: 13px; font-weight: 900; line-height: 1.4; }
.parcel-disclosure-title small { color: #b3bfd1; font-size: 12px; line-height: 1.4; }
.parcel-disclosure-value { max-width: 132px; color: #c4b5fd; font-size: 12px; font-weight: 800; line-height: 1.35; text-align: left; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.parcel-disclosure-chevron { width: 20px; height: 20px; grid-column: 3; fill: none; stroke: #b3bfd1; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 160ms cubic-bezier(.2, .8, .2, 1); }
.parcel-disclosure[open] > summary .parcel-disclosure-chevron { transform: rotate(180deg); }

.parcel-meta-list { padding-bottom: 6px; }
.parcel-meta-row { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid rgba(255, 255, 255, .06); }
.parcel-meta-row span { color: #b3bfd1; font-size: 12px; }
.parcel-meta-row strong { color: #f8fafc; font-size: 12px; text-align: left; }

.parcel-more-content { padding-bottom: 6px; }
.parcel-more-section { padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.parcel-more-section h3 { margin: 0 0 8px; color: #f8fafc; font-size: 12px; font-weight: 900; }

.parcel-empty-listings { min-height: 56px; padding: 8px 2px; display: grid; align-content: center; gap: 2px; border-top: 1px solid rgba(255, 255, 255, .08); }
.parcel-empty-listings strong { color: #f8fafc; font-size: 13px; }
.parcel-empty-listings span { color: #b3bfd1; font-size: 12px; }

.parcel-listings-content { padding-bottom: 4px; }
.parcel-offer-card { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.parcel-offer-card:first-child { border-top: 0; }
.parcel-offer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.parcel-offer-head > div { min-width: 0; display: grid; gap: 2px; }
.parcel-offer-head small { color: #b3bfd1; font-size: 12px; line-height: 1.4; }
.parcel-offer-head strong { color: #f8fafc; font-size: 13px; line-height: 1.4; }
.parcel-offer-price { max-width: 48%; color: #86efac !important; text-align: left; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.parcel-offer-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.parcel-trust-badge { min-height: 24px; padding: 3px 8px; font-size: 12px; }
.parcel-offer-images { width: 100%; }
.parcel-offer-images img { width: 100%; max-height: 148px; aspect-ratio: 16 / 7; display: block; object-fit: cover; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.parcel-offer-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 7px; }
.parcel-offer-actions .btn { min-width: 0; min-height: 44px; padding: 8px 9px; justify-content: center; font-size: 12px; }

.parcel-experience-actions { padding: 2px 0 8px; display: grid; gap: 7px; }
.parcel-experience-actions .btn { min-height: 44px; padding: 8px 11px; display: flex; align-items: center; justify-content: flex-start; gap: 9px; color: #ecfeff; background: #12304a; text-align: right; }
.parcel-experience-actions .btn:hover { color: #fff; background: #17405f; }
.parcel-experience-actions .btn svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: #67e8f9; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.parcel-experience-actions .btn > span { font-size: 12px; font-weight: 900; }
.parcel-experience-actions .btn > small { display: none; }
.parcel-experience-actions .atlas-cinematic-3d-entry.is-loading svg { animation: parcelDetailsSpin 1s linear infinite; }

.parcel-legal-note p { margin: 0; color: #b3bfd1; font-size: 12px; line-height: 1.65; }

.parcel-primary-actions {
  position: sticky;
  z-index: 3;
  bottom: 0;
  margin: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) repeat(2, minmax(72px, .8fr));
  gap: 7px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: #070c18;
}
.parcel-primary-actions .btn { min-width: 0; min-height: 44px; padding: 8px 9px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.parcel-primary-actions .parcel-open-page { background: #6d28d9; color: #fff; }
.parcel-primary-actions .parcel-open-page:hover { background: #5b21b6; }
.parcel-primary-actions .btn svg { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.parcel-details-loading,
.parcel-details-error {
  margin: 14px;
  padding: 14px;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
}
.parcel-details-loading > span { width: 22px; height: 22px; flex: 0 0 22px; border: 2px solid rgba(196, 181, 253, .22); border-top-color: #a78bfa; border-radius: 50%; animation: parcelDetailsSpin .8s linear infinite; }
.parcel-details-loading div,
.parcel-details-error { display: grid; gap: 3px; }
.parcel-details-loading strong,
.parcel-details-error strong { color: #f8fafc; font-size: 13px; }
.parcel-details-loading small,
.parcel-details-error span { color: #b3bfd1; font-size: 12px; }
.parcel-details-error { background: rgba(127, 29, 29, .16); }
.parcel-details-error strong { color: #fecaca; }

@keyframes parcelDetailsSpin { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
  #detailsSheet.bottom-sheet {
    right: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(68dvh, 560px) !important;
    padding: 0 !important;
    overflow-y: auto;
    transform: none !important;
    border-radius: 16px !important;
    background: #070c18;
    box-shadow: 0 18px 54px rgba(0, 0, 0, .52) !important;
  }
  #detailsSheet.bottom-sheet::before { display: none; }
  #detailsSheet .parcel-detail-content { padding: 14px; }
  #detailsSheet .parcel-primary-actions { padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 390px) {
  .parcel-key-fact { padding-inline: 7px; }
  .parcel-primary-actions { grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(68px, .8fr)); }
  .parcel-primary-actions .btn { gap: 4px; padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .parcel-disclosure-chevron { transition: none; }
  .parcel-details-loading > span,
  .parcel-experience-actions .atlas-cinematic-3d-entry.is-loading svg { animation: none; }
}
