/*
 * trioni/store-list (port of prototype/css/components/stores.css) — shop selector (APG tabs)
 * + local map image per shop (static, no third-party requests) + ink address card over the map.
 * Without JS both panels are shown one after the other. Also reused by the store page.
 */
.stores {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: var(--s-6);
  align-items: start;
}

/* ---------- Tabs ---------- */
.stores__nav,
.stores__tabs {
  display: grid;
  gap: var(--s-3);
}

.store-tab {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-4);
  width: 100%;
  padding: var(--s-5) var(--s-5) var(--s-5) var(--s-4);
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.store-tab + .store-tab::before {
  content: '';
  position: absolute;
  top: calc(var(--s-3) / -2);
  left: var(--s-4);
  right: var(--s-4);
  height: 1px;
  background: var(--line);
}

.store-tab:hover {
  background: var(--stone);
}

.store-tab[aria-selected='true'] {
  border-left-color: var(--gold-ui);
  background: var(--stone);
}

.store-tab__index {
  color: var(--gold-text);
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-variant-numeric: lining-nums;
  line-height: 1.4;
}

.store-tab__body {
  display: grid;
  gap: 2px;
}

.store-tab__name {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.1;
}

.store-tab__address {
  color: var(--text-soft);
  font-size: var(--fs-md);
}

