:root {
  color-scheme: light;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: #112444;
  background: #f2f6fb;
  --ink: #112444;
  --blue: #0649be;
  --navy: #081f46;
  --muted: #50617c;
  --line: #dee8f4;
  --green: #216151;
  --lime: #daf487;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 3px solid #1888f5; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
.wrap { width: min(1260px, 100% - clamp(32px, 7vw, 96px)); margin-inline: auto; }
.header { position: sticky; top: 0; z-index: 2; background: var(--navy); color: white; }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-inner { min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 1.04rem; font-weight: 750; }
.site-brand-icon { display: block; width: 44px; height: 44px; flex: 0 0 auto; }
.header .site-brand-icon { background: white; border-radius: 9px; }
.brand small { display: block; color: #c6d7ef; font-size: .83rem; font-weight: 500; }
.cart-link { display: flex; align-items: center; gap: 10px; border: 1px solid #50668b; padding: 7px 10px 7px 14px; border-radius: 999px; text-decoration: none; font-weight: 700; }
.cart-link span { min-width: 28px; text-align: center; background: var(--lime); color: var(--navy); border-radius: 999px; padding: 3px 6px; }
.hero {
  margin-block: 27px 37px;
  min-height: 356px;
  display: flex;
  align-items: center;
  border-radius: 22px;
  color: white;
  background:
    radial-gradient(ellipse at 89% 0%, #1d71d5 0%, transparent 54%),
    repeating-radial-gradient(ellipse at 93% 108%, transparent 0 42px, #cce1ff20 43px 44px, transparent 45px 63px),
    linear-gradient(112deg, #092249 25%, #0b2e61 78%, #0b4295);
  overflow: hidden;
}
.hero-copy { padding: 30px clamp(24px, 5vw, 63px); }
h1 { margin-block: 11px 13px; font-weight: 850; font-size: clamp(2.75rem, 6.2vw, 5.05rem); line-height: .95; letter-spacing: -.061em; }
.hero p { max-width: 35ch; color: #e6effd; font-size: 1.06rem; line-height: 1.5; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 45px; padding: 9px 18px; border: 0; border-radius: 9px; font-weight: 730; text-decoration: none; }
.hero-button { background: var(--lime); color: var(--navy); margin-top: 21px; }
.hero-button:hover { background: #e9ffac; }
.primary { width: 100%; background: var(--blue); color: white; }
.primary:hover:not(:disabled), .quantity button:hover:not(:disabled) { background: #07388e; color: white; }
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(265px, 310px); align-items: start; gap: 24px; padding-bottom: 52px; }
#tuotteet, #tilaus { scroll-margin-top: 92px; }
.section-head { margin-bottom: 19px; }
h2 { font-size: clamp(1.38rem, 2.3vw, 1.9rem); letter-spacing: -.038em; line-height: 1.17; }
.section-head p, #empty { margin-top: 8px; color: var(--muted); line-height: 1.45; }
.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.products > .catalog-category { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.catalog-category-title { grid-column: 1 / -1; font-size: 1.12rem; letter-spacing: -.02em; color: var(--navy); margin: 4px 0 1px; }
.product, .order-card { background: white; border: 1px solid var(--line); border-radius: 15px; }
.product { overflow: hidden; display: flex; flex-direction: column; }
.product-image { height: 166px; display: grid; place-items: center; width: 100%; padding: 4px; border: 0; background: #f9fafb; overflow: hidden; }
.product-image img { width: 100%; height: 100%; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.product-image:hover img { transform: scale(1.04); }
.product-image:focus-visible { outline-offset: -4px; }
.product-info { padding: 15px; display: flex; flex: 1; flex-direction: column; }
.product-brand { font-size: .86rem; color: #32548c; font-weight: 720; }
.product h3 { font-size: 1.22rem; line-height: 1.15; margin-block: 3px 6px; }
.product-name { padding: 0; border: 0; background: none; color: inherit; font-weight: inherit; text-align: left; }
.product-name:hover { color: var(--blue); text-decoration: underline; }
.product-type { font-size: .875rem; color: var(--muted); min-height: 2.6em; }
.product-values { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 8px; margin-block: auto 12px; }
.price { color: var(--ink); font-size: .91rem; font-weight: 740; }
.profit { font-size: .875rem; font-weight: 750; padding: 4px 7px; color: var(--green); background: #ebf6e6; border-radius: 6px; }
.quantity { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; border: 1px solid #cbd9ec; border-radius: 8px; }
.quantity button, .quantity input { height: 39px; border: 0; background: #eff5fc; color: var(--navy); text-align: center; }
.quantity button { font-size: 1.28rem; border-radius: 7px; }
.quantity input { background: white; width: 100%; appearance: textfield; color: var(--ink); }
.quantity input::-webkit-inner-spin-button, .quantity input::-webkit-outer-spin-button { appearance: none; }
#tilaus { position: sticky; top: 93px; }
.order-card { padding: 20px; box-shadow: 0 8px 24px #0d35670a; }
.order-card h2 { font-size: 1.45rem; }
.lines { list-style: none; padding: 0; margin: 14px 0 0; max-height: 200px; overflow: auto; }
.lines li, .totals div { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.lines li { padding: 7px 0; font-size: .9rem; border-bottom: 1px solid #edf1f7; }
.lines li span:last-child, dd { white-space: nowrap; }
.totals { margin-block: 17px; border-top: 1px solid var(--line); padding-top: 12px; font-size: .88rem; }
.totals dd { font-weight: 740; }
.totals .proceeds { margin-top: 9px; padding: 10px; color: var(--green); background: #ebf6e6; border-radius: 8px; font-weight: 740; }
.status { color: var(--blue); font-size: .9rem; }
.status:not(:empty) { margin-bottom: 9px; }
.order-note { color: var(--muted); font-size: .875rem; line-height: 1.4; margin-top: 10px; }
footer { background: var(--navy); color: white; padding: 24px 0; }
footer span { color: #c6d7ef; font-size: .9rem; }
dialog { width: min(490px, 100% - 24px); max-height: 90dvh; border: 1px solid var(--line); border-radius: 15px; padding: 23px; color: var(--ink); }
dialog::backdrop { background: #0a2359aa; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.close { border: 0; background: #eff5fc; color: var(--ink); border-radius: 8px; min-width: 38px; min-height: 38px; font-size: 1.35rem; }
dialog label { display: grid; gap: 4px; margin-top: 12px; font-weight: 650; }
dialog input, dialog textarea { width: 100%; border: 1px solid #b8c9df; border-radius: 7px; min-height: 40px; padding: 6px 8px; color: var(--ink); background: white; }
dialog .primary { margin-top: 14px; }
dialog pre { background: #f2f6fb; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
#product-detail { width: min(700px, 100% - 24px); padding: 0; }
#product-detail[open] { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); }
.detail-image { display: grid; place-items: center; background: #f7f9fc; padding: 18px; }
.detail-image img { width: 100%; height: auto; max-height: 385px; object-fit: contain; mix-blend-mode: multiply; }
.detail-close { position: absolute; top: 10px; right: 10px; }
.detail-info { padding: 38px 20px 20px; }
.detail-info h2 { margin-block: 4px 10px; }
#detail-description, .detail-features { color: var(--muted); line-height: 1.48; }
.detail-features { padding-inline-start: 18px; }
.detail-actions .button { margin: 0; }
#detail-quantity { color: var(--muted); font-size: .9rem; text-align: center; margin-top: 8px; }
@media (max-width: 1090px) {
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .products > .catalog-category { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hero { min-height: 295px; margin-block: 16px 26px; }
  .order-layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 28px; }
  #tilaus { position: static; }
}
@media (max-width: 560px) {
  #product-detail[open] { grid-template-columns: minmax(0, 1fr); }
  .detail-image { padding: 8px; }
  .detail-image img { max-height: min(220px, 35dvh); }
  .detail-info { padding: 14px 17px 17px; }
}
@media (max-width: 430px) {
  .hero { min-height: 295px; }
  .products { gap: 9px; }
  .products > .catalog-category { gap: 9px; }
  .product-image { height: 104px; }
  .product-info { padding: 10px; }
  .product-type { margin-bottom: 6px; }
  .footer-inner { align-items: start; flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.customer-product-card { display: grid; align-content: start; gap: 10px; padding: 14px; }
.customer-product-card h3 { margin: 0; font-size: 1.15rem; }
.customer-product-card .product-name { text-decoration: underline; text-decoration-color: #92a6c2; text-underline-offset: 3px; }
.customer-product-card .customer-product-image { height: 155px; border-radius: 9px; }
.customer-product-description, .customer-variant-offer { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.customer-offer-label { color: #b3261e; font-weight: 800; font-size: .95rem; line-height: 1.35; margin: 4px 0 0; }
.customer-product-card label { display: grid; gap: 4px; font-size: .9rem; font-weight: 650; }
.customer-product-card select, .customer-product-card input {
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  padding: 5px 8px;
  border: 1px solid #b8c9df;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}
.customer-quantity select { width: 100px; }
.login-page { width: min(880px, 100% - 32px); padding-block: clamp(32px, 7vw, 72px); }
.login-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-top: 24px; }
.login-options section { background: white; border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px, 4vw, 28px); }
.login-options section > p { margin-block: 12px 18px; line-height: 1.5; color: var(--muted); }
.login-options form { display: grid; gap: 8px; justify-items: start; }
.login-options label { font-weight: 650; }
.login-options input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #7387a3; border-radius: 8px; }
.login-options form button { margin-top: 6px; }
.login-options #status:empty { margin: 0; }
.campaign-product-dialog { width: min(700px, 100% - 24px); padding: 0; }
.campaign-product-dialog[open] { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); }
.campaign-product-dialog .detail-info { display: grid; align-content: start; gap: 8px; }
#campaign-detail-variant { color: var(--muted); }
#campaign-detail-description { line-height: 1.55; }
@media (max-width: 560px) {
  .campaign-product-dialog[open] { grid-template-columns: minmax(0, 1fr); }
}

#status:empty { display: none; }
#tilaus { position: sticky; top: 20px; padding: 20px; }
#tilaus h2 { margin-bottom: 14px; }
#order-lines { padding-left: 20px; line-height: 1.6; }
.buyer-order-total { margin-block: 15px; font-size: 1.1rem; }
#buyer-form { display: grid; gap: 12px; }
#buyer-form label { display: grid; gap: 6px; }
#buyer-form input { width: 100%; min-height: 41px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; }
#buyer-form .button { width: 100%; }
@media (max-width: 850px) {
  .order-layout { grid-template-columns: minmax(0, 1fr); }
  #tilaus { position: static; }
}
@media (max-width: 620px) {
  .products { grid-template-columns: repeat(1, minmax(0,1fr)); }
  .products > .catalog-category { grid-template-columns: minmax(0,1fr); }
}

.campaign-order {
  --campaign-primary: #081f46;
  --campaign-secondary: #78a9e1;
  --campaign-on-primary: #fff;
  min-height: 100vh;
  background: color-mix(in srgb, var(--campaign-primary) 5%, #f8fafc);
}
.campaign-order .order-layout { padding-top: clamp(16px, 4vw, 32px); }
.campaign-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
  padding: clamp(18px, 4vw, 36px);
  border-bottom: 5px solid var(--campaign-secondary);
  border-radius: 16px;
  background: var(--campaign-primary);
  color: var(--campaign-on-primary);
}
.campaign-logo {
  flex: none;
  width: clamp(52px, 13vw, 104px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}
.campaign-heading { min-width: 0; }
.campaign-heading h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.55rem, 4vw, 3.35rem);
  line-height: 1.06;
}
.campaign-heading p:not(:empty) { margin-top: 8px; line-height: 1.4; }
.campaign-order .catalog-category-title {
  padding-inline-start: 10px;
  border-inline-start: 4px solid var(--campaign-primary);
}
.campaign-order .order-card { border-top: 4px solid var(--campaign-primary); }
.campaign-order .primary,
.campaign-order .primary:hover:not(:disabled) {
  background: var(--campaign-primary);
  color: var(--campaign-on-primary);
}
.campaign-order .primary:hover:not(:disabled) { text-decoration: underline; }

@media (max-width: 560px) {
  .campaign-order .products,
  .campaign-order .products > .catalog-category { grid-template-columns: minmax(0, 1fr); }
}

.campaign-cart-link { display: none; }
@media (width <= 850px) {
  .campaign-order .order-layout { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .campaign-cart-link:not([hidden]) {
    position: fixed;
    z-index: 2;
    inset-inline: max(16px, calc((100% - 440px) / 2));
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    gap: 16px;
    min-height: 48px;
    border: 1px solid var(--campaign-on-primary);
    background: var(--campaign-primary);
    color: var(--campaign-on-primary);
    box-shadow: 0 5px 18px #11244435;
  }
}

.home-categories { margin-block: 24px 48px; }
.home-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 16px;
  margin-top: 14px;
}
.home-category-grid article {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 24px);
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}
.home-category-grid img {
  width: clamp(64px, 15vw, 128px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.home-category-grid p { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.campaign-home .footer-inner a { padding-block: 8px; }

.campaign-home .hero-copy { min-width: 0; }
@media (max-width: 430px) {
  .campaign-home h1 { font-size: clamp(1.85rem, 8.7vw, 2.4rem); }
}

.home-contact { margin-block: 28px 48px; }
.home-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 14px;
  margin-top: 14px;
}
.home-contact-grid > div { padding: 15px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.home-contact-grid dt { margin-bottom: 6px; font-weight: 700; }
.home-contact-grid a, .campaign-order .order-note a { overflow-wrap: anywhere; }

/* Logo and colour editor */
.brand-editor { margin: 0 0 16px; padding: 16px; border: 1px solid var(--line, #d6e0dc); border-radius: 12px; background: #fff; }
.brand-editor h3 { margin: 0 0 6px; }
.brand-preview { display: flex; align-items: center; gap: 14px; min-height: 84px; margin: 12px 0; padding: 12px 16px; border-radius: 10px; }
.brand-preview img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.brand-preview strong { font-size: 1.15rem; overflow-wrap: anywhere; }
.brand-colors { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.brand-editor input[type=color] { width: 72px; min-height: 40px; padding: 2px; display: block; }
.brand-editor .brand-note { display: block; margin: 6px 0 10px; color: var(--muted, #53635d); }
.brand-editor .button { width: auto; margin: 6px 8px 0 0; }
