/* Scarfa – svart & grått. Färger och typografi från designförslaget "D · Svart & grått". */
:root {
  --ink: #111111;
  --ink-2: #2A2A2A;
  --grey-1: #F2F2F2;
  --grey-2: #ECECEC;
  --grey-3: #BDBDBD;
  --grey-4: #6B6B6B;
  --text-muted: #444444;
  --text-muted-2: #555555;
  --on-dark: #FFFFFF;
  --on-dark-muted: #CFCFCF;
  --danger: #A12A1F;
  --ok: #1F6B3A;
  --font: 'Urbanist', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: #FFFFFF; font-size: 16px; line-height: 1.5; }
a { color: var(--ink); }
a:hover { color: var(--text-muted-2); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 3px solid #4C8DFF; outline-offset: 2px; }

/* Knappar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 32px; border: 0; cursor: pointer;
  font-size: 15px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; background: var(--ink); color: var(--on-dark); }
.btn:hover { background: #333333; color: var(--on-dark); }
.btn:disabled { background: var(--grey-3); cursor: not-allowed; }
.btn-light { background: var(--on-dark); color: var(--ink); }
.btn-light:hover { background: var(--grey-2); color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-outline:hover { background: var(--grey-1); color: var(--ink); }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 13px; }
.link-button { background: none; border: 0; padding: 0; min-height: 44px; cursor: pointer; text-decoration: underline; color: inherit; }

/* Header & footer */
/* Headern följer med vid scroll så att varukorgen alltid syns. */
html { scroll-padding-top: 84px; }
.site-header { background: var(--ink); color: var(--on-dark); position: sticky; top: 0; z-index: 20; }
.site-header .inner { padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 36px; }
.logo { color: var(--on-dark); font-weight: 800; font-size: 24px; letter-spacing: 0.04em; text-decoration: none; }
.logo:hover { color: var(--on-dark); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 15px; font-weight: 500; }
.site-nav a { color: var(--on-dark); min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a:hover { color: var(--on-dark-muted); }
.usp { margin-left: auto; font-size: 13px; color: var(--on-dark-muted); }
.cart-link { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: var(--on-dark); text-decoration: none; font-weight: 700; }
.cart-link:hover { color: var(--on-dark-muted); }
.cart-link.has-items { background: var(--on-dark); color: var(--ink); padding: 0 8px 0 14px; }
.cart-link.has-items:hover { background: var(--grey-2); color: var(--ink); }
.cart-count { min-width: 26px; height: 26px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--on-dark); border-radius: 13px; font-size: 13px; font-weight: 800; }

/* Bekräftelse när en vara läggs i varukorgen */
.added-panel { position: fixed; top: 84px; right: 24px; left: auto; bottom: auto; margin: 0; z-index: 30; width: min(380px, calc(100% - 48px));
  padding: 24px; border: 0; background: #FFFFFF; color: var(--ink); box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  display: flex; flex-direction: column; gap: 14px; animation: added-in .25s ease-out; }
.added-panel:not([open]) { display: none; }
.added-panel .btn { width: 100%; }
.added-panel form { margin: 0; }
.added-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; padding-right: 32px; }
.added-title svg { color: var(--ok); flex: 0 0 auto; }
.added-panel.is-error .added-title { color: var(--danger); }
.added-item { display: flex; align-items: center; gap: 14px; }
.added-thumb { width: 56px; height: 70px; flex: 0 0 56px; object-fit: cover; }
.added-name { display: block; font-weight: 800; font-size: 18px; text-transform: uppercase; }
.added-meta { display: block; font-size: 14px; color: var(--text-muted); }
.added-sum { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid #E2E2E2; font-size: 15px; }
.added-close-form { position: absolute; top: 12px; right: 12px; }
.added-close { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; color: var(--ink); }
.added-close:hover { background: var(--grey-1); }
@keyframes added-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .added-panel { animation: none; } html { scroll-behavior: auto; } }

/* "I varukorgen" vid köpknappen */
.in-cart { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: inherit; }
.in-cart svg { color: var(--ok); }
.product.is-dark .in-cart svg { color: #7BD69A; }
.in-cart .go { text-decoration: underline; text-underline-offset: 3px; font-weight: 800; }
.product.is-dark .in-cart { color: var(--on-dark); }

.site-footer { background: var(--ink); color: var(--on-dark-muted); padding: 56px 24px 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; font-size: 14px; }
.site-footer .logo { font-size: 22px; }
.site-footer nav { display: flex; flex-direction: column; gap: 10px; }
.site-footer .heading { color: var(--on-dark); font-weight: 700; }
.site-footer a { color: var(--on-dark-muted); text-decoration: none; }
.site-footer a:hover { color: var(--on-dark); text-decoration: underline; }

/* Meddelanden */
.flash { padding: 14px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 20px; font-weight: 600; }
.flash-ok { background: var(--grey-1); color: var(--ink); }
.flash-error { background: #FBE9E7; color: var(--danger); }
.flash a { font-weight: 700; }

/* Hero */
.hero { background: var(--ink-2); color: var(--on-dark); padding: 96px 24px 0; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--on-dark-muted); }
.hero h1 { font-size: clamp(48px, 8vw, 104px); font-weight: 800; line-height: 0.9; letter-spacing: -0.02em; text-transform: uppercase; }
.hero p { font-size: 18px; color: #DADADA; max-width: 560px; }
.pattern-strip { margin-top: 48px; width: 100%; max-width: 1200px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px; }
.pattern-strip a { text-decoration: none; color: var(--on-dark); display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; }
.pattern-strip a:hover { color: var(--on-dark-muted); }
.pattern-strip .thumb { display: block; width: 100%; height: 140px; }
.pattern-strip .label { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; padding: 0 4px; }

/* Produktsektioner */
.product { padding: 96px 24px; display: flex; flex-wrap: wrap; gap: 64px; align-items: center; background: #FFFFFF; }
.product.is-alt { flex-direction: row-reverse; background: var(--grey-1); }
.product.is-dark { background: var(--ink); color: var(--on-dark); }
.product .stage { flex: 1 1 520px; min-width: 0; aspect-ratio: 1 / 1; max-height: 720px; background: var(--grey-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product.is-alt .stage { background: #FFFFFF; }
.product.is-dark .stage { background: var(--ink-2); }
.product .stage img { width: 100%; height: 100%; object-fit: cover; }

/* Karusell med produktbilder: scroll-snap, så att den går att svepa även utan JavaScript. */
.carousel { position: relative; width: 100%; height: 100%; }
.carousel-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline-offset: -3px; }
.carousel-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.carousel-nav { position: absolute; top: 50%; translate: 0 -50%; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: rgba(255,255,255,0.92); color: var(--ink); cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.18); transition: opacity .15s ease; }
.carousel-nav[hidden] { display: none; }
.carousel-nav:hover { background: #FFFFFF; }
.carousel-nav:disabled { opacity: 0; pointer-events: none; }
.carousel-nav.prev { left: 16px; }
.carousel-nav.next { right: 16px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 2px; }
.carousel-dots[hidden] { display: none; }
.carousel-dots button { width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.carousel-dots button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.55); box-shadow: 0 0 0 1px rgba(0,0,0,0.25); transition: background-color .15s ease, scale .15s ease; }
.carousel-dots button[aria-current]::before { background: #FFFFFF; scale: 1.3; }
@media (hover: none) { .carousel-nav { display: none; } }

/* Administratörer */
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.row-actions form { margin: 0; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #FBE9E7; color: var(--danger); }
.password-notice { display: flex; flex-direction: column; gap: 10px; border: 1.5px solid var(--ink); }
.one-time-password { display: inline-block; padding: 10px 14px; background: var(--grey-1); font-family: ui-monospace, Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: 0.06em; user-select: all; }

/* Bilder i admin */
.image-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.image-grid li { display: flex; flex-direction: column; gap: 6px; }
.image-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--grey-2); }
.image-grid li:first-child img { outline: 2px solid var(--ink); outline-offset: 2px; }
.image-pos { font-size: 13px; font-weight: 700; }
.image-actions { display: flex; gap: 4px; }
.icon-btn { min-width: 44px; min-height: 44px; border: 1.5px solid var(--grey-3); background: #FFFFFF; color: var(--ink); cursor: pointer; font-size: 16px; font-weight: 700; }
.icon-btn:hover:not(:disabled) { border-color: var(--ink); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn.danger { margin-left: auto; color: var(--danger); }
.icon-btn.danger:hover { border-color: var(--danger); }
.scarf { width: 30%; height: 82%; box-shadow: 0 18px 30px rgba(0,0,0,0.22); transition: width .25s ease, height .25s ease; }
.product:has(.size-option input[data-size-index="1"]:checked) .scarf { width: 58%; height: 74%; }
.product .info { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 22px; padding: 24px 0; }
.product .num { font-size: 96px; font-weight: 800; line-height: 0.8; color: var(--grey-3); }
.product.is-dark .num { color: var(--grey-4); }
.product h2 { font-size: clamp(40px, 5vw, 56px); font-weight: 800; line-height: 1; text-transform: uppercase; letter-spacing: -0.01em; }
.product .desc { font-size: 18px; line-height: 1.6; color: var(--text-muted); max-width: 460px; }
.product .meta { font-size: 15px; color: var(--text-muted); }
.product.is-dark .desc, .product.is-dark .meta { color: #DADADA; }
.size-options { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 440px; }
.size-option { position: relative; }
.size-option input { position: absolute; opacity: 0; inset: 0; }
.size-option label { min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 8px;
  border: 1.5px solid var(--grey-3); text-align: center; }
.size-option .size-name { font-weight: 700; font-size: 16px; }
.size-option .size-extra { font-size: 13px; }
.size-option input:checked + label { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.size-option input:focus-visible + label { outline: 3px solid #4C8DFF; outline-offset: 2px; }
.size-option input:disabled + label { opacity: 0.45; cursor: not-allowed; text-decoration: line-through; }
.product.is-dark .size-option label { border-color: var(--grey-4); }
.product.is-dark .size-option input:checked + label { background: var(--on-dark); color: var(--ink); border-color: var(--on-dark); }
.buy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }

/* Platshållarmönster när ett mönster saknar bild */
.ph-0 { background-color: #E6E6E6; background-image: repeating-linear-gradient(90deg, #111111 0 18px, transparent 18px 40px); }
.ph-1 { background-color: #BDBDBD; background-image: repeating-linear-gradient(0deg, rgba(17,17,17,0.8) 0 22px, transparent 22px 48px), repeating-linear-gradient(90deg, rgba(17,17,17,0.55) 0 22px, transparent 22px 48px); }
.ph-2 { background-color: #D9D9D9; background-image: radial-gradient(circle, #111111 0 7px, transparent 8px); background-size: 30px 30px; }
.ph-3 { background-color: #E6E6E6; background-image: linear-gradient(135deg, #111111 25%, transparent 25%), linear-gradient(225deg, #111111 25%, transparent 25%); background-size: 40px 40px; background-position: -20px 0, -20px 0; }
.ph-4 { background-color: #2A2A2A; background-image: radial-gradient(circle at 50% 100%, transparent 13px, #8A8A8A 14px 19px, transparent 20px); background-size: 40px 20px; }
.ph-5 { background-color: #9A9A9A; background-image: repeating-linear-gradient(60deg, #111111 0 4px, transparent 4px 16px); }
.ph-6 { background-color: #F2F2F2; background-image: repeating-linear-gradient(45deg, #111111 0 5px, transparent 5px 14px), repeating-linear-gradient(-45deg, rgba(17,17,17,0.5) 0 5px, transparent 5px 14px); }

/* Storlekar & USP */
.sizes-band { background: var(--grey-1); padding: 96px 24px; }
.sizes-band .inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 64px; align-items: center; }
.sizes-band .intro { flex: 1 1 360px; display: flex; flex-direction: column; gap: 16px; }
.sizes-band h2 { font-size: 44px; font-weight: 800; text-transform: uppercase; line-height: 1; }
.sizes-band .intro p { font-size: 17px; line-height: 1.6; color: var(--text-muted); }
.sizes-band .grid { flex: 2 1 520px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; align-items: end; }
.size-card { display: flex; flex-direction: column; gap: 10px; }
.size-card .shape-wrap { height: 280px; display: flex; align-items: flex-end; justify-content: center; }
.size-card .name { font-size: 22px; font-weight: 800; text-transform: uppercase; }
.size-card .text { font-size: 15px; color: var(--text-muted); }
.usps { padding: 72px 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; text-align: center; }
.usps div { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.usps .t { font-weight: 700; }
.usps .s { font-size: 14px; color: var(--text-muted-2); }

/* Varukorg & kassa */
.page { padding: 56px 24px 96px; max-width: 1000px; margin: 0 auto; }
.page h1 { font-size: 44px; font-weight: 800; text-transform: uppercase; margin-bottom: 32px; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--text-muted-2); padding: 10px 8px; border-bottom: 1.5px solid var(--ink); }
.cart-table td { padding: 16px 8px; border-bottom: 1px solid #E2E2E2; vertical-align: middle; }
.cart-thumb { width: 64px; height: 80px; }
.cart-product { display: flex; align-items: center; gap: 16px; }
.qty-form { display: flex; align-items: center; gap: 8px; }
.qty-form input { width: 72px; height: 44px; padding: 0 10px; border: 1.5px solid var(--grey-3); }
.cart-summary { margin-top: 32px; display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
.cart-total { font-size: 26px; font-weight: 800; }
.note { font-size: 14px; color: var(--text-muted-2); }
.table-scroll { overflow-x: auto; }

/* Admin */
.admin-shell { display: flex; flex-wrap: wrap; min-height: 100vh; background: #F7F7F7; }
.admin-nav { flex: 1 1 220px; max-width: 100%; background: var(--ink); color: var(--on-dark); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.admin-nav .logo { padding: 0 12px 20px; }
.admin-nav .logo small { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; color: var(--on-dark-muted); }
.admin-nav a, .admin-nav button { min-height: 44px; display: flex; align-items: center; padding: 0 12px; color: var(--on-dark-muted); text-decoration: none; border-radius: 4px; background: none; border: 0; cursor: pointer; text-align: left; font-size: 15px; }
.admin-nav a:hover, .admin-nav button:hover { color: var(--on-dark); background: var(--ink-2); }
.admin-nav a[aria-current="page"] { background: var(--ink-2); color: var(--on-dark); font-weight: 600; }
.admin-main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.admin-main h1 { font-size: 32px; font-weight: 800; }
.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.card { background: #FFFFFF; border: 1px solid #E2E2E2; padding: 24px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { background: #FFFFFF; border: 1px solid #E2E2E2; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font-size: 14px; color: var(--text-muted-2); }
.kpi .value { font-size: 30px; font-weight: 800; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.data-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--text-muted-2); padding: 10px 12px; border-bottom: 1px solid #E2E2E2; }
.data-table td { padding: 12px; border-bottom: 1px solid #EFEFEF; vertical-align: middle; }
.data-table .num-col { text-align: right; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; background: var(--grey-2); color: var(--ink); white-space: nowrap; }
.badge-paid { background: #DDEBE1; color: #1F4D2E; }
.badge-shipped { background: #DCE4F2; color: #1F3D63; }
.badge-pending { background: #F4E7BF; color: #5C4710; }
.badge-cancelled, .badge-refunded { background: #ECECEC; color: #444444; }
.badge-low { background: #FBE2DC; color: #8A2F14; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field textarea, .field select {
  min-height: 44px; padding: 8px 12px; border: 1.5px solid #9A9A9A; background: #FFFFFF; }
.field textarea { min-height: 110px; resize: vertical; }
.field .hint { font-size: 13px; color: var(--text-muted-2); }
.field-validation-error, .validation-summary-errors { color: var(--danger); font-size: 14px; }
.checkbox { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.checkbox input { width: 20px; height: 20px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--grey-3); text-decoration: none; font-size: 14px; background: #FFFFFF; }
.filters a[aria-current="true"] { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink-2); padding: 24px; }
.login-card { background: #FFFFFF; padding: 40px; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.thumb-sm { width: 40px; height: 50px; flex: 0 0 40px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.dl dt { color: var(--text-muted-2); }
.dl dd { margin: 0; }

@media (max-width: 640px) {
  .product { padding: 56px 16px; gap: 32px; }
  .admin-main { padding: 20px 16px; }
  .usp { display: none; }
  /* En rad i headern på mobil: logga + varukorg. Kollektionen nås genom att scrolla. */
  .site-nav { display: none; }
  .site-header .inner { padding: 8px 16px; justify-content: space-between; }
  html { scroll-padding-top: 64px; }
  /* Panelen blir ett ark längst ner, nära tummen. */
  .added-panel { top: auto; bottom: 0; right: 0; left: 0; width: 100%; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  @keyframes added-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
}
