/* ==========================================================================
   Khris & George — components.css
   Cards, shop toolbar, product detail, accordions, forms, toast, prose.
   ========================================================================== */

/* --- Product card --------------------------------------------------------- */
.card { display: flex; flex-direction: column; height: 100%; }

.card__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--panel);
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), opacity 0.4s var(--ease);
}
.card:hover .card__media img { transform: scale(1.045); }

/* Second image revealed on hover, when a product has one */
.card__media img + img {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.card:hover .card__media img + img { opacity: 1; }

.card__tag {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  padding: 0.3rem 0.7rem;
  background: var(--ink);
  color: var(--on-dark);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.card__tag--soft { background: var(--bg); color: var(--ink); }

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.35rem;
  padding-top: 1.1rem;
}
.card__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.25;
  color: var(--ink);
}
.card__notes {
  font-size: var(--step--1);
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.card__price {
  margin-top: auto;
  padding-top: 0.6rem;
  font-size: var(--step-0);
  color: var(--ink);
}
.card__price s { margin-left: 0.5rem; color: var(--ink-faint); }

.card a:focus-visible { outline-offset: 4px; }

/* --- Collection tile (image with caption over a dark scrim) --------------- */
.tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  min-height: clamp(15rem, 34vw, 22rem);
  background: var(--panel);
  color: var(--on-dark);
}
.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 22, 17, 0.66), rgba(26, 22, 17, 0.06) 62%);
}
.tile:hover img { transform: scale(1.06); }
.tile__body { position: relative; z-index: 1; padding: 1.5rem; }
.tile__body h3 { color: var(--on-dark); }
.tile__body p { margin: 0.35rem 0 0; font-size: var(--step--1); color: rgba(244, 242, 238, 0.8); }

/* --- Value / feature row -------------------------------------------------- */
.feature { text-align: center; }
.feature svg {
  width: 34px;
  height: 34px;
  margin: 0 auto 1.1rem;
  stroke: var(--ink);
  fill: none;
  stroke-width: 1.1;
}
.feature h3 { font-size: var(--step-1); margin-bottom: 0.6rem; }
.feature p { font-size: var(--step--1); line-height: 1.8; }

/* --- Shop toolbar -------------------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
  border-block: 1px solid var(--line);
}

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }

.toolbar__right { display: flex; align-items: center; gap: 0.75rem; }
.toolbar__right label {
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.toolbar__right .select { width: auto; min-width: 12rem; padding-block: 0.6rem; }

.result-count {
  padding-top: 1.5rem;
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.empty-state {
  padding: clamp(3rem, 8vw, 6rem) 1rem;
  text-align: center;
}
.empty-state h3 { margin-bottom: 0.75rem; }

/* --- Breadcrumb ---------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-block: 1.5rem;
  list-style: none;
  font-size: var(--step--1);
  color: var(--ink-faint);
}
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; color: var(--line); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* --- Product detail ------------------------------------------------------ */
.product {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: var(--section-y);
}

.gallery__main {
  aspect-ratio: 1 / 1;
  background: var(--panel);
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }

.gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.gallery__thumbs button {
  flex: 0 1 calc((100% - 1.5rem) / 3);
  padding: 0;
  border: 1px solid transparent;
  background: var(--panel);
  cursor: pointer;
  aspect-ratio: 1 / 1;
  transition: border-color 0.25s var(--ease), opacity 0.25s var(--ease);
}
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs button:hover { opacity: 0.85; }
.gallery__thumbs button[aria-current="true"] { border-color: var(--ink); }

