/* ─────────────────────────────────────────────────────────────────────────────
   Veikals: retro mail-order catalogue. Shallow lifestyle banner, four product
   cards with black name strips and orange price tabs, then cart and checkout.
   ───────────────────────────────────────────────────────────────────────────*/

.shop-head {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr);
  gap: 18px;
  align-items: end;
  padding: 18px 0 12px;
}
.shop-head h1 { font-size: clamp(40px, 5vw, 72px); }
.shop-head p { margin: 0; color: var(--ink-soft); max-width: 62ch; font-size: 15px; line-height: 1.5; }

/* Shallow lifestyle banner: 4.4:1 so products are visible on first paint. */
.shop-banner {
  position: relative;
  aspect-ratio: 4.4 / 1;
  min-height: 150px;
  max-height: 290px;
  overflow: hidden;
  border: var(--outline);
  margin-bottom: 14px;
  background: var(--ink);
  box-shadow: 6px 6px 0 var(--orange);
}
.shop-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.shop-banner__word {
  position: absolute;
  z-index: 1;
  left: clamp(12px, 2.4vw, 32px);
  bottom: clamp(8px, 1.8vw, 22px);
  font-family: var(--font-display);
  font-style: var(--slant);
  font-weight: 700;
  font-size: clamp(30px, 5.2vw, 78px);
  line-height: .9;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--on-accent);
  /* A flat ink plate under the word, as the prints offset display type. */
  text-shadow: 3px 3px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
}
.shop-banner__word span { color: var(--amber); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}
@media (max-width: 1080px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 470px) { .product-grid { grid-template-columns: minmax(0, 1fr); } }

.product-card {
  display: grid;
  border: var(--outline);
  border-top-width: 4px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  min-width: 0;
  box-shadow: var(--offset-sm);
  transition: box-shadow .12s ease, transform .12s ease;
}
.product-card:hover { box-shadow: 4px 4px 0 var(--orange); transform: translate(-1px, -1px); }
.product-card__media { position: relative; aspect-ratio: 1 / 1.05; overflow: hidden; background: var(--paper-deep); }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }
.product-card__strip {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: var(--ink);
  color: var(--paper);
  min-height: 40px;
}
.product-card__name {
  display: flex;
  align-items: center;
  padding: 6px 9px;
  /* The name is the obvious thing to click for details; the card already
     holds a form, so this is the only link that is not the button. */
  color: inherit;
  text-decoration: none;
  font-family: var(--font-display);
  font-style: var(--slant);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.02;
  text-transform: uppercase;
  min-width: 0;
}
.product-card__name:hover { text-decoration: underline; }
.product-card__price {
  display: flex;
  align-items: center;
  padding: 6px 11px;
  background: var(--orange);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-style: var(--slant);
  font-weight: 700;
  font-size: 23px;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.product-card__body { padding: 10px; display: grid; gap: 9px; border-top: var(--hairline) solid var(--rule); }
.product-card__desc { font-size: 12.5px; color: var(--ink-mute); line-height: 1.4; margin: 0; }

/* Variant pickers */
.option-group { display: grid; gap: 4px; }
.option-group__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swatch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 8px;
  border: var(--hairline) solid var(--rule-soft);
  background: var(--field-strong);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch__dot { width: 12px; height: 12px; border: var(--hairline) solid var(--ink); flex: none; }
.swatch:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--accent-wash); }
.swatch:has(input:focus-visible) { box-shadow: var(--focus); }
.swatch[data-unavailable="true"] { opacity: .38; cursor: not-allowed; text-decoration: line-through; }

.sizes { display: flex; flex-wrap: wrap; gap: 5px; }
.size-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 36px;
  padding: 4px 7px;
  border: var(--hairline) solid var(--rule-soft);
  background: var(--field);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
}
.size-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.size-btn:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.size-btn:has(input:focus-visible) { box-shadow: var(--focus); }
.size-btn[data-unavailable="true"] {
  opacity: .35;
  cursor: not-allowed;
  text-decoration: line-through;
  background: repeating-linear-gradient(135deg, var(--field), var(--field) 4px, var(--field-stripe) 4px, var(--field-stripe) 8px);
}
.size-btn--one { width: 100%; justify-content: flex-start; padding-inline: 9px; }
.size-btn--one[data-unavailable="false"] { opacity: 1; }

.product-card__actions { display: grid; gap: 6px; }
.product-card__unavailable {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--error);
  min-height: 15px;
}

/* ── Cart ──────────────────────────────────────────────────────────────────*/

