/*
 * Duneed catalogue — the public product/family/category/brand pages
 * (plan 24 §6, phase 3).
 *
 * Layered ON TOP of blog/blog.css, never instead of it: that file owns the
 * design tokens (--color-*, --radius-*, the light/dark palettes) and the
 * shared shell (header, footer, .wrap, .pagination, .empty-state). This one
 * only adds the components the catalogue introduces, and every colour below
 * is a token reference — no hex values, so a palette change stays a
 * one-file change and dark mode keeps working for free.
 *
 * Loaded only on catalogue pages, via `blog/base.html`'s `extra_head` block:
 * a blog post has no reason to download it.
 *
 * Mobile-first throughout; the only breakpoint is 640px, matching
 * blog.css's. Every grid is `auto-fill`/`minmax`, so nothing needs a media
 * query to reflow, and every image slot has a reserved aspect ratio — plan
 * 24 §6 requires Core Web Vitals to pass on mobile, and layout shift is the
 * cheapest one to lose by accident.
 */

/* --- Wider shell for listing pages ------------------------------------- */
/* blog.css caps `.wrap` at 780px, which is right for a column of prose and
   too narrow for a product grid or an offer table. */
.site-main.wrap {
  max-width: 1040px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Breadcrumbs -------------------------------------------------------- */
.crumbs {
  margin: 0 0 1.5rem;
  font-size: 0.8125rem;
  color: var(--color-fg-muted);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--color-fg-faint);
}

.crumbs a {
  color: var(--color-fg-muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--color-primary);
}

/* --- Landing ------------------------------------------------------------ */
.hero {
  margin: 0 0 3rem;
}

.hero h1 {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-fg);
  margin: 0 0 0.75rem;
}

@media (min-width: 640px) {
  .hero h1 {
    font-size: 2.5rem;
  }
}

.hero__lead {
  font-size: 1.0625rem;
  color: var(--color-fg-muted);
  max-width: 56ch;
  margin: 0;
}

.home-block {
  margin: 0 0 3rem;
}

.home-block h2,
.listing__header h1 {
  color: var(--color-fg);
}

.home-block h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
}

.how__steps {
  margin: 0;
  padding-left: 1.2em;
  color: var(--color-fg-muted);
  max-width: 62ch;
}

.how__steps li {
  margin-bottom: 0.6em;
}

.how__steps b {
  color: var(--color-fg);
}

/* --- Chips (categories, brands, facet options) -------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4em 0.85em;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-fg-body);
  font-size: 0.875rem;
  text-decoration: none;
}

.chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.chip--on {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
}

.chip--on:hover {
  color: #ffffff;
}

/* --- Listing headers ---------------------------------------------------- */
.listing__header {
  margin: 0 0 2rem;
}

.listing__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
}

.listing__eyebrow a {
  color: var(--color-primary);
  text-decoration: none;
}

.listing__header h1 {
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.6rem;
}

@media (min-width: 640px) {
  .listing__header h1 {
    font-size: 2rem;
  }
}

.listing__lead {
  color: var(--color-fg-muted);
  max-width: 62ch;
  margin: 0;
}

.listing__logo {
  border-radius: var(--radius-input);
  margin-bottom: 1rem;
  width: auto;
  max-height: 60px;
}

.listing__uplink {
  margin-top: 2rem;
  font-size: 0.9375rem;
}

.listing__uplink a {
  color: var(--color-primary);
}

.facets {
  margin: 0 0 2rem;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.facets__heading {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-fg-muted);
  margin: 0 0 1rem;
}

.facet + .facet {
  margin-top: 1.25rem;
}

.facet__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-fg);
  margin: 0 0 0.5rem;
}

.facet__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.facets__clear {
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
}

.facets__clear a {
  color: var(--color-primary);
}

/* --- Product cards ------------------------------------------------------ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
  }
}

.card {
  display: flex;
}

.card__link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  text-decoration: none;
}

.card__link:hover {
  border-color: var(--color-primary);
}

.card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--color-muted-surface);
  border-radius: var(--radius-input);
  margin-bottom: 0.5rem;
}

.card__image--empty {
  display: block;
}

.card__brand {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-fg-faint);
}

.card__name {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-fg);
}

.card__price {
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}

.card__price--none {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-fg-faint);
}

/* --- Product page ------------------------------------------------------- */
.product__header {
  margin: 0 0 1.75rem;
}

