/* The shops: /forhandlere (the summary is overview.css's discount split) and a shop's page (/forhandlere/…),
   the card on the shop above its set list (the list itself is listing.css). The stock bar is the product card's (card.css), larger. */

.shop-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 32px;
  padding: 24px 28px;
  background: var(--surface);
  border-radius: var(--r-xl);
}

.shop-card__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.shop-card__head { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.shop-card .listing-head__title { font-size: 48px; }

/* The logo at the sprite's own 40 px, spanning the address and the size */
.shop-card__id { display: flex; align-items: center; gap: 12px; min-width: 0; }

.shop-card__logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff url('/images/logos/logo-sprite-40px.png') no-repeat;
  background-size: 40px auto;
  background-position: 0 calc(var(--logo, 0) * -40px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.shop-card__lines { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shop-card__domain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; font-weight: 600; }

.shop-card__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 5px;
  background: var(--page);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
}

.shop-card__size { font-size: 14px; color: var(--ink-3); }
.shop-card__size strong { color: var(--ink); }

.shop-card__stock { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.stockbar--lg { height: 10px; border-radius: 5px; background: var(--line-soft); }

.shop-card__legend { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--ink-2); }
.shop-card__legend > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.shop-card__legend strong { color: var(--ink); }
.shop-card__key { width: 10px; height: 10px; border-radius: 3px; }

.shop-card__text { max-width: 640px; margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.shop-card__text strong { color: var(--ink); }

.shop-card__cta { min-height: 48px; padding: 0 20px; font-size: 16px; white-space: nowrap; }

/* /FORHANDLERE: the summary, the list of shops, the shops without sets, the partner box */
.shops-summary { grid-template-columns: 320px minmax(0, 1fr); gap: 40px; }
.shops-summary__avg { font-size: 14px; color: var(--ink-2); }

.shops { display: flex; flex-direction: column; gap: 14px; }
.shops__toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.shops__heading { display: flex; flex-direction: column; gap: 4px; }
.shops__title { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.shops__shown { font-size: 15px; color: var(--ink-3); }
.shops__controls { display: flex; align-items: center; gap: 10px; }

.shops__search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 280px;
  height: 46px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  color: var(--ink-3);
}

.shops__search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.shops__search:focus-within { border-color: var(--ink); }

.shops__sort { display: flex; padding: 3px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); }

.shops__sort a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.shops__sort a[aria-current] { background: var(--ink); color: #fff; }

.shops__box { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-radius: 18px; }
.shops__list { margin: 0; padding: 0; list-style: none; }

/* A row: logo, name, the stock bar, sets, cheapest, the way to the shop */
.shop-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1.2fr) minmax(0, 1.7fr) 124px 96px 128px;
  grid-template-areas: 'logo name sets total cheap cta';
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
}

.shop-row + .shop-row { border-top: 1px solid var(--line-soft); }
.shops__head { padding-block: 12px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink-3); }
.shops__head-num { text-align: right; }

