/* =========================================================================
   Design tokens
   ========================================================================= */
:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #5a5a5a;
  --color-border: #d9d9d9;
  --color-surface: #f7f7f7;
  --color-accent: #0b5fff;
  --color-accent-hover: #084acc;
  --color-accent-text: #ffffff;
  --color-success: #1a7f3c;
  --color-focus: #0b5fff;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --radius-sm: 4px;
  --radius-md: 8px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;

  --container-max: 1200px;
  --breakpoint-md: 768px;
}

/* =========================================================================
   Reset
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

img { max-width: 100%; height: auto; display: block; }

ul, ol { padding: 0; margin: 0; list-style: none; }

button { font: inherit; cursor: pointer; }

a { color: var(--color-accent); }
a:hover { color: var(--color-accent-hover); }

/* =========================================================================
   Typography
   ========================================================================= */
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--space-4); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

/* =========================================================================
   Focus styles — never remove, always visible
   ========================================================================= */
:focus { outline: 2px solid var(--color-focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* =========================================================================
   Utilities
   ========================================================================= */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { top: var(--space-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================================
   Page layout
   ========================================================================= */
main {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
}

main > section { margin-bottom: var(--space-7); }
main > section:last-child { margin-bottom: 0; }

/* =========================================================================
   Site header
   ========================================================================= */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.site-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "logo cart cart"
    "nav nav nav"
    "search search search";
  gap: var(--space-3);
  align-items: center;
}

.site-header__logo {
  grid-area: logo;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--color-text);
}
.site-header__nav { grid-area: nav; }
.site-header__nav ul { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.site-header__nav a { text-decoration: none; color: var(--color-text); }
.site-header__nav a:hover { text-decoration: underline; }

.site-header__search { grid-area: search; display: flex; gap: var(--space-2); }
.site-header__search input {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
}
.site-header__search button {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
}

.site-header__cart {
  grid-area: cart;
  justify-self: end;
  text-decoration: none;
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
}
.site-header__cart-count {
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: 999px;
  padding: 0 var(--space-2);
  font-size: 0.875rem;
  min-width: 1.5em;
  text-align: center;
}

@media (min-width: 768px) {
  .site-header__inner {
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "logo nav search cart";
  }
}

/* =========================================================================
   Breadcrumbs
   ========================================================================= */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
.breadcrumbs li + li::before { content: "›"; margin-right: var(--space-2); }
.breadcrumbs a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--color-text); pointer-events: none; }

/* =========================================================================
   Product hero — responsive two-column
   ========================================================================= */
.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .product-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-7);
    align-items: start;
  }
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  margin-top: var(--space-7);
}
.site-footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
.site-footer__inner p { margin: 0; }
.site-footer__inner ul { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.site-footer__inner a { color: var(--color-text-muted); text-decoration: none; }
.site-footer__inner a:hover { text-decoration: underline; }

@media (min-width: 768px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* =========================================================================
   Gallery
   ========================================================================= */
.gallery__main {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.gallery__thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: var(--space-2);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumb:hover { border-color: var(--color-text-muted); }
.gallery__thumb[aria-pressed="true"] {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent) inset;
}

/* =========================================================================
   Product info column
   ========================================================================= */
.product-info__brand {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}
#product-info__sku {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.product-info__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.product-info__price-amount { font-size: 1.75rem; font-weight: 700; }
.product-info__price-vat { font-size: 0.875rem; color: var(--color-text-muted); }

.product-info__stock {
  font-weight: 600;
  margin-bottom: var(--space-5);
}
.product-info__stock--in { color: var(--color-success); }

.product-info__highlights {
  list-style: disc;
  padding-left: var(--space-5);
  margin-bottom: var(--space-5);
}
.product-info__highlights li { margin-bottom: var(--space-2); }

.product-info__buy {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* =========================================================================
   Quantity stepper
   ========================================================================= */
.qty-stepper { display: flex; flex-direction: column; gap: var(--space-2); }
.qty-stepper label { font-weight: 600; font-size: 0.875rem; }
.qty-stepper__controls {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  width: fit-content;
}
.qty-stepper__btn {
  background: var(--color-surface);
  border: 0;
  padding: var(--space-2) var(--space-4);
  font-size: 1.125rem;
  line-height: 1;
}
.qty-stepper__btn:hover:not(:disabled) { background: var(--color-border); }
.qty-stepper__btn:disabled { opacity: 0.6; cursor: not-allowed; }
.qty-stepper__controls input {
  width: 4rem;
  text-align: center;
  border: 0;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  font: inherit;
}
.qty-stepper__controls input:focus { outline-offset: -2px; }

/* =========================================================================
   Button
   ========================================================================= */
.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-text);
  border-color: var(--color-accent);
}
.btn--primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }

