/* The catalogue, on top of styles.css.
   Every colour, radius and family here is one of the site's own tokens —
   this file adds layout, not a second design. IBM Plex Mono is reserved for
   SKUs and codes, exactly as it is on the rest of the site. */

.shop { padding-block: 32px 72px; }

/* ------------------------------------------------------------ breadcrumbs */
.shop-crumbs { margin-bottom: 20px; font-size: .875rem; color: var(--steel); }
.shop-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.shop-crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--line); }
.shop-crumbs a { color: var(--steel); }
.shop-crumbs a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ head */
.shop-head h1 { margin: 0 0 8px; }
.shop-intro { margin: 0; max-width: 60ch; color: var(--steel); }
.shop-count-line { margin: 12px 0 0; font-size: .875rem; color: var(--steel); }

/* ---------------------------------------------------------------- search */
.shop-search { display: flex; gap: 10px; margin: 24px 0 8px; max-width: 540px; }
.shop-search input {
  flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font: inherit;
}
.shop-search input:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; border-color: var(--orange); }
.shop-search button {
  min-height: 48px; padding: 10px 20px; border: 1.5px solid transparent;
  border-radius: var(--radius); background: var(--orange); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer;
}
.shop-search button:hover { background: #F06A14; }

/* ----------------------------------------------------------------- tiles */
.shop-tiles {
  display: grid; gap: 20px; margin: 32px 0 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.shop-tiles a {
  display: block; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); overflow: hidden; text-decoration: none; color: var(--ink);
  transition: border-color .15s ease;
}
.shop-tiles a:hover { border-color: var(--ink); }
.shop-tiles img { display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; }
.shop-tile-noimage { display: block; aspect-ratio: 4/3; background: var(--mist); }
.shop-tile-name { display: block; padding: 14px 16px 2px; font-weight: 600; }
.shop-tile-count { display: block; padding: 0 16px 14px; font-size: .8125rem; color: var(--steel); }

/* ---------------------------------------------------------------- layout */
.shop-layout { display: grid; gap: 28px; margin-top: 28px; grid-template-columns: 220px minmax(0, 1fr); }
.shop-results { min-width: 0; }

.shop-filter-toggle { display: none; }

.shop-filters { align-self: start; position: sticky; top: 16px; }
.shop-filters-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 0 0 12px; font-weight: 600;
}
.shop-clear { border: 0; background: none; padding: 0; color: var(--rust); font: inherit; font-size: .8125rem; cursor: pointer; text-decoration: underline; }
.shop-filter { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0 4px; }
.shop-filter legend {
  padding: 0; font-size: .75rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--steel);
}
.shop-filter label {
  display: flex; align-items: center; gap: 8px; min-height: 36px;
  font-size: .9375rem; cursor: pointer;
}
.shop-filter input { accent-color: var(--orange); width: 16px; height: 16px; }
.shop-count { margin-left: auto; font-size: .8125rem; color: var(--steel); }

.shop-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.shop-toolbar select {
  min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line);
  border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit;
}

/* ----------------------------------------------------------------- cards */
.shop-grid {
  display: grid; gap: 20px; margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.shop-grid--small { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: 16px; }
.shop-card a {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); padding: 14px; text-decoration: none; color: var(--ink);
  transition: border-color .15s ease;
}
.shop-card a:hover { border-color: var(--ink); }
.shop-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; margin-bottom: 12px; }
.shop-card-noimage { display: block; aspect-ratio: 1; background: var(--mist); margin-bottom: 12px; }
.shop-card-title { font-weight: 600; line-height: 1.35; }
.shop-card-meta { font-size: .8125rem; color: var(--steel); }
.shop-empty { margin-top: 24px; color: var(--steel); }

/* --------------------------------------------------------- product page */
.shop-product-top { display: grid; gap: 36px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-bottom: 48px; }

.shop-gallery-main { display: block; border: 1px solid var(--line); border-radius: var(--radius); }
.shop-gallery-main img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.shop-gallery-none { aspect-ratio: 1; background: var(--mist); border-radius: var(--radius); }
.shop-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.shop-thumbs button {
  width: 68px; height: 68px; padding: 4px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper);
}
.shop-thumbs button[aria-current="true"] { border-color: var(--orange); }
.shop-thumbs img { display: block; width: 100%; height: 100%; object-fit: contain; }

.shop-product-facts h1 { margin: 0 0 10px; }
.shop-ids { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 20px; align-items: center; }
.shop-brand { font-weight: 600; }
.shop-sku { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .8125rem; color: var(--steel); }
.shop-pack { font-size: .875rem; color: var(--steel); }
.shop-features { margin: 0 0 24px; padding-left: 20px; }
.shop-features li { margin-bottom: 6px; }

.shop-price { border-top: 1px solid var(--line); padding-top: 20px; }
.shop-price p { margin: 0 0 12px; color: var(--steel); font-size: .9375rem; }

/* ------------------------------------------------------------------ tabs */
.shop-tablist { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.shop-tablist button {
  min-height: 44px; padding: 10px 18px; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; background: none; font: inherit; font-weight: 600;
  color: var(--steel); cursor: pointer;
}
.shop-tablist button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }
.shop-panel { padding-top: 24px; max-width: 70ch; }
/* Without JavaScript every panel is simply a section with its own heading. */
.shop-panel-heading { margin-top: 0; }
.shop-tabs[data-enhanced="true"] .shop-panel-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shop-tabs:not([data-enhanced="true"]) .shop-tablist { display: none; }

.shop-specs { width: 100%; border-collapse: collapse; }
.shop-specs th, .shop-specs td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.shop-specs th { width: 40%; font-weight: 600; color: var(--steel); }

.shop-docs { margin: 0; padding: 0; list-style: none; }
.shop-docs a { display: flex; align-items: baseline; gap: 10px; min-height: 44px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shop-docs span { font-size: .8125rem; color: var(--steel); }

.shop-section { margin-top: 48px; }
.shop-section h2 { margin: 0; }

/* ---------------------------------------------------------- discontinued */
.shop-gone-note { font-weight: 600; }
.shop-gone-back { margin-top: 32px; }

/* ----------------------------------------------------------------- phone */
@media (max-width: 900px) {
  .shop-product-top { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 768px) {
  .shop-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }

  .shop-filter-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 10px 20px; border: 1.5px solid var(--ink);
    border-radius: var(--radius); background: var(--paper); color: var(--ink);
    font: inherit; font-weight: 600; cursor: pointer;
  }

  /* A slide-up panel, so the grid keeps the screen until filters are wanted. */
  .shop-filters {
    position: fixed; inset: auto 0 0 0; z-index: 60; max-height: 80vh; overflow-y: auto;
    margin: 0; padding: 20px 24px calc(24px + env(safe-area-inset-bottom));
    background: var(--paper); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 32px rgb(30 33 38 / 18%);
    transform: translateY(100%); transition: transform .2s ease; visibility: hidden;
  }
  .shop-filters[data-open="true"] { transform: translateY(0); visibility: visible; }
  .shop-filters-head { font-size: 1.125rem; }

  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .shop-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
