/* ==========================================================================
   Powerline — catalogue: product cards, filters, product page, enquiry list
   Colours come from tokens.css.
   ========================================================================== */

/* --- Header enquiry link ------------------------------------------------- */

.enq-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.6rem 1.15rem;
  background: var(--red-fill);
  border: 1px solid var(--red-fill);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--white);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.enq-link:hover {
  background: var(--red-700);
  border-color: var(--red-700);
  color: var(--white);
  transform: translateY(-1px);
}

.enq-link svg {
  width: 18px;
  height: 18px;
}

.enq-link__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding-inline: 0.35rem;
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--red-fill);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0;
}

.enq-link__count[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .enq-link__text {
    display: none;
  }
  .enq-link {
    padding: 0.5rem 0.65rem;
  }
}

/* --- Notice after adding without JavaScript ------------------------------ */

.flash {
  background: var(--black);
  color: var(--on-dark);
  font-size: var(--fs-sm);
}

.flash--error {
  background: var(--red-700);
}

.flash__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  justify-content: space-between;
  padding-block: var(--sp-3);
}

.flash a {
  color: var(--on-dark);
  font-weight: 600;
  text-decoration: underline;
}

/* --- Product grid and cards ---------------------------------------------- */

.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: var(--sp-5);
}

.pcard {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--dur-mid) var(--ease-out), border-color var(--dur-mid) var(--ease-out);
}

.pcard:hover,
.pcard:focus-within {
  box-shadow: var(--sh-md);
  border-color: var(--line-strong);
}

.pcard__media {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--mist);
}

.pcard__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--sp-3);
}

.pcard__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
}

.pcard__brand {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--red-ink);
}

.pcard__name {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.35;
}

.pcard__name a:hover {
  color: var(--red-ink);
}

.pcard__model,
.pcard__sum {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--slate);
}

.pcard__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  margin: var(--sp-2) 0 0;
}

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

.avail {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--slate);
}

.avail::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--black-300);
}

.avail--in_stock {
  color: var(--ink);
}

.avail--in_stock::before {
  background: var(--black);
}

.avail--out_of_stock::before,
.avail--discontinued::before {
  background: var(--red);
}

.pcard__foot {
  padding: 0 var(--sp-4) var(--sp-4);
}

/* Phones: two products side by side, with compact cards, instead of one card filling the screen.
   The quantity box is hidden here (it is 1 by default and can be changed on the inquiry list); the
   button then has the full width of the card. */
@media (max-width: 560px) {
  .pgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
  }

  .pcard {
    border-radius: var(--r-md);
  }

  .pcard__media img {
    padding: var(--sp-2);
  }

  .pcard__body {
    gap: 0.15rem;
    padding: var(--sp-3) var(--sp-3) var(--sp-2);
  }

  .pcard__brand {
    font-size: 0.65rem;
  }

  .pcard__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
    font-size: var(--fs-sm);
    line-height: 1.3;
  }

  .pcard__model {
    font-size: var(--fs-xs);
  }

  .pcard__sum {
    display: none;
  }

  .pcard__meta {
    margin-top: auto;
    padding-top: var(--sp-2);
  }

  .pcard__foot {
    padding: 0 var(--sp-3) var(--sp-3);
  }

  .pcard .qty {
    display: none;
  }

  .pcard .addform .btn {
    flex: 1 1 100%;
    padding: 0.65rem 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
  }
}

/* --- Quantity + add button ----------------------------------------------- */

.addform {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: stretch;
}

/* The base button never wraps and hides what overflows, so in a narrow box its label was cut off at both
   edges. Here the label may wrap, and the button drops below the quantity box when the row is too tight. */
.addform .btn {
  flex: 1 1 11rem;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}

.addform--compact .btn {
  padding-inline: var(--sp-3);
  font-size: var(--fs-sm);
}

.addform[data-state="added"] .btn {
  background: var(--black);
}

.addform__na {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--slate);
}

.qty {
  width: 4.25rem;
  padding: 0.6rem 0.5rem;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  color: var(--ink);
}

.qty:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--black) 14%, transparent);
}