.product-info__cta { width: 100%; font-size: 1rem; }

/* =========================================================================
   Description
   ========================================================================= */
.product-description { max-width: 70ch; }

/* =========================================================================
   Widget mount section
   ========================================================================= */
#videos { min-height: 80px; padding-top: var(--space-3); }
#videoly-widget {
  min-height: 1px; /* mount point — height controlled by widget once loaded */
}

/* =========================================================================
   Specs table
   ========================================================================= */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.specs-table th, .specs-table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.specs-table tr:nth-child(odd) th,
.specs-table tr:nth-child(odd) td {
  background: var(--color-surface);
}
.specs-table th {
  font-weight: 600;
  width: 40%;
  color: var(--color-text-muted);
}

/* =========================================================================
   Reviews
   ========================================================================= */
.reviews-summary {
  font-size: 1rem;
  margin-bottom: var(--space-5);
}
.reviews-summary__rating {
  font-size: 1.25rem;
  color: #8a6a00;
  letter-spacing: 0.1em;
  margin-right: var(--space-2);
}

.review {
  border-top: 1px solid var(--color-border);
  padding: var(--space-4) 0;
}
.review__title { margin-bottom: var(--space-2); }
.review__meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.review__meta > span:first-child { color: #8a6a00; letter-spacing: 0.1em; }

/* =========================================================================
   Test shops — environment strip
   ========================================================================= */
.shop-env {
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
}
.shop-env--test { background: #fff4ce; }
.shop-env--prod { background: #fde7e9; }

.shop-env__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-2) var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
}
.shop-env__badge {
  padding: 0 var(--space-2);
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.shop-env__title { font-weight: 600; }

/* =========================================================================
   Test shops — product grid
   ========================================================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-5);
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.product-card:hover { border-color: var(--color-text-muted); }
.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin-bottom: var(--space-2);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
}
.product-card p,
.product-card h3 { margin: 0; }
.product-card__brand {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.product-card__title { font-size: 1rem; }
.product-card__title a { color: var(--color-text); text-decoration: none; }
.product-card__title a:hover { text-decoration: underline; }
/* Makes the whole card the click target of the title link. */
.product-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.product-card__price { font-size: 1.125rem; font-weight: 700; }
.product-card__stock { font-size: 0.875rem; font-weight: 600; color: var(--color-success); }

/* =========================================================================
   Test shops — cookie consent panel (consent.js)
   ========================================================================= */
.consent {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
}

.consent__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
}

.consent__head { display: flex; flex-direction: column; }
.consent__title { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.25; }
.consent__note { margin: 0; color: var(--color-text-muted); }

.consent__choice {
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}
.consent__option + .consent__option { border-left: 1px solid var(--color-border); }
.consent__option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.consent__option span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  cursor: pointer;
}
.consent__option:first-of-type span { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.consent__option:last-of-type span { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.consent__option input:not(:checked) + span:hover { background: var(--color-border); }
.consent__option input:checked + span {
  background: var(--color-accent);
  color: var(--color-accent-text);
}
.consent__option input:checked + span::before {
  content: "✓";
  content: "✓" / "";
}
.consent__option input:focus-visible + span {
  z-index: 1;
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.consent__status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
}
.consent__status div { display: flex; gap: var(--space-2); }
.consent__status dt { color: var(--color-text-muted); }
.consent__status dt::after { content: ":"; }
.consent__status dd { margin: 0; font-family: monospace; font-weight: 600; }

.consent__clear {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
}
.consent__clear:hover { background: var(--color-border); }

.consent__values,
.consent__hint { flex-basis: 100%; }
.consent__values summary { cursor: pointer; }
.consent__values pre {
  margin: var(--space-2) 0 0;
  padding: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-all;
}
.consent__hint { margin: 0; color: var(--color-text-muted); }
