﻿
/* Wiuff Bageri webshop – clean HTML/CSS/JS frontend layer. Backend integration is deliberately separate. */
:root {
  --shop-bg: #fbfbfc;
  --shop-card: #fff;
  --shop-text: #28272a;
  --shop-muted: #73727a;
  --shop-border: #e8e7e9;
  --shop-pink: #E84F78;
  --shop-pink-deep: #D13B5F;
  --shop-pink-soft: #f9eeee;
  --shop-radius: 6px;
}

body {
  background: var(--shop-bg);
}

.shop-main {
  min-height: 60vh;
  padding-bottom: 40px;
}

.shop-container {
  width: min(calc(100% - 32px), 1360px);
  margin-inline: auto;
}

.shop-hero {
  background: var(--shop-pink-soft);
  padding: 54px 0 48px;
}

.shop-label {
  margin: 0;
  color: var(--shop-pink-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.shop-title {
  margin: 14px 0 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
}

.shop-intro {
  max-width: 680px;
  margin: 18px 0 0;
  font-size: 14.5px;
  line-height: 1.7;
}

.shop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.shop-btn {
  border: 1px solid transparent;
  border-radius: 4px;
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
}

.shop-btn-primary {
  background: var(--shop-pink);
  color: #fff;
}

.shop-btn-primary:hover {
  background: var(--shop-pink-deep);
}

.shop-btn-secondary {
  background: #fff;
  border-color: var(--shop-border);
  color: var(--shop-text);
}

.shop-content {
  padding: 44px 0 72px;
}

.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.shop-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  padding: 24px;
}

.shop-card h2 {
  margin: 10px 0 0;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.shop-card p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--shop-muted);
}

.stack {
  display: grid;
  gap: 14px;
}

.account-link {
  display: flex;
  gap: 14px;
  padding: 22px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.account-link strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 14px;
}

.account-link span {
  display: block;
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--shop-muted);
  line-height: 1.5;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.fieldset-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d9d8dc;
  background: #fff;
  border-radius: 5px;
  padding: 11px 12px;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--shop-pink-deep);
  outline-offset: 1px;
}

.field small {
  font-size: 11.5px;
  color: var(--shop-muted);
}

.shop-shell-head {
  background: var(--shop-pink-soft);
  padding: 28px 0;
}

.shop-shell-head h1 {
  text-align: center;
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* RETTET: align-items: start sikrer, at alt i hylsteret starter oppe fra toppen */
.shop-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 300px;
  gap: 30px;
  padding: 36px 0 70px;
  align-items: start;
}

.category-nav {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  align-self: start;
}

.category-nav h2,
.cart-panel h2 {
  margin: 0;
  padding: 13px 16px;
  background: var(--shop-pink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.category-nav a {
  display: block;
  padding: 10px 14px;
  border-top: 1px solid var(--shop-border);
  font-size: 12.5px;
}

.category-nav a.active {
  background: #fff5f7;
  color: var(--shop-pink-deep);
  font-weight: 700;
}

/* RETTET: align-content: start sikrer, at få produktkort ikke strækkes eller presses ned */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  align-content: start;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.product-image {
  aspect-ratio: 4/3;
  background: #f6f5f5;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-placeholder {
  font-size: 11px;
  color: #999;
  text-align: center;
  padding: 16px;
}

.product-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px;
}

.product-body h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}

.product-price {
  margin-top: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.product-body .shop-btn {
  margin-top: auto;
  padding: 10px 12px;
  min-height: 40px;
}

.cart-wrap {
  position: sticky;
  top: 130px;
  align-self: start;
  max-height: calc(100vh - 145px);
  overflow: auto;
}

.cart-panel {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.cart-location {
  padding: 10px 14px;
  border-top: 1px solid var(--shop-border);
  border-bottom: 1px solid var(--shop-border);
  font-size: 12px;
  color: var(--shop-muted);
}

.cart-empty {
  padding: 30px 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--shop-muted);
}

.cart-lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-line {
  padding: 12px 14px;
  border-bottom: 1px solid var(--shop-border);
}

.cart-line-top {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.cart-line-name {
  font-size: 12.5px;
  font-weight: 600;
}

.cart-line-config {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--shop-muted);
  line-height: 1.45;
}

.cart-line-price {
  white-space: nowrap;
  font-size: 12.5px;
}

.cart-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.cart-controls button {
  width: 27px;
  height: 27px;
  border: 1px solid var(--shop-border);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.cart-remove {
  margin-left: auto !important;
  width: auto !important;
  padding: 0 7px !important;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  padding: 13px 14px;
  font-weight: 700;
  font-size: 13px;
}

.cart-action {
  padding: 0 14px 14px;
}

.cart-action .shop-btn {
  width: 100%;
}

.mobile-cart {
  display: none;
}

.product-detail {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.product-detail-image {
  aspect-ratio: 16/9;
  background: #f6f5f5;
  display: grid;
  place-items: center;
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-detail-body {
  padding: 22px;
}

.allergens {
  font-size: 12px;
  color: var(--shop-muted);
}

.ingredients {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--shop-muted);
}

.product-form {
  display: grid;
  gap: 15px;
  margin-top: 22px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--shop-border);
  padding-top: 18px;
}

.price-row strong {
  font-size: 17px;
}

.checkout-narrow {
  width: min(calc(100% - 32px), 800px);
  margin: 0 auto;
  padding: 48px 0 80px;
}

.order-summary {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  margin-top: 26px;
}

.order-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--shop-border);
  font-size: 13.5px;
}

