/* =========================================================================
   Store Detail panel — revealed when a store is chosen (globe or list)
   Matches scaffold ids/classes:
     #store-detail.store-detail (aside, [hidden] by default)
     .store-detail__close (#store-detail-close)
     .store-detail__name  (#store-detail-name)
     .store-detail__place (#store-detail-place)
     .store-detail__photos (#store-detail-photos)
     .store-detail__hours (#store-detail-hours)
     #store-detail-directions (.btn .btn--primary .btn--sm)
   Uses design tokens only.
   ========================================================================= */

.store-detail {
  /* Opens in flow directly UNDER the chosen store card (in its side column),
     so the center stays free for a bigger globe. */
  position: relative;
  width: 100%;
  margin-top: var(--space-2);
  z-index: 4;

  /* Translucent dark card (on the navy page) with cream text */
  background: rgba(22, 30, 54, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-lg);
  overflow: hidden; /* clip the top stripe to the card's rounded edges */
  box-shadow: var(--shadow-lg);
  padding: var(--space-3) var(--space-4);
  color: var(--cream);

  display: flex;
  flex-direction: column;
  gap: var(--space-2);

  /* Entrance: JS removes [hidden] then adds .is-open */
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}

.store-detail[hidden] {
  display: none;
}

.store-detail.is-open {
  opacity: 1;
  transform: translateY(0);
}

/* Top stripe (clipped to the card by overflow:hidden, so it matches its width) */
.store-detail::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--red) 0 33%, var(--gold) 33% 66%, var(--navy) 66% 100%);
}

/* ---- Header row: "Details" subtitle + close button (vertically aligned) ---- */
.store-detail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* ---- Close button (sits in the header row, centered with the title) ---- */
.store-detail__close {
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--navy);
  background: var(--surface-alt);
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.store-detail__close:hover {
  background: var(--red);
  color: var(--on-red);
  border-color: var(--red);
  transform: rotate(90deg);
}
.store-detail__close:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

/* ---- "Details" subtitle (smaller than the store name on the card above) ---- */
.store-detail__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: var(--lh-tight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 232, 211, 0.85);
}

/* ---- Mini photo strip: horizontal scroll on small, wraps gracefully ---- */
.store-detail__photos {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
/* Each photo is a button that opens the lightbox */
.store-detail__photo {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
  border-radius: var(--radius-sm);
  scroll-snap-align: start;
}
.store-detail__photo img {
  display: block;
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--surface-alt);
  transition: transform var(--dur-fast) var(--ease-out);
}
.store-detail__photo:hover img,
.store-detail__photo:focus-visible img { transform: scale(1.06); }
.store-detail__photo:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Thin styled scrollbar for the strip */
.store-detail__photos::-webkit-scrollbar {
  height: 8px;
}
.store-detail__photos::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}
.store-detail__photos::-webkit-scrollbar-track {
  background: transparent;
}

/* ---- Hours note ---- */
.store-detail__hours {
  margin: 0;
  font-size: var(--fs-sm);
  color: rgba(244, 232, 211, 0.7);
  font-style: italic;
}

/* Action row: Get Directions + More photos on ONE line */
.store-detail__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.store-detail__actions .btn {
  font-size: var(--fs-sm);
  padding: var(--space-2) var(--space-3);
  white-space: nowrap;
}
/* Ghost button reads light on the dark detail card */
.store-detail .btn--ghost {
  color: var(--cream);
  border-color: rgba(255, 255, 255, 0.5);
}
.store-detail .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--cream);
  color: var(--cream);
}

@media (prefers-reduced-motion: reduce) {
  .store-detail,
  .store-detail.is-open {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .store-detail__close:hover {
    transform: none;
  }
}
