/* ============ Brand ============
   Matches helekopeter.com: pink background, black text, Roboto Mono labels
   that go from faded to black, square corners. */
:root {
  --pink: #ff94ec;
  --ink: #000;
  --ink-2: rgba(0, 0, 0, 0.85);   /* body text */
  --muted: rgba(0, 0, 0, 0.6);    /* secondary text */
  --faded: rgba(0, 0, 0, 0.35);   /* inactive labels, like the site's menu */
  --line: rgba(0, 0, 0, 0.15);
  --field: rgba(255, 255, 255, 0.45);
  --vipps: #ff5b24;
  --gap: 10px;
  --tabbar-h: 56px;
  --sans: 'Roboto', Arial, sans-serif;
  --mono: 'Roboto Mono', ui-monospace, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { background: var(--pink); min-height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink-2);
  background: var(--pink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Mono label style shared by headings, nav and buttons */
.brand, .panel-title, .tabbar button, .btn, .variants legend, .field label, .card-title, .label {
  font-family: var(--mono);
}

/* ============ Top bar ============ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gap);
  background: var(--pink);
}
.brand {
  font-weight: 700; font-size: 16px; letter-spacing: 5px; text-transform: uppercase;
  text-decoration: none; color: var(--ink);
}

/* ============ Layout ============ */
.shop { min-height: calc(100dvh - 52px); }
.panel { padding: 0 var(--gap) calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
.panel-title {
  font-size: 14px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--faded); margin: 10px 0 12px;
}

/* Mobile: one panel at a time, switched by the bottom bar */
.shop[data-tab="list"] .panel:not(.panel-list),
.shop[data-tab="product"] .panel:not(.panel-product),
.shop[data-tab="cart"] .panel:not(.panel-cart) { display: none; }
.shop[data-tab="product"] .panel-product .panel-title { display: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--pink); border-top: 1px solid var(--line);
}
.tabbar button {
  border: 0; background: none; cursor: pointer; padding: 0 4px;
  font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--faded); transition: color .3s;
}
.tabbar button:hover, .tabbar button[aria-current="page"] { color: var(--ink); }

/* Desktop: all three side by side, product list in the middle */
@media (min-width: 960px) {
  .shop {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr) minmax(300px, 380px);
    height: calc(100dvh - 52px);
  }
  .shop .panel { display: block !important; overflow-y: auto; padding: 0 20px 32px; }
  /* Scroll without a visible scrollbar, like the image strips on helekopeter.com */
  .shop .panel { scrollbar-width: none; }
  .shop .panel::-webkit-scrollbar { display: none; }
  .shop[data-tab] .panel-product .panel-title { display: block; }
  .panel-list { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .tabbar { display: none; }
  .toast { bottom: 24px; }
}

/* ============ Product list ============ */
.product-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px var(--gap);
}
.card { display: block; text-decoration: none; color: var(--muted); transition: color .3s; }
.card:hover, .card[aria-current="true"] { color: var(--ink); }
.card-img { aspect-ratio: 1; width: 100%; height: auto; object-fit: cover; background: rgba(0, 0, 0, 0.06); }
.card[aria-current="true"] .card-img { outline: 2px solid var(--ink); outline-offset: -2px; }
.card-body { padding-top: 6px; }
.card-title { font-size: 13px; font-weight: 700; margin: 0; line-height: 1.35; }
.card-price { font-family: var(--mono); font-size: 13px; margin-top: 2px; }
.sold-out { font-style: italic; }