/* --- Filters ------------------------------------------------------------- */

.filters__form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-4);
}

.filters__group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.filters__group + .filters__group {
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}

.filters__group legend {
  padding: 0;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink);
}

.filters__group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.opt {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.4rem 0;
  font-size: var(--fs-sm);
  color: var(--ink);
  cursor: pointer;
}

.opt input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--red-fill);
}

.opt__label {
  flex: 1;
}

.opt__count {
  font-size: var(--fs-xs);
  color: var(--slate-light);
}

.filters__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.filters__clear {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--red-ink);
  text-decoration: underline;
}

/* With JavaScript, ticking a box applies the filter, so the button is redundant. */
.js .filters__actions .btn {
  display: none;
}

/* --- Sort links and pager ------------------------------------------------ */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--slate);
}

.toolbar label {
  font-weight: 600;
  color: var(--ink);
}

.toolbar__select {
  -webkit-appearance: none;
  appearance: none;
  min-width: 12.5rem;
  padding: 0.6rem 2.9rem 0.6rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  /* Our own chevron, so it sits well inside the rounded edge on every browser. */
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%2315171c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.15rem center;
  background-size: 0.75rem auto;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.toolbar__select:hover {
  border-color: var(--black);
}

.toolbar__select:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  margin-top: var(--sp-7);
}

.pager__link {
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
}

a.pager__link:hover {
  border-color: var(--black);
  background: var(--mist);
}

.pager__link.is-disabled {
  color: var(--slate-light);
  background: var(--mist);
}

.pager__pos {
  font-size: var(--fs-sm);
  color: var(--slate);
}

/* --- Product page -------------------------------------------------------- */

.page-hero--slim {
  padding-block: var(--sp-5);
}

.page-hero--slim .breadcrumb {
  margin-bottom: 0;
}

/* The enquiry list keeps its heading, so it only needs a tighter hero. */
.page-hero--slim h1 {
  font-size: var(--fs-3xl);
}

.page-hero--slim h1 + p {
  margin-top: var(--sp-2);
  font-size: var(--fs-base);
}

.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 1rem + 2.5vw, 3.5rem);
  align-items: start;
  padding-block: var(--sp-7) var(--sp-8);
}

.pdp__detail {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--sp-7);
  padding-top: var(--sp-7);
  border-top: 1px solid var(--line);
}

.pdp__detail h2,
.pdp__docs h2,
.related h2 {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-xl);
}

@media (max-width: 860px) {
  .pdp {
    grid-template-columns: 1fr;
  }
}

.pdp__main {
  display: grid;
  place-items: center;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.pdp__main img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: var(--sp-5);
}

.pdp__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  list-style: none;
  margin: var(--sp-4) 0 0;
  padding: 0;
}

.pdp__thumbs a {
  display: block;
  width: 84px;
  background: var(--mist);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.pdp__thumbs a[aria-current="true"] {
  border-color: var(--red);
}

.pdp__thumbs img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.pdp__info h1 {
  margin: var(--sp-1) 0 var(--sp-3);
  font-size: var(--fs-2xl);
  line-height: var(--lh-snug);
}

.pdp__ids {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-6);
  margin: 0 0 var(--sp-4);
}

.pdp__ids dt {
  font-size: var(--fs-xs);
  color: var(--slate-light);
}

.pdp__ids dd {
  margin: 0;
  font-weight: 600;
}

.pdp__lede {
  margin: 0 0 var(--sp-4);
  color: var(--slate);
}

