/*
 * shop.css — Product/shop styles for kulligraphie.de
 * Modern minimal: white surface, single accent (theme --color), photo-led grid.
 * Uses existing taste theme custom-properties from :root in style.css.
 * BEM: c-product-card__*, product-detail__*, shop-hero__*, shop-grid
 *
 * Loaded from head.hbs only when on tag/shop, post-with-shop-tag, or 404 contexts
 * (kept tiny to stay within the project's perf budget).
 */

/* ------ Tokens (scoped — fall back to theme vars) ------ */
:root {
  --shop-radius: 14px;
  --shop-radius-sm: 8px;
  --shop-shadow: 0 1px 2px rgba(16, 16, 17, 0.04), 0 8px 24px rgba(16, 16, 17, 0.06);
  --shop-shadow-hover: 0 2px 4px rgba(16, 16, 17, 0.06), 0 16px 40px rgba(16, 16, 17, 0.10);
  --shop-border: 1px solid rgba(16, 16, 17, 0.06);
  --shop-muted: var(--gray-2, #6D6E6F);
  --shop-surface: var(--white, #FFFFFF);
  --shop-surface-alt: var(--lighter, #F7F7F8);
  --shop-accent: var(--color, #EC1037);
  --shop-accent-rgb: var(--color-rgb, 236, 16, 55);
  --shop-text: var(--text-color, #343435);
  --shop-heading: var(--headings-color, #101011);
  --shop-gap: clamp(1rem, 1rem + 1vw, 2rem);
}

/* ------ Shop hero (tag listing page) ------ */
.shop-hero {
  max-width: var(--page-width, 1200px);
  margin: 0 auto calc(2rem + 1.5vw);
  padding-bottom: calc(1.5rem + 1vw);
  text-align: center;
  border-bottom: var(--shop-border);
}
.shop-hero__eyebrow {
  display: inline-block;
  font-size: 0.7901234568rem;
  font-variation-settings: "wght" var(--font-weight-bold, 600);
  letter-spacing: 0.12em;
  color: var(--shop-accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}
.shop-hero__title {
  font-size: clamp(1.8rem, 1.8rem + 1.6 * (100vw - 20rem) / 80, 3.4rem);
  margin: 0;
  line-height: 1.1;
  color: var(--shop-heading);
}
.shop-hero__lede {
  color: var(--shop-muted);
  margin: 1rem auto 0;
  max-width: 56ch;
  font-size: 1.05rem;
}
.shop-hero__count {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.7901234568rem;
  color: var(--shop-muted);
  letter-spacing: 0.04em;
}

/* ------ Product grid (overrides default l-grid look for shop) ------ */
.shop-grid {
  display: grid;
  gap: var(--shop-gap);
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 30em) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 56.25em) {
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 90em) {
  .shop-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ------ Product card ------ */
.c-product-card {
  background: var(--shop-surface);
  border-radius: var(--shop-radius);
  border: var(--shop-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}
.c-product-card:hover,
.c-product-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shop-shadow-hover);
}
.c-product-card__media {
  aspect-ratio: 1 / 1;
  background: var(--shop-surface-alt);
  display: block;
  overflow: hidden;
  position: relative;
}
.c-product-card__media img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.c-product-card:hover .c-product-card__media img {
  transform: scale(1.04);
}
.c-product-card__media--placeholder {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(var(--shop-accent-rgb), 0.06), rgba(var(--shop-accent-rgb), 0.02));
  display: flex;
  justify-content: center;
}
.c-product-card__media--placeholder::after {
  content: "";
  width: 38%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: rgba(var(--shop-accent-rgb), 0.10);
}
.c-product-card__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--shop-surface);
  color: var(--shop-heading);
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  font-size: 0.7rem;
  font-variation-settings: "wght" 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(16, 16, 17, 0.06);
}
.c-product-card__body {
  padding: 1rem 1.125rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  flex: 1;
}
.c-product-card__category {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--shop-muted);
}
.c-product-card__title {
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.3;
}
.c-product-card__title a {
  color: var(--shop-heading);
  text-decoration: none;
}
.c-product-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.c-product-card__title a:hover,
.c-product-card__title a:focus-visible {
  color: var(--shop-accent);
}
.c-product-card__price {
  margin-top: auto;
  padding-top: 0.625rem;
  font-variation-settings: "wght" 600;
  font-size: 1rem;
  color: var(--shop-heading);
}
.c-product-card__price--from::before {
  content: "ab ";
  font-variation-settings: "wght" 400;
  color: var(--shop-muted);
  font-size: 0.85em;
}

/* ------ Product detail (post.hbs body when tagged 'shop') ------
 * The featured image is rendered by Publii (post.hbs) as
 *   <figure class="content__featured-image">.
 * For shop posts we lay out:
 *   .content__featured-image  → left column (sticky)
 *   .content__inner           → right column (body content)
 * See further below in the "Inside post.hbs" section.
 */
.product-detail__body {
  display: flex;
  flex-direction: column;
}
.product-detail__body > :first-child { margin-top: 0; }
.product-detail__eyebrow {
  font-size: 0.7901234568rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--shop-accent);
  font-variation-settings: "wght" 600;
  margin: 0 0 0.75rem;
}
.product-detail__title {
  font-size: clamp(1.6rem, 1.6rem + 1.4 * (100vw - 20rem) / 80, 2.6rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
}
.product-detail__price {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  margin: 1.25rem 0 0.25rem;
  font-size: 1.5rem;
  font-variation-settings: "wght" 600;
  color: var(--shop-heading);
}
.product-detail__price-from {
  font-size: 0.875rem;
  font-variation-settings: "wght" 400;
  color: var(--shop-muted);
}
.product-detail__notice {
  color: var(--shop-muted);
  font-size: 0.875rem;
  margin: 0.25rem 0 1.5rem;
}

.product-detail__buy {
  align-items: center;
  background: var(--shop-heading);
  border: none;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(16, 16, 17, 0.18);
  color: var(--white, #fff);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--heading-font);
  font-size: 0.95rem;
  font-variation-settings: "wght" 600;
  gap: 0.5rem;
  padding: 0.95rem 1.75rem;
  text-decoration: none;
  text-transform: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}
@media (min-width: 30em) {
  .product-detail__buy { width: auto; }
}
.product-detail__buy:hover,
.product-detail__buy:focus-visible {
  background: var(--shop-accent);
  color: var(--white, #fff);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(var(--shop-accent-rgb), 0.35);
}
.product-detail__buy svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.product-detail__features {
  border-top: var(--shop-border);
  border-bottom: var(--shop-border);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 1.25rem 0;
}
@media (min-width: 30em) {
  .product-detail__features { grid-template-columns: repeat(2, 1fr); }
}
.product-detail__feature {
  align-items: flex-start;
  display: flex;
  font-size: 0.9rem;
  gap: 0.5rem;
  padding: 0;
}
.product-detail__feature::before {
  /*
    Inline SVG checkmark on a soft "success-green" tinted circle. We use a
    data-URL SVG instead of two crossed linear-gradients (which used to
    render as an "X" and made every feature look "not included").

    The check is intentionally GREEN (#16A34A, Tailwind green-600) — not
    the brand-red --shop-accent — because green checkmarks are the
    universal "feature included" signal in e-commerce (Etsy, Stripe, etc.)
    and read positively even when scanned in a fraction of a second.
    Both the stroke and the circle tint are hardcoded to that green to
    stay visually coherent. If you ever want to make this themable, expose
    --shop-success-rgb above and reference it for the tint (the data-URL
    can NOT use CSS variables, so the stroke stays a literal %2316A34A).
  */
  content: "";
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.2rem;
  border-radius: 999px;
  background-color: rgba(22, 163, 74, 0.14);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.7 2.7L12 5.5' fill='none' stroke='%2316A34A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 70% 70%;
  background-position: center;
  background-repeat: no-repeat;
}

.product-detail__description {
  margin-top: 1.5rem;
  font-size: 1rem;
  line-height: var(--line-height, 1.6);
  color: var(--shop-text);
}
.product-detail__description > :first-child { margin-top: 0; }

.product-detail__meta {
  border-top: var(--shop-border);
  color: var(--shop-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.825rem;
  gap: 0.5rem 1.25rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
}
.product-detail__meta strong {
  color: var(--shop-heading);
  font-variation-settings: "wght" 600;
}

/* ------ Creator CTA (under the shop grid, links to /creator/) ------ */
.shop-creator-cta {
  margin: 2.5rem auto 0;
  max-width: var(--page-width, 1200px);
  background: var(--shop-surface-alt, #f6f1e6);
  border: var(--shop-border);
  border-radius: var(--shop-radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.shop-creator-cta p {
  margin: 0;
  color: var(--shop-text);
  font-size: 0.95rem;
  line-height: 1.5;
}
.shop-creator-cta strong {
  display: inline-block;
  margin-right: 0.35rem;
  font-variation-settings: "wght" 600;
  color: var(--shop-heading);
}

/* ------ Theme pills (tag cloud above the shop grid) ------ */
.shop-themes {
  margin: 0 auto calc(1.5rem + 1vw);
  max-width: var(--page-width, 1200px);
}
.shop-themes__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.625rem;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
}
.shop-themes__item { padding: 0; }
.shop-theme-pill {
  align-items: center;
  background: var(--shop-surface);
  border: var(--shop-border);
  border-radius: 999px;
  color: var(--shop-heading);
  display: inline-flex;
  font-family: var(--heading-font);
  font-size: 0.85rem;
  font-variation-settings: "wght" 600;
  gap: 0.5rem;
  padding: 0.45rem 0.875rem 0.45rem 1rem;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease;
}
.shop-theme-pill:hover,
.shop-theme-pill:focus-visible {
  background: var(--shop-heading);
  border-color: var(--shop-heading);
  color: var(--white, #fff);
  transform: translateY(-1px);
}
.shop-theme-pill__count {
  align-items: center;
  background: var(--shop-surface-alt);
  border-radius: 999px;
  color: var(--shop-muted);
  display: inline-flex;
  font-size: 0.7rem;
  font-variation-settings: "wght" 500;
  height: 1.25rem;
  justify-content: center;
  min-width: 1.4rem;
  padding: 0 0.35rem;
  transition: background 180ms ease, color 180ms ease;
}
.shop-theme-pill:hover .shop-theme-pill__count,
.shop-theme-pill:focus-visible .shop-theme-pill__count {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white, #fff);
}

/* Highlight the active theme on its own /tags/<slug>.html page */
.tag-template .shop-theme-pill[data-slug] {
  /* Default; overridden when slug matches current page below via JS-free CSS hack */
}
.tag-template .shop-themes__item .shop-theme-pill[aria-current="page"],
.tag-template .shop-themes__item .shop-theme-pill[data-active="true"] {
  background: var(--shop-heading);
  border-color: var(--shop-heading);
  color: var(--white, #fff);
}

/* ------ Theme tag hero (shop-hero--theme) ------ */
.shop-hero--theme {
  position: relative;
}
.shop-hero__back {
  display: inline-flex;
  align-items: center;
  font-size: 0.825rem;
  font-variation-settings: "wght" 500;
  color: var(--shop-muted);
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: color 180ms ease;
}
.shop-hero__back:hover,
.shop-hero__back:focus-visible {
  color: var(--shop-heading);
}

/* ------ Trust strip (under hero on shop listing) ------ */
.shop-trust {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0 auto calc(2rem + 1vw);
  max-width: var(--page-width, 1200px);
  padding: 1.25rem;
  background: var(--shop-surface-alt);
  border-radius: var(--shop-radius);
  text-align: center;
}
@media (min-width: 37.5em) {
  .shop-trust { grid-template-columns: repeat(3, 1fr); padding: 1.5rem; }
}
.shop-trust li {
  font-size: 0.875rem;
  color: var(--shop-text);
  padding: 0;
}
.shop-trust strong {
  display: block;
  color: var(--shop-heading);
  font-variation-settings: "wght" 600;
  margin-bottom: 0.125rem;
}

/* ------ Empty state for shop tag with no products ------ */
.shop-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--shop-muted);
}

/* ------ Homepage hero (welcome + CTA to shop) ------ */
.home-hero {
  display: grid;
  place-items: center;
  padding: clamp(2rem, 2rem + 4vw, 6rem) 1rem clamp(2.5rem, 2.5rem + 3vw, 5rem);
  text-align: center;
}
.home-hero__inner {
  max-width: 60ch;
  margin: 0 auto;
}
.home-hero__inner > :first-child { margin-top: 0; }
.home-hero h1 {
  font-size: clamp(2rem, 2rem + 2vw, 3.5rem);
  line-height: 1.1;
  margin: 0;
  color: var(--shop-heading);
}
.home-hero h1 em {
  font-style: normal;
  color: var(--shop-accent);
}
.home-hero h2 {
  font-size: clamp(1.5rem, 1.5rem + 1.5vw, 2.5rem);
  margin: 0 0 0.5rem;
  color: var(--shop-heading);
}
.home-hero p {
  color: var(--shop-muted);
  font-size: clamp(1rem, 1rem + 0.25vw, 1.15rem);
  max-width: 56ch;
  margin: 1rem auto 0;
}
.home-hero__cta {
  align-items: center;
  background: var(--shop-heading);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(16, 16, 17, 0.18);
  color: var(--white, #fff);
  display: inline-flex;
  font-family: var(--heading-font);
  font-size: 0.95rem;
  font-variation-settings: "wght" 600;
  margin-top: 1.75rem;
  padding: 0.95rem 1.75rem;
  text-decoration: none;
  text-transform: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.home-hero__cta:hover,
.home-hero__cta:focus-visible {
  background: var(--shop-accent);
  color: var(--white, #fff);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(var(--shop-accent-rgb), 0.35);
}

/* ------ Homepage shop section ("Aktuelle Produkte auf Etsy") ------ */
.home-shop {
  margin: 0 auto calc(2rem + 1.5vw);
  max-width: var(--page-width, 1200px);
  scroll-margin-top: calc(var(--header-height, 6rem) + 1rem);
}
.home-shop__header {
  margin-bottom: clamp(1.5rem, 1.5rem + 1vw, 3rem);
  text-align: center;
  border-top: var(--shop-border);
  padding-top: clamp(1.5rem, 1.5rem + 1vw, 3rem);
}
.home-shop__title {
  font-size: clamp(1.5rem, 1.5rem + 1vw, 2.25rem);
  margin: 0;
  color: var(--shop-heading);
}
.home-shop__lede {
  color: var(--shop-muted);
  margin: 0.75rem auto 0;
  max-width: 56ch;
}
.home-shop__etsy {
  align-items: center;
  background: transparent;
  border: 1px solid var(--shop-heading);
  border-radius: 999px;
  color: var(--shop-heading);
  display: inline-flex;
  font-family: var(--heading-font);
  font-size: 0.85rem;
  font-variation-settings: "wght" 600;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.6rem 1.25rem;
  text-decoration: none;
  text-transform: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.home-shop__etsy:hover,
.home-shop__etsy:focus-visible {
  background: var(--shop-heading);
  color: var(--white, #fff);
  transform: translateY(-1px);
}
.home-shop__etsy svg { fill: currentColor; }

.shop-grid--home {
  /* Same modern-minimal grid; reused from .shop-grid */
}

/* ------ Inside post.hbs (post tagged 'shop') ------
   The post body ("{{{text}}}") contains the body column generated by
   bin/import-etsy-products.mjs (.product-detail__body, with its own H1).
   The image comes from Publii's featured-image figure (left column).
   The standard .content__header (with .content__title + meta) is hidden
   to avoid a duplicate H1, but we keep .content__maintag (category pill
   above the title) and .content__tags-share (tag pills below the body). */
.post-template--shop .content__related,
.post-template--shop .content__bio,
.post-template--shop .content__nav,
.post-template--shop .content__last-updated,
.post-template--shop .content__title,
.post-template--shop .content__meta {
  display: none;
}
.post-template--shop main.post {
  padding-top: 1.5rem;
}
.post-template--shop .content {
  display: grid;
  gap: clamp(1.5rem, 1.5rem + 2vw, 3rem);
  grid-template-columns: 1fr;
  align-items: start;
  max-width: var(--page-width, 1200px);
  margin: 0 auto;
}
@media (min-width: 56.25em) {
  .post-template--shop .content {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
}

/* Category pill above the layout (mainTag, e.g. "Geburtstag") */
.post-template--shop .content__header {
  grid-column: 1 / -1;
  margin: 0 0 -0.5rem;
  padding: 0;
  border: 0;
}
.post-template--shop .content__maintag {
  align-items: center;
  background: var(--shop-surface-alt);
  border: var(--shop-border);
  border-radius: 999px;
  color: var(--shop-heading);
  display: inline-flex;
  font-family: var(--heading-font);
  font-size: 0.75rem;
  font-variation-settings: "wght" 600;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 180ms ease, color 180ms ease;
}
.post-template--shop .content__maintag:hover,
.post-template--shop .content__maintag:focus-visible {
  background: var(--shop-heading);
  color: var(--white, #fff);
}

.post-template--shop .content__featured-image {
  margin: 0;
  border-radius: var(--shop-radius);
  overflow: hidden;
  background: var(--shop-surface-alt);
  border: var(--shop-border);
}
@media (min-width: 56.25em) {
  .post-template--shop .content__featured-image {
    position: sticky;
    top: calc(var(--header-height, 6rem) + 1.5rem);
  }
}
.post-template--shop .content__featured-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.post-template--shop .content__inner {
  max-width: none;
  margin: 0;
}
.post-template--shop .content__entry {
  margin-bottom: 0;
}
.post-template--shop .content__entry > :first-child { margin-top: 0; }

/* Tag pills under the body (displayTags=1) */
.post-template--shop .content__tags-share {
  border-top: var(--shop-border);
  display: block;
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
}
.post-template--shop .content__tag {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.625rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-template--shop .content__tag::before {
  align-self: center;
  color: var(--shop-muted);
  content: "Themen";
  font-family: var(--heading-font);
  font-size: 0.7rem;
  font-variation-settings: "wght" 600;
  letter-spacing: 0.06em;
  margin-right: 0.25rem;
  text-transform: uppercase;
}
.post-template--shop .content__tag li { padding: 0; }
.post-template--shop .content__tag a {
  background: var(--shop-surface);
  border: var(--shop-border);
  border-radius: 999px;
  color: var(--shop-heading);
  display: inline-block;
  font-family: var(--heading-font);
  font-size: 0.8rem;
  font-variation-settings: "wght" 500;
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.post-template--shop .content__tag a:hover,
.post-template--shop .content__tag a:focus-visible {
  background: var(--shop-heading);
  border-color: var(--shop-heading);
  color: var(--white, #fff);
  transform: translateY(-1px);
}

/* ------ Reduced motion ------ */
@media (prefers-reduced-motion: reduce) {
  .c-product-card,
  .c-product-card__media img,
  .product-detail__buy {
    transition: none;
  }
  .c-product-card:hover { transform: none; }
}