.product__info { max-width: 34rem; }
.product__title { margin-bottom: 0.75rem; }
.product__notes {
  margin-bottom: 1.5rem;
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.product__price {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  font-size: var(--step-2);
  font-family: var(--font-display);
  color: var(--ink);
}
.product__price s { font-size: var(--step-1); color: var(--ink-faint); }
.product__desc { margin-bottom: 1.75rem; }

.spec-list {
  margin-bottom: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: var(--step--1);
}
.spec-list li {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.55rem 0;
}
.spec-list dt, .spec-list .k { color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; }
.spec-list .v { color: var(--ink); text-align: right; }

.buy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}
.qty button {
  width: 3rem;
  height: 3rem;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
}
.qty input {
  width: 3rem;
  height: 3rem;
  border: 0;
  border-inline: 1px solid var(--line);
  background: none;
  text-align: center;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.buy-row .btn { flex: 1 1 12rem; }

.stock {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: var(--step--1);
  color: var(--ink-faint);
}
.stock::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #4e7a56;
}
.stock--low::before { background: #b07d2b; }
.stock--out::before { background: #a4462f; }

/* --- Accordion ----------------------------------------------------------- */
.accordion { border-top: 1px solid var(--line); }
.accordion__item { border-bottom: 1px solid var(--line); }

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  padding: 1.25rem 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: var(--step-0);
  text-align: left;
  cursor: pointer;
}
.accordion__trigger .plus {
  position: relative;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
}
.accordion__trigger .plus::before,
.accordion__trigger .plus::after {
  content: "";
  position: absolute;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.accordion__trigger .plus::before { top: 5px; left: 0; width: 12px; height: 1px; }
.accordion__trigger .plus::after { top: 0; left: 5px; width: 1px; height: 12px; }
.accordion__trigger[aria-expanded="true"] .plus::after { transform: scaleY(0); }

.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}
.accordion__panel > div { overflow: hidden; }
.accordion__panel[data-open="true"] { grid-template-rows: 1fr; }
.accordion__panel .inner { padding-bottom: 1.5rem; font-size: var(--step-0); }
.accordion__panel ul { margin: 0.5rem 0 0 1.1rem; list-style: disc; }
.accordion__panel li { margin-bottom: 0.35rem; }

/* --- Newsletter ---------------------------------------------------------- */
.newsletter { background: var(--ink); color: var(--on-dark-soft); }
.newsletter .inner {
  max-width: 34rem;
  margin-inline: auto;
  padding-block: clamp(3rem, 7vw, 5rem);
  text-align: center;
}
.newsletter h2 { color: var(--on-dark); margin-bottom: 1rem; }
.newsletter p { font-size: var(--step--1); }
.newsletter form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}
.newsletter .input {
  flex: 1 1 14rem;
  border-color: var(--line-dark);
  background: transparent;
  color: var(--on-dark);
}
.newsletter .input::placeholder { color: var(--on-dark-soft); }
.newsletter .form-note { margin-top: 1rem; font-size: var(--step--1); }
.newsletter .form-note--ok { color: #9fc3a5; }

/* --- Quote / pull ------------------------------------------------------- */
.quote {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
}
.quote blockquote {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.4;
  color: var(--ink);
}
.quote figcaption {
  margin-top: 1.25rem;
  font-size: var(--step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* --- Prose (story, privacy, faq copy) ----------------------------------- */
.prose { max-width: 44rem; }
.prose h2 { margin: 2.75rem 0 1rem; font-size: var(--step-2); }
.prose h3 { margin: 2rem 0 0.75rem; font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1.1em 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose .meta {
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: var(--step--1); }
.prose th, .prose td { padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--ink); font-weight: 600; }

/* Table of contents */
.toc {
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  background: var(--panel-soft);
}
.toc h2 {
  margin: 0 0 0.9rem;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.toc ol { margin: 0 0 0 1.1rem; font-size: var(--step--1); }
.toc li { margin-bottom: 0.4rem; }

/* --- Contact ------------------------------------------------------------ */
.contact-grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.contact-aside { font-size: var(--step-0); }
.contact-aside h3 {
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.contact-aside + .contact-aside { margin-top: 2.25rem; }
.contact-aside a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.contact-aside dl { margin: 0; }
.contact-aside dt { color: var(--ink-faint); }
.contact-aside dd { margin: 0 0 0.6rem; color: var(--ink); }

.form-note { margin-top: 1rem; font-size: var(--step--1); }
.form-note--ok { color: #3f6b48; }
.form-note--err { color: #a4462f; }

/* --- Wide content scrolls inside itself rather than the page ------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 30rem; }

/* --- Toast -------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100vw - 2rem);
  padding: 0.9rem 1.4rem;
  background: var(--ink);
  color: var(--on-dark);
  font-size: var(--step--1);
  transform: translate(-50%, 150%);
  transition: transform 0.4s var(--ease);
}
.toast[data-show="true"] { transform: translate(-50%, 0); }

/* --- Reveal on scroll --------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Breakpoints
   ========================================================================== */

@media (min-width: 48rem) {          /* 768px */
  .contact-grid { grid-template-columns: 1.35fr 1fr; }
  .newsletter form { flex-wrap: nowrap; }
}

@media (min-width: 62rem) {          /* 992px */
  .product { grid-template-columns: 1fr 1fr; align-items: start; }
  .product__gallery { position: sticky; top: calc(var(--header-h) + 2rem); }
}