.product__brand {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product__brand a {
  color: var(--color-fg-muted);
  text-decoration: none;
}

.product__header h1 {
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-fg);
  margin: 0 0 0.5rem;
}

@media (min-width: 640px) {
  .product__header h1 {
    font-size: 2rem;
  }
}

.product__type {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-fg-muted);
}

.product__type a {
  color: var(--color-primary);
  text-decoration: none;
}

.product__lead {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .product__lead {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    align-items: start;
  }
}

.product__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--color-muted-surface);
  border-radius: var(--radius-card);
}

.pricebox {
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.pricebox__label {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-fg-muted);
}

.pricebox__price {
  margin: 0 0 0.35rem;
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
}

.pricebox__seller {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--color-fg-body);
}

.pricebox__cta {
  display: block;
  text-align: center;
  padding: 0.7em 1em;
  border-radius: var(--radius-input);
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.pricebox__cta:hover {
  background: var(--color-primary-hover);
}

.pricebox__seen {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-fg-faint);
}

.pricebox__none {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-fg-muted);
}

.product__description,
.specs,
.chart-block,
.offers,
.related {
  margin: 0 0 2.5rem;
}

.product__description h2,
.specs h2,
.chart-block h2,
.offers h2,
.related h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-fg);
  margin: 0 0 1rem;
}

.product__description p {
  color: var(--color-fg-body);
  max-width: 68ch;
  line-height: 1.75;
}

/* --- Spec + offer tables ------------------------------------------------ */
.specs__table,
.offers__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.specs__table th,
.specs__table td,
.offers__table th,
.offers__table td {
  border-bottom: 1px solid var(--color-border);
  padding: 0.65em 0.75em;
  text-align: left;
  vertical-align: top;
}

.specs__table th {
  width: 42%;
  font-weight: 600;
  color: var(--color-fg-muted);
}

.specs__table td {
  color: var(--color-fg);
}

.offers__table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-fg-muted);
  font-weight: 600;
}

.offers__table tbody th {
  font-weight: 600;
  color: var(--color-fg);
}

.offers__title {
  display: block;
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--color-fg-faint);
}

.offers__price {
  font-weight: 700;
  color: var(--color-fg);
  white-space: nowrap;
}

.offers__stock {
  color: var(--color-fg-muted);
  font-size: 0.875rem;
}

.offers__seen {
  display: block;
  font-size: 0.75rem;
  color: var(--color-fg-faint);
}

.offers__table .is-best {
  background: var(--color-primary-subtle);
}

.offers__table .is-best .offers__price {
  color: var(--color-primary);
}

.offers__link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.offers__note {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-fg-faint);
  max-width: 68ch;
}

/* --- Price chart -------------------------------------------------------- */
.chart {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.chart__svg {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}

.chart__line {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.chart__area {
  fill: var(--color-primary-subtle);
  stroke: none;
}

.chart__dot {
  fill: var(--color-primary);
}

.chart__caption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--color-fg-muted);
}

.chart__stat b {
  color: var(--color-fg-faint);
  font-weight: 600;
  margin-right: 0.25rem;
}

/* --- Campaigns (plan 24 §5, phase 4) ------------------------------------ */
/* Lives in catalog.css rather than a campaigns.css of its own for one
   concrete reason: the PRODUCT page renders campaign cards, and a third
   stylesheet would be a third blocking request on the most valuable page on
   the site. The campaign pages extend `catalog/base_page.html`, so they get
   this file for free and the whole public surface stays two stylesheets.
   Every colour below is a token from blog.css — no hex, so dark mode keeps
   working for free. */

.campaign-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.campaign-card {
  display: flex;
}

.campaign-card__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.campaign-card__link:hover {
  border-color: var(--color-primary);
}

.campaign-card__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-muted-surface);
}

.campaign-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem 1rem;
}

.campaign-card__tier {
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-subtle);
  border-radius: var(--radius-input);
  padding: 0.15rem 0.5rem;
}

.campaign-card__company {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-fg-faint);
}

.campaign-card__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-fg);
}

.campaign-card__summary {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-fg-muted);
}

.campaign-card__until {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-fg-faint);
}