.cart-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 18px; align-items: start; padding-top: 14px; }
.cart-lines { border-top: var(--rule-weight) solid var(--rule); }
.cart-line {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: var(--hairline) solid var(--rule);
  align-items: start;
}
.cart-line__img { aspect-ratio: 1 / 1.05; overflow: hidden; border: var(--outline); background: var(--paper-deep); }
.cart-line__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__name {
  font-family: var(--font-display); font-style: var(--slant); font-weight: 700;
  font-size: 21px; line-height: 1; text-transform: uppercase; margin-bottom: 3px;
}
.cart-line__variant { font-size: 13px; color: var(--ink-mute); }
.cart-line__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.qty { display: inline-flex; border: var(--outline); }
.qty button {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--field); border: 0; cursor: pointer;
  font-size: 17px; font-weight: 700; line-height: 1;
}
.qty button:hover { background: var(--paper-deep); }
.qty input {
  width: 44px; height: 34px;
  border: 0; border-inline: var(--hairline) solid var(--rule);
  text-align: center; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--field-strong); padding: 0;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.link-button {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-mute); text-decoration: underline; text-underline-offset: 2px;
}
.link-button:hover { color: var(--error); }
.cart-line__total { font-family: var(--font-display); font-style: var(--slant); font-weight: 700; font-size: 22px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.totals {
  border: var(--outline);
  border-radius: var(--radius);
  background: var(--field-strong);
  box-shadow: var(--offset);
  padding: 14px;
  position: sticky;
  top: calc(var(--header-h) + 12px);
}
.totals h2 { font-size: 22px; margin-bottom: 10px; }
.totals dl { display: grid; gap: 7px; margin: 0 0 12px; }
.totals__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.totals__row dt { color: var(--ink-soft); }
.totals__row dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals__row--final {
  border-top: var(--hairline) solid var(--rule);
  padding-top: 9px;
  font-family: var(--font-display); font-style: var(--slant); font-size: 24px; line-height: 1;
}
.totals__row--final dd { font-family: var(--font-display); font-style: var(--slant); font-weight: 700; }
.totals__policy { font-size: 12px; color: var(--ink-mute); line-height: 1.45; margin: 10px 0 0; border-top: var(--hairline) solid var(--rule-soft); padding-top: 9px; }
.totals .btn { margin-bottom: 6px; }

.empty-cart { padding: 24px 0; border-top: var(--rule-weight) solid var(--rule); }
.empty-cart p { margin: 0 0 12px; }

/* ── Checkout ──────────────────────────────────────────────────────────────*/

.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr); gap: 20px; align-items: start; padding-top: 14px; }
.checkout-summary { border: var(--outline); border-radius: var(--radius); background: var(--field-strong); box-shadow: var(--offset); padding: 14px; position: sticky; top: calc(var(--header-h) + 12px); }
.checkout-summary h2 { font-size: 21px; margin-bottom: 10px; }
.checkout-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; border-bottom: var(--hairline) solid var(--rule-soft); font-size: 13px; }
.checkout-item img { width: 52px; aspect-ratio: 1 / 1.05; object-fit: cover; border: var(--hairline) solid var(--rule-soft); }
.checkout-item__name { font-weight: 700; line-height: 1.25; }
.checkout-item__variant { color: var(--ink-mute); font-size: 12px; }
.checkout-item__price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.config-warning {
  border: var(--outline);
  border-left: 8px solid var(--amber);
  border-radius: var(--radius-sm);
  background: var(--accent-wash);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: var(--offset-sm);
}
.config-warning strong { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; margin-bottom: 4px; color: var(--accent-ink); }

/* ── Order confirmation ────────────────────────────────────────────────────*/

.order-panel { max-width: 760px; padding-top: 14px; }
.order-panel__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; border-bottom: var(--rule-weight) solid var(--rule); padding-bottom: 10px; margin-bottom: 14px; }
.order-panel__head h1 { font-size: clamp(30px, 4vw, 50px); }
.order-number { font-family: var(--font-display); font-style: var(--slant); font-size: 26px; color: var(--accent-ink); }
.order-lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-lines th, .order-lines td { text-align: left; padding: 8px; border-bottom: var(--hairline) solid var(--rule-soft); vertical-align: top; }
.order-lines th { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); }
.order-lines td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 16px; font-size: 14px; }
.order-meta h2 { font-size: 15px; margin-bottom: 4px; }