/* ============ Product ============ */
.product { max-width: 760px; }
/* Same horizontal image strip as helekopeter.com */
.gallery-track {
  display: flex; gap: var(--gap); overflow-x: auto; overflow-anchor: none;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img {
  height: clamp(300px, 55vh, 480px); width: auto; flex-shrink: 0;
  object-fit: cover; scroll-snap-align: start;
}
@media (max-width: 959px) {
  .gallery-track img { height: auto; width: calc(100% - 40px); max-height: 70vh; object-fit: contain; }
  .gallery-track img:only-child { width: 100%; }
}
.no-image { aspect-ratio: 1; max-width: 480px; background: rgba(0, 0, 0, 0.06); }

.product h1 {
  font-family: var(--mono); font-size: 18px; font-weight: 700; line-height: 1.3;
  margin: 14px 0 2px; color: var(--ink);
}
.price { font-family: var(--mono); font-size: 16px; color: var(--ink); }
.digital-note { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.variants { border: 0; padding: 0; margin: 16px 0 0; }
.variants legend { font-weight: 700; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--faded); margin-bottom: 8px; }
.variant-options { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-options label { position: relative; }
.variant-options input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.variant-options span {
  display: inline-block; min-width: 44px; text-align: center; padding: 8px 14px;
  border: 1px solid var(--ink); font-family: var(--mono); font-weight: 700; font-size: 14px; cursor: pointer;
  color: var(--ink);
}
.variant-options input:checked + span { background: var(--ink); color: var(--pink); }
.variant-options input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.variant-options input:disabled + span { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.product-actions { display: flex; gap: var(--gap); margin: 18px 0; max-width: 480px; }
.description { white-space: pre-line; font-size: 15px; max-width: 60ch; }
.empty-hint { color: var(--muted); padding: 32px 0; font-family: var(--mono); font-size: 14px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--ink); padding: 12px 20px; cursor: pointer;
  font-weight: 700; font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  background: var(--ink); color: var(--pink); text-decoration: none; transition: opacity .2s;
}
.btn:hover { opacity: .8; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-wide { width: 100%; }
.btn-grow { flex: 1; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--pink); opacity: 1; }
.btn-vipps { background: var(--vipps); border-color: var(--vipps); color: #fff; }

/* ============ Cart ============ */
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--gap); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line img, .cart-line .ph { width: 56px; height: 56px; object-fit: cover; background: rgba(0, 0, 0, 0.06); }
.cart-line-title { font-family: var(--mono); font-weight: 700; font-size: 13px; line-height: 1.3; text-decoration: none; color: var(--ink); }
.cart-line-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--ink); }
.qty button { width: 30px; height: 30px; border: 0; background: none; cursor: pointer; font-size: 16px; }
.qty button:hover { background: var(--ink); color: var(--pink); }
.qty span { min-width: 24px; text-align: center; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.totals { margin: 14px 0; font-family: var(--mono); font-size: 14px; }
.totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.totals .grand { font-weight: 700; color: var(--ink); border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 8px; }

.checkout-form { display: grid; gap: 10px; margin-top: 8px; }
.checkout-form .panel-title { margin-top: 18px; }
.checkout-form .row { display: grid; grid-template-columns: 110px 1fr; gap: var(--gap); }
.field label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 3px; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 10px; border: 1px solid rgba(0, 0, 0, 0.4); background: var(--field);
}
.field input:focus, .field textarea:focus { border-color: var(--ink); outline: none; background: rgba(255, 255, 255, 0.7); }
.pay-buttons { display: grid; gap: 8px; margin-top: 6px; }
.form-error { color: #7a0000; font-weight: 700; font-size: 14px; margin: 0; }
.privacy { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

.order-box { padding: 16px 0; }
.order-box h3 { font-family: var(--mono); margin: 6px 0; font-size: 16px; color: var(--ink); }
.order-box p { color: var(--muted); margin: 6px 0 16px; font-size: 14px; }

.spinner { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 12px 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--pink); padding: 10px 18px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 1px;
  transition: opacity .2s, transform .2s; z-index: 30; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

.gallery-nav { display: flex; gap: 4px; margin-top: 6px; }
.gallery-nav button {
  border: 0; background: none; cursor: pointer; padding: 4px 8px;
  font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--faded); transition: color .3s;
}
.gallery-nav button:hover { color: var(--ink); }

/* Logo in the top-right corner, like on helekopeter.com */
.logo-link { display: block; line-height: 0; }
.logo { height: 44px; width: auto; }

/* ============ Legal pages + footer ============ */
.legal { max-width: 760px; margin: 0 auto; padding: 8px 16px 64px; font-size: 15px; }
.legal h1 { font-family: var(--mono); font-size: 22px; color: var(--ink); margin: 16px 0; }
.legal h2 { font-family: var(--mono); font-size: 15px; color: var(--ink); margin: 28px 0 8px; }
.legal h3 { font-family: var(--mono); font-size: 14px; color: var(--ink); margin: 18px 0 6px; }
.legal a { color: var(--ink); }
.legal table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 8px 0; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.legal th { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.legal .muted { color: var(--muted); }
.back-link { font-family: var(--mono); font-weight: 700; font-size: 13px; text-decoration: none; }
.form-sheet { border: 1px solid var(--ink); padding: 16px; margin-top: 16px; }
.form-sheet h2 { margin-top: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
@media (max-width: 600px) { .row-2 { grid-template-columns: 1fr; } }
.legal-footer, .shop-footer { margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.legal-footer nav, .shop-footer nav { font-family: var(--mono); font-weight: 700; margin-bottom: 4px; }
.shop-footer a, .legal-footer a { color: var(--muted); }
.shop-footer a:hover, .legal-footer a:hover { color: var(--ink); }
.notice { border: 1px solid var(--ink); padding: 10px; font-size: 14px; }
.terms-note { font-size: 12px; color: var(--muted); margin: 0; }
.terms-note a { color: var(--ink); }
.field select { width: 100%; padding: 10px; border: 1px solid rgba(0, 0, 0, 0.4); background: var(--field); font-family: var(--sans); }
/* The signature line only makes sense on paper. */
.print-only { display: none; }
.signature { margin-top: 32px; padding-top: 6px; border-top: 1px solid #000; width: 60%; font-size: 12px; }
@media print {
  .topbar, .back-link, .legal-footer, .pay-buttons, .privacy { display: none !important; }
  .print-only { display: block; }
  html, body { background: #fff; }
}
.field label .hint { font-weight: 400; letter-spacing: 0; text-transform: none; }

/* ============ Newsletter / centered pages ============ */
.centered-page { min-height: 100dvh; display: flex; flex-direction: column; }
.centered { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px 15vh; text-align: center; }
.centered-title { font-family: var(--mono); font-size: 18px; color: var(--ink); margin: 0 0 8px; }
.newsletter-form { display: flex; width: min(440px, 100%); }
.newsletter-form input {
  flex: 1; min-width: 0; padding: 14px; font-size: 16px; border: 1px solid var(--ink); border-right: 0;
  background: var(--field); font-family: var(--mono);
}
.newsletter-form input:focus { outline: none; background: rgba(255, 255, 255, 0.7); }
.newsletter-text { max-width: 440px; margin: 14px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.newsletter-text a { color: var(--ink); }
.newsletter-status { font-family: var(--mono); font-weight: 700; color: var(--ink); margin: 14px 0 0; min-height: 1em; }
.join-newsletter { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.join-newsletter .btn { margin-top: 8px; padding: 8px 14px; font-size: 12px; }
/* Newsletter page: text lines up with the left edge of the email box */
.newsletter-form ~ .newsletter-text, .newsletter-form ~ .newsletter-status { width: min(440px, 100%); text-align: left; }
.join-note { margin-top: 6px; font-style: italic; }
.newsletter-small { display: inline-block; margin-top: 4px; font-size: 12px; }

/* Shown only to you (logged in to the admin) while the shop is closed for everyone else. */
.closed-banner {
  position: fixed; top: 58px; left: 50%; transform: translateX(-50%); z-index: 25; pointer-events: none;
  background: var(--ink); color: var(--pink); padding: 6px 12px; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
}