.campaigns {
  /* Bottom margin added in phase 5: the product page now has a related-
     products grid and a blog-links block BELOW this section, so "0" left
     "Tüm kampanyalar" touching the next heading. */
  margin: 2.5rem 0 2.5rem;
}

.campaigns h2 {
  font-size: 1.125rem;
  margin: 0 0 1rem;
  color: var(--color-fg);
}

.campaigns__more {
  margin: 1rem 0 0;
  font-size: 0.875rem;
}

.campaigns__more a {
  color: var(--color-primary);
}

/* --- Company page ------------------------------------------------------- */
.company-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 0 0 2rem;
}

.company-header__logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  padding: 0.5rem;
}

.company-header h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--color-fg);
}

.company-header__kind,
.company-header__site {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--color-fg-muted);
}

.company-header__site a {
  color: var(--color-primary);
}

.campaign-archive {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.campaign-archive li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
  font-size: 0.9375rem;
}

.campaign-archive a {
  color: var(--color-primary);
}

.campaign-archive__date {
  font-size: 0.8125rem;
  color: var(--color-fg-faint);
}

/* --- Campaign detail ---------------------------------------------------- */
.notice {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-card);
  font-size: 0.9375rem;
  line-height: 1.5;
  border: 1px solid var(--color-warning-border);
  background: var(--color-warning-surface);
  color: var(--color-warning-fg);
}

.campaign__header {
  margin: 0 0 1.5rem;
}

.campaign__company {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.campaign__company a {
  color: var(--color-fg-faint);
  text-decoration: none;
}

.campaign__company a:hover {
  color: var(--color-primary);
}

.campaign__header h1 {
  margin: 0;
  font-size: 1.625rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-fg);
}

.campaign__summary {
  margin: 0.75rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-fg-muted);
  max-width: 68ch;
}

.campaign__dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin: 1.25rem 0 0;
}

.campaign__dates dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-fg-faint);
}

.campaign__dates dd {
  margin: 0.15rem 0 0;
  font-size: 0.9375rem;
  color: var(--color-fg);
}

.campaign__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  background: var(--color-muted-surface);
  margin: 0 0 1.5rem;
}

.campaign__cta {
  margin: 0 0 1.5rem;
}

/* Reuses the pricebox button so the site has ONE call-to-action treatment,
   but not its full-bleed width: in a narrow price column a block button is
   right, in a page of prose it reads as a banner. */
.campaign__cta .pricebox__cta {
  display: inline-block;
  padding-left: 1.5em;
  padding-right: 1.5em;
}

.campaign__body {
  margin: 0 0 2rem;
}

.campaign__targets h2,
.campaign__terms h2 {
  font-size: 1.125rem;
  margin: 0 0 0.75rem;
  color: var(--color-fg);
}

.campaign__targets h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-fg-faint);
  margin: 1.25rem 0 0.5rem;
}

.campaign__targets,
.campaign__terms {
  margin: 0 0 2rem;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.campaign__targets p,
.campaign__terms p,
.campaign__retailers {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-fg-body);
  max-width: 68ch;
}

.campaign__disclaimer {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--color-fg-faint);
  max-width: 68ch;
}

/* --- Blog links on catalogue pages (plan 24 §6, phase 5) ---------------- */
.post-links {
  /* Matches `.home-block`'s rhythm, since the landing page includes this
     partial bare rather than wrapping it in one. */
  margin: 0 0 3rem;
}

.post-links h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-fg);
  margin: 0 0 1rem;
}

.post-links__list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-links__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.post-links__item a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.post-links__item a:hover {
  text-decoration: underline;
}

.post-links__date {
  font-size: 0.8125rem;
  color: var(--color-fg-faint);
}

.post-links__more {
  margin: 0;
  font-size: 0.875rem;
}

.post-links__more a {
  color: var(--color-fg-muted);
  text-decoration: none;
}

.post-links__more a:hover {
  color: var(--color-primary);
}

/* Cross-links below a listing's grid: a labelled chip row, so the label and
   the chips read as one block rather than a stray heading. `flex-basis:100%`
   on the label makes it take a line of its own inside the existing wrapping
   flex row — no extra wrapper element, and the chips keep wrapping exactly
   as they do everywhere else. */
.chips--footer {
  margin: 1.75rem 0 2.5rem;
}

.chips__label {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-fg-faint);
}