@media (max-width: 900px) {
  .shop-head { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .shop-banner { aspect-ratio: 2.6 / 1; }
  .cart-layout, .checkout-layout { grid-template-columns: minmax(0, 1fr); }
  .totals, .checkout-summary { position: static; }
}
@media (max-width: 560px) {
  .shop-banner { aspect-ratio: 2.1 / 1; min-height: 140px; }
  .cart-line { grid-template-columns: 72px minmax(0, 1fr); }
  .cart-line__total { grid-column: 2; }
  .product-card__name { font-size: 15px; }
  .product-card__price { font-size: 20px; }
}

/* ── Product detail ────────────────────────────────────────────────────────*/
.product-detail .detail-media { display: grid; gap: 8px; }
.product-detail .detail-media img {
  width: 100%;
  height: auto;
  border: var(--outline);
  background: var(--paper-deep);
  box-shadow: var(--offset-sm);
}
.product-detail .panel__body { display: grid; gap: 8px; }
.product-detail .panel__body .btn { margin-top: 4px; }
.product-detail .plain { margin: 0; padding-left: 16px; display: grid; gap: 4px; }
@media (max-width: 720px) {
  .product-detail .detail-body { grid-template-columns: minmax(0, 1fr); }
}

/* Size guide: a folded <details> beside the picker, not a modal or a second
   page — the question "which size am I?" is asked while choosing. */
.product-detail .size-guide > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer; list-style: none;
}
.product-detail .size-guide > summary::-webkit-details-marker { display: none; }
.product-detail .size-guide > summary h2 { margin: 0; }
.product-detail .size-guide > summary::after { content: '+'; font-weight: 700; color: var(--accent-ink); }
.product-detail .size-guide[open] > summary::after { content: '−'; }

/* "Citi produkti" at the foot of a product page — reuses the catalogue grid. */
.related-products { margin-top: 26px; border-top: 3px solid var(--rule); padding-top: 12px; }
@media (max-width: 720px) {
  .related-products .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 470px) {
  .related-products .product-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 430px) {
  /* A 240px price + 240px name strip cannot fit a 390px phone; let the strip
     wrap so the price is never clipped. */
  .product-card__strip { flex-wrap: wrap; }
  .product-card__name { flex: 1 1 100%; }
  .product-card__price { flex: none; }
  .cart-line { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
  .checkout-item { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; }
  .checkout-item__price { font-size: 13px; }
}

/* Category tabs + sort. Only rendered once more than one tab exists. */
.shop-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.shop-tabs__tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: var(--outline); background: var(--paper); box-shadow: var(--offset-sm);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px;
}
.shop-tabs__tab[aria-current="page"] { background: var(--ink); color: var(--paper); }
.shop-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.shop-sort { display: flex; align-items: center; gap: 8px; margin: 0; }
.shop-sort .select { width: auto; }

/* /veikals?dizaini=… — which designs the list is filtered to */
.design-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0 0 18px; padding: 10px 14px; background: var(--field-strong); border: var(--outline); box-shadow: var(--offset-sm); }
.design-filter__art { display: flex; }
.design-filter__art img { width: 56px; height: 56px; object-fit: contain; margin-right: -12px; filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff); background: none; }
.design-filter p { margin: 0 0 0 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* Order page while Stripe's confirmation is on its way (js/order-status.js). */
.order-wait { display: flex; align-items: center; gap: 10px; }
.order-wait__dot {
  flex: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--orange); animation: order-wait-pulse 1.1s ease-in-out infinite;
}
.order-wait--stopped .order-wait__dot { animation: none; background: var(--ink-mute); }
@keyframes order-wait-pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .order-wait__dot { animation: none; } }

/* ── Embedded Checkout on the order page ────────────────────────────────────
   The Stripe form is an iframe that sizes itself; the wrapper only has to give
   it room and say "loading" until it paints. A minimum height stops the page
   from jumping when the frame arrives. */
.pay-step {
  margin: 0 0 20px; padding: 16px;
  border: var(--outline); border-radius: var(--radius);
  background: var(--field-strong); box-shadow: var(--offset);
}
.pay-step__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pay-step__head h2 { font-size: 22px; margin: 0; }
.pay-step__total { margin: 0; font-size: 14px; }
.pay-step__total strong { font-family: var(--font-display); font-style: var(--slant); font-size: 24px; }
.pay-step__mount { min-height: 220px; }
.pay-step__mount iframe { border: 0; }
.pay-step__loading { margin: 0; padding: 28px 0; text-align: center; color: var(--ink-mute); font-size: 14px; }
/* The wrapper must not clip Stripe's frame or its focus ring. */
.pay-step__mount:focus-within { outline: none; }
.pay-summary { margin: 0 0 18px; }
.pay-summary h2 { font-size: 20px; margin: 0 0 8px; }