.pdp__buy {
  margin-top: var(--sp-5);
  padding: var(--sp-5);
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.pdp__buy .qty {
  width: 5rem;
}

.pdp__buy .btn {
  flex: 0 1 auto;
}

.pdp__note {
  margin: var(--sp-3) 0 0;
  font-size: var(--fs-sm);
  color: var(--slate);
}

.pdp__docs {
  margin-top: var(--sp-6);
}

.pdp__docs h2 {
  font-size: var(--fs-lg);
}

.pdp__docs ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pdp__docs a {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.pdp__docs a:hover {
  color: var(--red-ink);
}

.pdp__docs a span {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--slate-light);
}

.specs {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.specs th,
.specs td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.specs th {
  width: 45%;
  font-weight: 600;
  color: var(--slate);
  background: var(--mist);
}

.prose p {
  margin: 0 0 var(--sp-4);
  max-width: var(--maxw-prose);
}

.prose ul {
  margin: 0 0 var(--sp-4);
  padding-left: 1.25rem;
  list-style: disc;
  max-width: var(--maxw-prose);
}

.prose li + li {
  margin-top: var(--sp-2);
}

.related {
  padding-block: 0 var(--sp-10);
}

/* --- Enquiry list -------------------------------------------------------- */

.enq {
  padding-block: var(--sp-7) var(--sp-10);
  max-width: 62rem;
}

.eq {
  list-style: none;
  margin: 0 0 var(--sp-6);
  padding: 0;
  border-top: 1px solid var(--line);
}

.eq__line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
  gap: var(--sp-4);
  align-items: center;
  padding-block: var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.eq__media {
  display: block;
  width: 96px;
  aspect-ratio: 1 / 1;
  background: var(--mist);
  border-radius: var(--r-md);
  overflow: hidden;
}

.eq__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.eq__what h2 {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
}

.eq__what a:hover {
  color: var(--red-ink);
}

.eq__qty {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.eq__qty label {
  font-size: var(--fs-sm);
  color: var(--slate);
}

.eq__qty .btn {
  padding: 0.55rem 0.9rem;
  font-size: var(--fs-sm);
}

.linkbtn {
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--red-ink);
  text-decoration: underline;
  cursor: pointer;
}

.eq__next {
  padding: var(--sp-6);
}

.eq__next h2 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-xl);
}

.eq__next p {
  margin: 0 0 var(--sp-4);
  color: var(--slate);
}

@media (max-width: 720px) {
  .eq__line {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .eq__media {
    width: 72px;
  }
  .eq__qty,
  .eq__rm {
    grid-column: 2;
  }
}

/* --- Enquiry form and confirmation --------------------------------------- */

.eqform {
  padding: var(--sp-6);
}

.eqform h2 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-xl);
}

.eqform__intro {
  margin: 0 0 var(--sp-5);
  color: var(--slate);
}

.eqform__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4) var(--sp-5);
}

.eqform__wide {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .eqform {
    padding: var(--sp-5);
  }
  .eqform__grid {
    grid-template-columns: 1fr;
  }
}

.eqform__errors {
  margin-bottom: var(--sp-5);
  padding: var(--sp-4);
  background: var(--red-100);
  border: 1px solid var(--red);
  border-radius: var(--r-md);
  color: var(--ink);
  font-size: var(--fs-sm);
}

.eqform__errors ul {
  margin: var(--sp-2) 0 0;
  padding-left: 1.2rem;
}

.eqform__consent {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  margin: var(--sp-5) 0 var(--sp-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}

.eqform__consent input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--red-fill);
}

.eqform .btn-row {
  margin-top: var(--sp-5);
}

.eqform__alt {
  margin: var(--sp-4) 0 0;
  font-size: var(--fs-sm);
  color: var(--slate);
}

.eqform__alt a {
  font-weight: 600;
  text-decoration: underline;
}

.eqdone {
  padding: var(--sp-7) var(--sp-6);
}

.eqdone__label {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--slate);
}

.eqdone__ref {
  margin: var(--sp-1) 0 var(--sp-3);
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  color: var(--red-ink);
}

.eqdone h2 {
  margin: var(--sp-6) 0 var(--sp-3);
  font-size: var(--fs-lg);
}

.eqdone__items {
  list-style: none;
  margin: 0 0 var(--sp-6);
  padding: 0;
  border-top: 1px solid var(--line);
}

.eqdone__items li {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}

.eqdone__items small {
  color: var(--slate-light);
}

/* Buttons, cards and controls are not text links: no underline (the page's plain links keep theirs). */
.pcard__media,
.pcard__name a,
.pager__link,
.enq-link,
.fab {
  text-decoration: none;
}
