/* ==========================================================
   cyndi.se – ett pappersark på en akvarellbakgrund
   ========================================================== */

:root {
  --ink: #33302c;
  --ink-soft: #7b756c;
  --blue: #4a82b4;
  --line: #e4e0d8;
  --paper: #fffdf9;
  --font: "Patrick Hand", "Segoe Print", cursive;
  --font-title: "Delius Swash Caps", "Patrick Hand", cursive;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  background: #eef3f6;
  padding: 40px 16px;
}

/* Akvarellbakgrunden i ett eget fast lager. Den är en färdig bild (renderad från
   img/bakgrund.svg), så webbläsaren behöver inte räkna fram filter eller rita om
   den när man skrollar. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #eef3f6 url("../img/bakgrund.jpg") center / cover no-repeat;
  transform: translateZ(0);
  pointer-events: none;
}

/* arket */
.sheet {
  max-width: 920px;
  margin: 0 auto;
  background: var(--paper) url("../img/papper.jpg");
  padding: 40px 48px 36px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(60, 80, 100, 0.12);
}
@media (max-width: 600px) {
  body { padding: 16px 8px; }
  .sheet { padding: 24px 20px; }
}

h1, h2, h3 { font-family: var(--font-title); font-weight: 600; line-height: 1.1; margin: 0 0 0.3em; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
a { color: var(--blue); }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.hand { font-family: var(--font-title); }

/* ---------- sidhuvud ---------- */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 28px;
  background: url("../img/krumelur-linje.svg") left bottom / 300px 12px repeat-x;
}
.brand {
  font-size: 2.6rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.brand::after {
  content: "";
  width: 46px;
  height: 34px;
  margin-left: 6px;
  background: url("../img/krumelur-vind.svg") center / contain no-repeat;
}
.nav { display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a { padding-bottom: 6px; }
.nav a[aria-current="page"] {
  background: url("../img/krumelur-understruk.svg") left bottom / 100% 10px no-repeat;
}
@media (hover: hover) {
  .nav a:hover { background: url("../img/krumelur-understruk.svg") left bottom / 100% 10px no-repeat; }
}
.cart-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.cart-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
.cart-count::before { content: "("; }
.cart-count::after { content: ")"; }
.cart-count[hidden] { display: none; }
.nav-toggle { display: none; }

/* ---------- knappar ---------- */
.btn {
  display: inline-block;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  padding: 6px 20px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn.secondary { border-color: var(--line); }
.btn.secondary:hover { background: #f1eee8; color: var(--ink); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- intro ---------- */
.intro { max-width: 60ch; margin-bottom: 36px; }
.intro p { font-size: 1.1rem; }

/* ---------- sektioner ---------- */
section { margin-bottom: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- verk ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 28px 24px;
}
@media (max-width: 600px) { .grid { grid-template-columns: 1fr 1fr; gap: 20px 14px; } }
.card { display: block; text-decoration: none; color: inherit; }
.card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  background: #fff;
}
.card:hover img { border-color: var(--blue); }
.card .card-body { padding-top: 8px; }
.card h3 { font-family: var(--font); font-weight: 400; font-size: 1.05rem; margin: 0; }
.card .meta { font-size: .9rem; color: var(--ink-soft); margin: 0; }
.card .price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.price { color: var(--ink); }
.badge { font-size: .85rem; color: var(--ink-soft); }
.badge.sold { color: #b05a4a; }
.card.is-sold img { opacity: .55; }

/* ---------- filter ---------- */
.filters { display: flex; gap: 14px; flex-wrap: wrap; }
.chip { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-soft); cursor: pointer; }
.chip.active, .chip:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--blue); }

/* ---------- produktvy ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(40, 50, 60, 0.4);
}
.modal.open { display: flex; }
.modal-card {
  background: var(--paper);
  max-width: 860px; width: 100%; max-height: 92vh; overflow: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
  padding: 28px; position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; align-self: start; border: 1px solid var(--line); background: #fff; }
.modal-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 1.8rem; cursor: pointer; color: var(--ink-soft); }
.modal-card h2 { margin-top: 4px; }
.spec { list-style: none; padding: 0; margin: 0 0 16px; color: var(--ink-soft); font-size: .95rem; }
.spec li { padding: 3px 0; }
.spec li b { color: var(--ink); font-weight: 400; }
.modal-card .price { font-size: 1.3rem; display: block; margin-bottom: 12px; }
@media (max-width: 700px) { .modal-card { grid-template-columns: 1fr; padding: 20px; } }

/* ---------- varukorg ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(400px, 100%);
  background: var(--paper);
  z-index: 110;
  transform: translateX(100%);
  transition: transform .2s ease;
  box-shadow: -6px 0 30px rgba(0,0,0,.15);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; }
.drawer-body { flex: 1; overflow: auto; padding: 8px 20px; }
.drawer-foot { padding: 16px 20px; border-top: 1px solid var(--line); }
.cart-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 56px; height: 70px; object-fit: cover; border: 1px solid var(--line); }
.cart-item .title { margin: 0; }
.cart-item .small { font-size: .9rem; color: var(--ink-soft); margin: 0; }
.qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; }
.qty button { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; line-height: 1; }
.remove { background: none; border: 0; color: var(--ink-soft); cursor: pointer; font-size: 1.2rem; }
.total-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.total-row.big { font-size: 1.15rem; margin: 8px 0 14px; }
.empty { text-align: center; padding: 40px 0; color: var(--ink-soft); }
.overlay { position: fixed; inset: 0; background: rgba(40,50,60,.3); z-index: 105; display: none; }
.overlay.open { display: block; }

/* ---------- om ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 36px; align-items: start; }
.two-col img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line); }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
.info-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 24px; }
.info-cols p { font-size: .95rem; color: var(--ink-soft); }

/* ---------- kassa ---------- */
.checkout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: start; }
@media (max-width: 760px) { .checkout { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--line); padding: 20px; }
form label { display: block; margin: 10px 0 2px; font-size: .95rem; }
form input, form textarea {
  width: 100%; font: inherit; padding: 6px 10px;
  border: 0; border-bottom: 1.5px solid var(--line); background: transparent; border-radius: 0;
}
form input:focus, form textarea:focus { outline: none; border-bottom-color: var(--blue); }
form textarea { border: 1.5px solid var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }
.notice { font-size: .95rem; color: var(--ink-soft); border-left: 2px solid var(--blue); padding: 4px 12px; margin: 18px 0; }