/* Delivery method on the checkout summary: derived, not chosen. */
.checkout-method { margin: 10px 0 0; padding-top: 9px; border-top: var(--hairline) solid var(--rule-soft); display: grid; gap: 2px; font-size: 13px; }
.checkout-method__label { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: var(--ink-mute); }
.checkout-method strong { font-size: 14px; }

@media (max-width: 560px) {
  .pay-step { padding: 12px; }
  .pay-step__mount { min-height: 180px; }
}

/* ── Special collection page (/kolekcija/<slug>) ───────────────────────────
   A promotion page: one banner, the merchant's copy, then the same product
   cards as the shop. The banner is a photo when one was uploaded and a paper
   field in the house colours when not — so a collection created in two minutes
   still looks deliberate. */
.collection { padding-bottom: 46px; }
.collection-hero {
  position: relative;
  margin: 18px 0 28px;
  padding: 40px clamp(20px, 4vw, 54px) 34px;
  background: var(--field-strong, #efe3c8);
  border: var(--outline, 2px solid var(--ink));
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
}
.collection-hero--photo { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.collection-hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .45; filter: grayscale(1) contrast(1.1);
}
.collection-hero--photo .collection-hero__inner { position: relative; z-index: 1; }
.collection-hero__kicker {
  margin: 0 0 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--orange);
}
.collection-hero--photo .collection-hero__kicker { color: var(--amber); }
.collection-hero h1 {
  margin: 0 0 12px; font-size: clamp(38px, 6vw, 82px); line-height: .92;
  text-transform: uppercase; font-style: italic; letter-spacing: -.01em;
}
.collection-hero__lede { margin: 0 0 14px; max-width: 62ch; font-size: 16px; line-height: 1.5; }
.collection-hero--photo .collection-hero__lede { color: rgba(255, 255, 255, .88); }
.collection-hero__meta { margin: 0; font-size: 13px; color: var(--ink-mute); }
.collection-hero--photo .collection-hero__meta { color: rgba(255, 255, 255, .7); }
.collection-hero--photo .collection-hero__meta .text-link { color: var(--paper); }
.collection__grid { margin-top: 4px; }
.collection__back { margin: 30px 0 0; }
@media (max-width: 560px) {
  .collection-hero { box-shadow: 5px 5px 0 var(--ink); padding: 28px 18px 24px; }
}

/* A thin strip above the shop grid pointing at the promoted collection. It is
   a link, so the whole band is clickable; nothing else on the shop page is. */
.collection-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 0 0 18px; padding: 12px 16px;
  background: var(--burgundy); color: var(--paper); text-decoration: none;
  border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.collection-strip:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.collection-strip__kicker {
  font-size: 10px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--amber);
}
.collection-strip__title {
  font-family: var(--font-display); font-style: italic; font-weight: 800;
  font-size: clamp(20px, 2.6vw, 30px); line-height: 1; text-transform: uppercase;
}
.collection-strip__go { margin-left: auto; font-size: 13px; font-weight: 700; }
@media (max-width: 560px) {
  .collection-strip { box-shadow: 4px 4px 0 var(--ink); }
  .collection-strip__go { margin-left: 0; }
}

/* Admin-only layout switch on /veikals (all layouts, so it lives here). */
.layout-switch {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 12px 0 0; padding: 8px 10px;
  background: var(--field-strong); border: 2px dashed var(--ink);
}
.layout-switch__label { font-family: var(--font-display); font-style: var(--slant); text-transform: uppercase; font-size: 15px; }
.layout-switch__options { display: flex; flex-wrap: wrap; gap: 4px; }
.layout-switch__opt {
  padding: 4px 10px; border: var(--outline); background: var(--paper); color: var(--ink);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.layout-switch__opt:hover { background: var(--accent-wash); }
.layout-switch__opt[aria-current="true"] { background: var(--ink); color: var(--paper); }
.layout-switch__saved { color: var(--orange); }
.layout-switch__opt[aria-current="true"] .layout-switch__saved { color: var(--amber); }
.layout-switch__save { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 0 auto; }
.layout-switch__note { margin-left: auto; color: var(--ink-mute); }

/* Search box in the shop toolbar (every layout). */
.shop-search { display: flex; gap: 6px; flex: 1 1 280px; max-width: 460px; margin: 0; }
.shop-search__input { flex: 1; min-width: 0; min-height: 38px; }
.shop-search__input::-webkit-search-cancel-button { cursor: pointer; }
.shop-result { margin: -4px 0 14px; font-size: 14px; color: var(--ink-soft); }
.shop-result .text-link { margin-left: 8px; }
@media (max-width: 600px) {
  .shop-search { flex-basis: 100%; max-width: none; }
}