.shop-row__logo {
  grid-area: logo;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff url('/images/logos/logo-sprite-40px.png') no-repeat;
  background-size: 40px auto;
  background-position: 0 calc(var(--logo, 0) * -40px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.shop-row__name { grid-area: name; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shop-row__title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.shop-row__title a { min-width: 0; overflow: hidden; font-size: 16px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; text-overflow: ellipsis; }
.shop-row__title a:hover { color: var(--cta); }
.shop-row__title .shop-card__pill { flex-shrink: 0; }
.shop-row__sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; font-size: 13px; color: var(--ink-3); }
.shop-row__sub > span { display: inline-flex; gap: 0 6px; white-space: nowrap; }
.shop-row__all { font-weight: 700; color: var(--cta); text-decoration: none; white-space: nowrap; }
.shop-row__all:hover { text-decoration: underline; }

.shop-row__sets { grid-area: sets; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shop-row__bar { display: flex; align-items: center; gap: 12px; min-width: 0; }
.shop-row__bar .stockbar { flex: 1; }
/* widths measured against the biggest shop, not shares of this one */
.shop-row__bar .stockbar > span { flex: none; }

.shop-row__count { font-size: 16px; font-variant-numeric: tabular-nums; }
.shop-row__total { grid-area: total; text-align: right; }
.shop-row__stats { display: contents; }
.shop-row__cheap { grid-area: cheap; display: flex; justify-content: flex-end; }
.shop-row__cta { grid-area: cta; height: 44px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
.shop-row__cta:hover { border-color: var(--ink); }

/* the labels the column heads give on wide screens */
.shop-row__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shop-row__narrow { display: none; }

.shops__none { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px 20px; font-size: 15px; color: var(--ink-2); }
.shops__none strong { font-size: 17px; color: var(--ink); }
.shops__clear, .shops__more-btn { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
.shops__more { padding: 16px 20px; border-top: 1px solid var(--line); }
.shops__more-btn { width: 100%; min-height: 48px; font-size: 16px; }
.shops__more--narrow { display: none; }

.shops__notes { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.shops__notes dt { display: inline; font-weight: 700; color: var(--ink-2); }
.shops__notes dd { display: inline; margin: 0; }
.shops__notes strong { color: var(--ink-2); }

.idle-shops { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.idle-shops li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px 0 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
}

.idle-shops__logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #fff url('/images/logos/logo-sprite-40px.png') no-repeat;
  background-size: 28px auto;
  background-position: 0 calc(var(--logo, 0) * -28px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.partner-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px; background: var(--surface); border-radius: var(--r-xl); }
.partner-cta__text { display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.partner-cta__title { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.partner-cta__text p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.partner-cta__btn { min-height: 48px; padding: 0 20px; background: var(--ink); color: #fff; font-size: 16px; }
.partner-cta__btn:hover { color: #fff; filter: brightness(1.2); }

@media (max-width: 1023px) {
  .shops-summary { grid-template-columns: 260px minmax(0, 1fr); gap: 32px; }
  .shop-row { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1.4fr) 72px 72px 52px; gap: 16px; }
  .shop-row__cta .only-wide { display: none; }
  .shop-row__cta { width: 44px; padding: 0; }
  /* the address and the link on lines of their own */
  .shop-row__sub { flex-direction: column; align-items: flex-start; }
  .shop-row__sub .shop-row__wide > span { display: none; }
}

@media (max-width: 767px) {
  .shops-summary { display: flex; }
  .shops__title { font-size: 22px; }
  .shops__toolbar, .shops__controls { flex-direction: column; align-items: stretch; gap: 12px; }
  .shops__controls { gap: 10px; }
  .shops__search { width: auto; }
  .shops__sort a { flex: 1; }

  .shops__head { display: none; }
  .shop-row {
    grid-template-columns: 40px minmax(0, 1fr) 44px;
    grid-template-areas: 'logo name cta' 'sets sets sets' 'stats stats stats';
    gap: 12px;
    padding: 14px 16px;
  }
  .shop-row__title .shop-card__pill { padding: 2px 7px; font-size: 11px; }
  .shop-row__title .shop-card__pill svg { display: none; }
  .shop-row__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 12px; font-weight: 700; color: var(--ink-3); }
  .shop-row__sub .shop-row__wide, .shop-row__total { display: none; }
  .shop-row__narrow { display: inline; }
  .shop-row__bar .shop-row__count { min-width: 48px; text-align: right; }
  .shop-row__stats { grid-area: stats; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 14px; }
  .shop-row__cheap { align-items: baseline; gap: 6px; }

  /* phones: the first 10 rows until "Vis alle" */
  .shops__list:not(.is-all) .shop-row--later { display: none; }
  .shops__more--narrow { display: block; }

  .partner-cta { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px 16px; }
  .partner-cta__title { font-size: 24px; }
}

@media (max-width: 767px) {
  .shop-card { display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding: 18px 16px; }
  .shop-card .listing-head__title { font-size: 34px; }

  /* Two views: they share the width instead of scrolling */
  .list-tabs--split { margin: 0; padding: 5px; border-radius: var(--r-lg); }
  .list-tabs--split .list-tabs__item { flex: 1; justify-content: center; }
}