.store-tab__status {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.store-tab__status.is-open {
  color: var(--open);
}

.store-tab__status.is-closed {
  color: var(--closed);
}

.stores__hint {
  margin-top: var(--s-2);
  padding-left: var(--s-4);
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* One shop: the block prints no selector; the panel takes the row. */
.stores--single {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-4);
}

.stores--single .stores__hint {
  margin-top: 0;
  padding-left: 0;
}

/* Full-row map: a capped height keeps it from towering over the section on desktop. No aspect
   ratio here: with min-height: 100% it widened the map past the viewport on tablets. */
@media (min-width: 760px) {
  .stores--single .store-panel__map {
    aspect-ratio: auto;
    height: clamp(300px, 26vw, 380px);
  }
}

/* Tablets: the full-width map is short, so the card sits under it (as on phones) and leaves
   the pin and its label in view. */
@media (min-width: 760px) and (max-width: 1099px) {
  .stores--single .store-panel__map {
    height: 300px;
  }

  .stores--single .store-panel__photo {
    justify-self: start;
  }

  .stores--single .store-panel__card {
    grid-area: 2 / 1;
    justify-self: stretch;
    width: auto;
    margin: calc(-1 * var(--s-5)) var(--s-5) 0;
  }
}

/* ---------- Panels ---------- */
.stores__panels {
  display: grid;
  gap: var(--s-6);
}

.store-panel {
  position: relative;
  display: grid;
}

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

.store-panel.is-entering {
  animation: panel-in var(--dur-slow) var(--ease);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.store-panel__map,
.store-panel__card {
  grid-area: 1 / 1;
}

.store-panel__map {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  background: #e9e4d8;
}

.store-panel__map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 48%; /* keep the pin (right of centre) in view when the panel grows */
}

.store-panel__map figcaption {
  position: absolute;
  right: var(--s-2);
  bottom: var(--s-2);
  padding: 2px 6px;
  background: rgba(250, 249, 246, 0.85);
  color: var(--muted);
  font-size: 0.6875rem;
}

/* Ink address card floating over the map (desktop): wide enough for the three actions on one row. */
.store-panel__card {
  position: relative;
  z-index: 1;
  align-self: end;
  justify-self: start;
  margin: var(--s-5);
  display: grid;
  gap: var(--s-3);
  width: min(420px, 46%);
  padding: 20px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: 0 24px 50px -24px rgba(25, 25, 20, 0.55);
}

.store-panel__kicker {
  color: var(--gold-on-ink);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/* Shop photo inset over the map (admin-editable; labelled placeholder until the photo session). */
.store-panel__photo {
  grid-area: 1 / 1;
  z-index: 1;
  align-self: start;
  justify-self: end;
  width: min(30%, 240px);
  aspect-ratio: 4 / 3;
  margin: var(--s-4);
  border: 5px solid var(--paper);
  border-radius: 6px;
  box-shadow: 0 18px 36px -20px rgba(25, 25, 20, 0.6);
}

.store-panel__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-panel__photo .photo-slot__label {
  margin: 6px;
  padding: 2px 6px;
  font-size: 0.625rem;
}

.store-panel__address {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  line-height: 1.1;
}

.store-panel__address a {
  display: grid;
  gap: 2px;
  transition: color var(--dur-fast) var(--ease);
}

.store-panel__address a:hover {
  color: var(--gold-on-ink);
}

/* Inside page content (.prose, e.g. /contacto/) the card keeps its own type: the generic
   h3 size and the link underline of .prose would otherwise win. */
.store-panel .store-panel__kicker {
  font-size: var(--fs-2xs);
}

/* The card title links to the store page. */
.store-panel .store-panel__kicker a {
  color: inherit;
  text-decoration: none;
}

.store-panel .store-panel__kicker a:hover,
.store-panel .store-panel__kicker a:focus-visible {
  color: var(--on-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.store-panel .store-panel__address a:not(.btn):not(.wp-element-button) {
  color: inherit;
  text-decoration: none;
}

.store-panel .store-panel__address a:not(.btn):not(.wp-element-button):hover {
  color: var(--gold-on-ink);
}

.store-panel__address span {
  color: var(--on-ink-muted);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.4;
}

.store-panel__status {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--on-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.store-panel__facts {
  display: grid;
  gap: var(--s-1);
  padding-top: var(--s-3);
  border-top: 1px solid var(--ink-line);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.store-panel__facts > div {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: var(--s-3);
}

.store-panel__facts > div > dt {
  color: var(--gold-on-ink);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
}

.store-panel__facts dd {
  color: #d9d4c7;
}

/* The hours column never shrinks below «y 15:00–19:00» (it overflowed the card at 390 px when a holiday row was listed); the day column wraps instead. */
.store-panel__week {
  display: grid;
  grid-template-columns: auto minmax(min-content, 1fr);
  gap: 2px var(--s-3);
  font-variant-numeric: tabular-nums;
}

.store-panel__week dt {
  color: var(--on-ink-muted);
}

.store-panel__week dd {
  color: var(--on-ink);
}

/* «Cómo llegar» (gold) · «Llamar» · «WhatsApp» on one row of 44 px buttons. */
.store-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.store-panel__actions .btn {
  flex: 1 1 auto;
  gap: 6px;
  min-height: 44px;
  padding-inline: var(--s-3);
}

.store-panel__actions .btn__icon {
  width: 18px;
  height: 18px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .stores {
    grid-template-columns: 1fr;
    gap: var(--s-5);
  }

  .stores__tabs {
    grid-template-columns: 1fr 1fr;
  }

  .store-tab + .store-tab::before {
    display: none;
  }

  .store-panel__card {
    width: min(420px, 60%);
  }
}

@media (max-width: 759px) {
  .store-panel__map {
    aspect-ratio: 16 / 9;
  }

  /* Phones: the pin sits centre-right, so the photo moves to the top-left corner. */
  .store-panel__photo {
    justify-self: start;
  }

  /* The card sits under the map as one block: no floating shadow, no overlap. */
  .store-panel__card {
    grid-area: 2 / 1;
    justify-self: stretch;
    width: auto;
    margin: 0;
    border-radius: 0 0 6px 6px;
    box-shadow: none;
  }

  .store-panel__map:has(+ .store-panel__card),
  .store-panel__map:has(~ .store-panel__card) {
    border-radius: 6px 6px 0 0;
  }
}

@media (max-width: 479px) {
  .stores__tabs {
    gap: var(--s-2);
  }

  .store-tab {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: var(--s-3);
  }

  .store-tab__index {
    font-size: var(--fs-base);
  }

  .store-tab__name {
    font-size: 1.375rem;
  }

  .store-tab__address,
  .store-tab__status {
    font-size: var(--fs-xs);
  }

  .store-panel__photo {
    width: 36%;
    margin: var(--s-3);
    border-width: 3px;
  }

  .store-panel__card {
    gap: 10px;
    padding: var(--s-4);
  }
}

/* Phones: a short strip of map (the pin stays in view) and the three actions still on one row. */
@media (max-width: 559px) {
  .store-panel__map {
    aspect-ratio: auto;
    height: 180px;
  }

  .store-panel__actions {
    gap: 6px;
  }

  .store-panel__actions .btn {
    padding-inline: var(--s-2);
    font-size: var(--fs-xs);
  }
}

/* Narrow phones: «Cómo llegar» takes the whole row and the other two share the next one. */
@media (max-width: 379px) {
  .store-panel__actions .btn:first-child {
    flex-basis: 100%;
  }

  .store-panel__actions .btn:not(:first-child) {
    flex: 1 1 0;
  }
}

/* 320 px phones: labels above their values, so the week list keeps the card's full width
   («Lunes a viernes» and holiday names no longer break into three lines). */
@media (max-width: 359px) {
  .store-panel__facts > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* ---------- trioni/store-hours (store page) ----------
 * Weekly hours of one shop on a light surface. The plugin block prints static hours; the live
 * «Abierto/Cerrado» state and past special days are updated by store-status.js. */
.store-hours {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}

.store-hours__title,
.store-hours__subtitle {
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted);
}

.store-hours__status {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.store-hours__status.is-open {
  color: var(--open);
}

.store-hours__status.is-closed {
  color: var(--closed);
}

.store-hours__week {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-1) var(--s-3);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.store-hours__week dt {
  color: var(--text-soft);
}

.store-hours__week dd {
  color: var(--text);
}

.store-hours__special ul {
  display: grid;
  gap: var(--s-1);
  margin: var(--s-2) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--text-soft);
}

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

/* ---------- Store page: services (pattern trioni/store-services) ---------- */
.store-services {
  display: grid;
  gap: var(--s-3);
}

.store-services h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted);
}

.store-services__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.store-services__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: border-color var(--dur-fast) var(--ease);
}

.store-services__link:hover {
  border-color: var(--ink);
}

/* ---------- Store page: line to the price comparison (pattern trioni/store-compare) ---------- */
.store-compare {
  margin: 0;
  color: var(--text-soft);
  font-size: var(--fs-sm);
}

/* An underlined link: told apart from the text by more than its colour (1.4.1). */
.store-compare a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease);
}

.store-compare a:hover {
  color: var(--gold-text);
}