.order-row small {
  display: block;
  margin-top: 4px;
  color: var(--shop-muted);
}

.order-total {
  display: flex;
  justify-content: space-between;
  padding: 13px 16px;
  font-weight: 700;
}

.notice {
  padding: 16px;
  border-radius: 6px;
  background: var(--shop-pink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.warning {
  padding: 13px;
  border: 1px solid #e9a1aa;
  background: #fff1f3;
  color: #a72e45;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
}

.prototype-note {
  padding: 13px;
  background: var(--shop-pink-soft);
  border: 1px solid var(--shop-border);
  border-radius: 5px;
  font-size: 13px;
}

.legal-shop {
  width: min(calc(100% - 32px), 900px);
  margin: auto;
  padding: 70px 0 90px;
}

.legal-shop h1 {
  font-size: 42px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.legal-shop p,
.legal-shop li {
  font-size: 14px;
  line-height: 1.7;
}

.empty-state {
  background: #fff;
  border-radius: 6px;
  padding: 32px;
  text-align: center;
  color: var(--shop-muted);
  font-size: 13.5px;
}

.backend-hook {
  display: none !important;
}

@media(max-width:1100px) {
  .shop-shell {
    grid-template-columns: 200px minmax(0, 1fr) 270px;
    gap: 20px;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media(max-width:900px) {
  .shop-main {
    padding-bottom: 82px;
  }
  .entry-grid {
    grid-template-columns: 1fr;
  }
  .shop-shell {
    display: block;
    padding-top: 22px;
  }
  .category-nav {
    display: flex;
    overflow-x: auto;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 4px;
  }
  .category-nav h2 {
    display: none;
  }
  .category-nav a {
    flex: 0 0 auto;
    border: 1px solid var(--shop-border);
    border-radius: 999px;
    background: #fff;
    padding: 9px 12px;
  }
  .category-nav a.active {
    border-color: var(--shop-pink);
    background: var(--shop-pink-soft);
  }
  .cart-wrap {
    display: none;
  }
  .mobile-cart {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: #fff;
    border-top: 1px solid var(--shop-border);
    padding: 10px 14px;
  }
  .mobile-cart-button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 0;
    background: var(--shop-pink);
    color: #fff;
    border-radius: 5px;
    padding: 13px 15px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
  }
  .mobile-cart-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(0, 0, 0, .48);
    align-items: flex-end;
  }
  .mobile-cart-sheet.open {
    display: flex;
  }
  .mobile-cart-sheet-inner {
    width: 100%;
    max-height: 85vh;
    overflow: auto;
    background: var(--shop-bg);
    padding: 16px;
  }
  .mobile-cart-close {
    display: block;
    margin-left: auto;
    margin-bottom: 10px;
    border: 1px solid var(--shop-border);
    background: #fff;
    border-radius: 4px;
    width: 38px;
    height: 38px;
  }
  .mobile-cart-sheet .cart-panel {
    max-width: 560px;
    margin: auto;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media(max-width:560px) {
  .shop-container {
    width: min(calc(100% - 24px), 1360px);
  }
  .shop-hero {
    padding: 38px 0;
  }
  .shop-actions {
    flex-direction: column;
  }
  .shop-actions .shop-btn {
    width: 100%;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .product-body {
    padding: 11px;
  }
  .product-body h3 {
    font-size: 12.5px;
  }
  .product-price {
    font-size: 12px;
    margin-bottom: 11px;
  }
  .product-body .shop-btn {
    font-size: 10.5px;
  }
  .checkout-narrow {
    width: min(calc(100% - 24px), 800px);
    padding-top: 34px;
  }
  .footer-row {
    align-items: flex-start;
  }
}

/* Mobile category picker: explicit vertical menu instead of horizontal swipe chips */
.category-picker {
  display: none;
}

@media(max-width:900px) {
  .category-nav-desktop {
    display: none !important;
  }
  .category-picker {
    display: block;
    margin-bottom: 18px;
    position: relative;
  }
  .category-picker-toggle {
    width: 100%;
    min-height: 52px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--shop-border);
    border-radius: 4px;
    background: #fff;
    padding: 10px 13px;
    text-align: left;
    color: var(--shop-text);
    font: inherit;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  }
  .category-picker-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--shop-muted);
  }
  .category-picker-toggle strong {
    font-size: 13px;
    letter-spacing: .035em;
    text-transform: uppercase;
    line-height: 1.25;
  }
  .category-picker-chevron {
    font-size: 22px;
    line-height: 1;
    transform: translateY(-2px);
    transition: transform .18s ease;
  }
  .category-picker.open .category-picker-chevron {
    transform: rotate(180deg) translateY(2px);
  }
  .category-picker-list {
    margin-top: 6px;
    border: 1px solid var(--shop-border);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .09);
    overflow: hidden;
  }
  .category-picker-list a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 13px;
    border-top: 1px solid var(--shop-border);
    font-size: 13px;
    text-decoration: none;
    color: var(--shop-text);
    background: #fff;
  }
  .category-picker-list a:first-child {
    border-top: 0;
  }
  .category-picker-list a.active {
    background: var(--shop-pink-soft);
    color: var(--shop-pink-deep);
    font-weight: 700;
    position: relative;
    padding-right: 38px;
  }
  .category-picker-list a.active:after {
    content: '✓';
    position: absolute;
    right: 14px;
    font-weight: 700;
  }
}