/* ---------- sidfot ---------- */
.site-footer {
  margin-top: 40px; padding-top: 20px;
  background: url("../img/krumelur-linje.svg") left top / 300px 12px repeat-x;
  color: var(--ink-soft); font-size: .95rem;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.site-footer a { color: var(--ink-soft); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translate(-50%, 10px);
  background: var(--ink); color: #fff;
  padding: 8px 18px; border-radius: 3px;
  opacity: 0; transition: all .2s ease; z-index: 120; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- bokstäver i Cyndis stil (js/bokstaver.js) ---------- */
.lettering { font-weight: 400; }
.lw { display: inline-block; white-space: nowrap; }
.lt {
  display: inline-block;
  transform: translateY(var(--y, 0)) rotate(var(--r, 0deg));
}
.lt.fat {
  font-family: "Chewy", var(--font-title);
  -webkit-text-stroke: 1.3px var(--ink);
  paint-order: stroke fill;
  letter-spacing: .01em;
}

/* spiral efter vissa rubriker */
.curl::after {
  content: "";
  display: inline-block;
  width: 1.5em;
  height: 1em;
  margin-left: .2em;
  vertical-align: middle;
  background: url("../img/krumelur-spiral.svg") center / contain no-repeat;
}

/* dold text som bara skärmläsare och sökmotorer ser */
.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;
}

/* ---------- kassa ---------- */
.notice.error { border-left-color: #b05a4a; color: #8a3a2c; }
#to-checkout.is-disabled { opacity: .4; pointer-events: none; }

/* ---------- köpvillkor och integritetspolicy ---------- */
.legal { max-width: 68ch; }
.legal section { margin-bottom: 26px; }
.legal h2 { font-size: 1.6rem; margin-top: 8px; }
.legal ul:not(.spec) { padding-left: 1.2em; margin: 0 0 1em; }
.legal ul:not(.spec) li { margin-bottom: 6px; }
.legal .spec li { padding: 4px 0; }
.pre-line { white-space: pre-line; vertical-align: top; display: inline-block; }
.missing { color: #b05a4a; font-style: italic; }

/* ---------- eget motiv ---------- */
.wish-label { display: block; margin: 8px 0 4px; }
.wish-input { width: 100%; font: inherit; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 3px; background: #fff; resize: vertical; margin-bottom: 10px; }
.wish-input:focus { outline: none; border-color: var(--blue); }
.wish-error { color: #8a3a2c; font-size: .95rem; margin: -4px 0 10px; }
.wish { font-style: italic; color: var(--ink-soft); }

/* tavla utan bild */
.no-image {
  aspect-ratio: 4 / 5; width: 100%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: #f6f2ea; border: 1.5px dashed var(--line); color: var(--ink-soft);
  font-family: var(--font-title); font-size: 1.4rem; padding: 8px;
}
.cart-item .no-image { width: 56px; height: 70px; font-size: .7rem; padding: 2px; }
.modal-card .no-image { align-self: start; font-size: 2rem; }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-style: normal; }
.link-btn.missing-wish { color: #8a3a2c; font-weight: 400; }
