/* ==========================================================================
   PROFILE — SHOP FRONT (Basic tier, small-business layout)
   --------------------------------------------------------------------------
   Loaded after profile.css by templates/template-shop.html only, and every
   rule is scoped to [data-profile="shop"], so no other template is touched.

   What it changes, and why a shop needs it:

   1. Contact first, and big. A customer standing outside a shop wants one
      thing — to reach it. The social row becomes two large labelled tiles
      per line instead of a row of small unlabelled squares, and sits above
      everything else.
   2. The WhatsApp button runs the full width. It is the one action that
      matters, so nothing shares its line.
   3. Every other button goes two per line, so the whole offer — prices,
      orders, hours, reviews — is on screen without scrolling.

   The price drawer still belongs to the card above it: it spans both
   columns and is pulled flush against the row, so opening it reads as the
   row opening rather than a loose box appearing.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1 — IDENTITY: a shop name is read at a glance, so give it room
   -------------------------------------------------------------------------- */
[data-profile="shop"] .ident__name {
  font-size: var(--text-h3);
}

/* Open hours and the town are contact details, not footnotes. */
[data-profile="shop"] .ident__meta {
  gap: var(--space-2) var(--space-3);
  margin-block-start: var(--space-4);
}
[data-profile="shop"] .ident__meta .pill {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}
[data-profile="shop"] .ident__meta .pill .icon {
  width: 1rem;
  height: 1rem;
}

[data-profile="shop"] .ident__bio {
  margin-block-start: var(--space-4);
  font-size: var(--text-base);
}


/* --------------------------------------------------------------------------
   2 — SOCIAL / CONTACT TILES
   These used to live here. Two-per-line tiles with the network name on them
   turned out to be right for every Basic profile, not just a shop, so the
   whole block moved to assets/css/profile.css (section 4) and this file has
   nothing left to say about them.
   -------------------------------------------------------------------------- */


/* --------------------------------------------------------------------------
   3 — THE ONE ACTION: WhatsApp, full width and taller than anything else
   -------------------------------------------------------------------------- */
[data-profile="shop"] .actions {
  grid-template-columns: 1fr;
  margin-block-end: var(--space-6);
}

[data-profile="shop"] .actions .btn--whatsapp {
  min-height: 3.5rem;
  font-size: var(--text-lg);
}
[data-profile="shop"] .actions .btn--whatsapp .icon {
  width: 1.375rem;
  height: 1.375rem;
}

/* The second action is deliberately quieter — one shop, one main door. */
[data-profile="shop"] .actions .btn--ghost,
[data-profile="shop"] .actions .btn--call {
  min-height: 2.875rem;
  font-size: var(--text-base);
}


/* --------------------------------------------------------------------------
   4 — LINK BUTTONS: two per line
   The row gap is carried by each item's own bottom margin rather than by
   the grid, which is what lets the price drawer sit flush under its row.
   -------------------------------------------------------------------------- */
[data-profile="shop"] .links {
  /* minmax(0,…), not 1fr on its own: a long card title would otherwise
     set a floor under its own column and the two would stop matching. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 0 var(--space-3);
}
/* Both halves of the list: the cards sitting straight in the grid, and the
   card + drawer pair the group lifts into it. They have to carry the same
   bottom margin or the two cards in a row end at different heights. */
[data-profile="shop"] .links > *,
[data-profile="shop"] .link-group > * {
  margin-block-end: var(--space-3);
}

/* The card and its drawer are two grid items, not one box: the drawer needs
   its own full-width row. display:contents lifts them both into the grid
   while leaving the DOM — and so the card + drawer sibling rules and the JS
   that animates the drawer — exactly as they were. */
[data-profile="shop"] .link-group {
  display: contents;
}

[data-profile="shop"] .link-panel {
  grid-column: 1 / -1;
  /* up by one row gap and one border, so it meets the row above it */
  margin-block-start: calc(var(--space-3) * -1 - 1px);
}

/* Two cards to a line means less width, so the card loses its roomiest
   paddings and the label is allowed to wrap onto a second line. */
[data-profile="shop"] .link-card {
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}
[data-profile="shop"] .link-card__icon {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
}
/* A flex item will not shrink below the widest unbreakable thing inside it,
   and the line under the title never breaks — so without this the note runs
   out past the edge of the card instead of ending in an ellipsis. It only
   shows up at half width, which is why the full-width templates never
   needed it. */
[data-profile="shop"] .link-card__body {
  min-width: 0;
}
[data-profile="shop"] .link-card__title {
  font-size: var(--text-base);
  white-space: normal;
}
/* The note is an inline <span> that never wraps, which is right across a
   whole row and wrong across half of one: "Highlevel Road, Kottawa" simply
   ran out past the edge of the card. Making it a block that wraps keeps the
   whole note — an opening time or an address cut off at "Mon-Sat, …" is
   worth less than the line of space it saves, and the two cards in a row
   stretch to the taller one anyway. */
[data-profile="shop"] .link-card__sub {
  display: block;
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
  white-space: normal;
}
[data-profile="shop"] .link-card__go {
  flex: none;
}


/* --------------------------------------------------------------------------
   5 — WHAT PEOPLE ORDER: the showcase rows keep the full width, since each
   one carries a price and a note that must not be squeezed.
   -------------------------------------------------------------------------- */
[data-profile="shop"] .showcase {
  margin-block-start: var(--space-2);
}


/* --------------------------------------------------------------------------
   5b — THE COMMON PHONE (360–414px): two cards to a line leaves each title
   about fifty pixels of room, which is enough to make "Price list" break
   after one word. The icon and the paddings give that width back before the
   words have to break.
   -------------------------------------------------------------------------- */
@media (max-width: 26rem) {
  [data-profile="shop"] .link-card {
    gap: var(--space-2);
    padding: var(--space-3);
  }
  [data-profile="shop"] .link-card__icon {
    width: 2rem;
    height: 2rem;
  }
  [data-profile="shop"] .link-card__title {
    font-size: var(--text-sm);
  }
}

/* --------------------------------------------------------------------------
   6 — NARROW PHONES: below 22rem two columns stop being readable, so both
   grids fall back to one. Nothing is lost, the page is simply taller.
   -------------------------------------------------------------------------- */
@media (max-width: 22rem) {
  [data-profile="shop"] .links {
    grid-template-columns: 1fr;
  }
}
