:root {
  --bg: #f3f5f6;
  --surface: #ffffff;
  --surface-2: #e8ecef;
  --text: #182026;
  --muted: #5f6f7e;
  --primary: #0f66d7;
  --primary-dark: #0b53b1;
  --success: #0e9467;
  --border: #d8dfe5;
  --shadow: 0 8px 24px rgba(20, 40, 70, 0.08);
  --natblå: #174886;
  --nebulosaröd: #D23C27;
  --stjärnstoftsgul: #FBB11B;
  --norrskensgrön: #2d8418
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: linear-gradient(180deg, #f9fbfc 0%, var(--bg) 100%);
  background-repeat: no-repeat;
  background-attachment: scroll; /* important: not fixed */
}

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--text);
  font-family: "Manrope", sans-serif;

  display: flex;              /* IMPORTANT: must be enabled */
  flex-direction: column;
}

main.page-content {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /* background: color-mix(in srgb, var(--surface) 94%, transparent); */
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  background-color: #174886;
  transition: transform 220ms ease;
  will-change: transform;
}

.site-header.site-header--hidden {
  transform: translateY(-100%);
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand .material-symbols-outlined {
  color: var(--primary);
}

.brand img {
  height: 6rem;        /* pick the size you want */
  width: auto;         /* keep aspect ratio */
  display: block;      /* removes baseline gap */
}


.main-nav {
  display: flex;
  gap: clamp(1rem, 2vw, 3rem);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.mobile-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid #2f5f99;
  border-radius: 12px;
  background: #1a4f90;
  color: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-menu-toggle .material-symbols-outlined {
  font-size: 24px;
}

.mobile-nav {
  display: none;
  border-top: 1px solid #2f5f99;
  background: #174886;
  padding: 0.4rem 4vw 0.8rem;
}

.mobile-nav.is-open {
  display: grid;
  gap: 0.25rem;
}

.mobile-nav-link {
  color: var(--nebulosaröd);
  font-weight: 700;
  padding: 0.7rem 0.3rem;
  border-bottom: 1px solid #2f5f99;
}

.mobile-nav-link:hover {
  color: var(--stjärnstoftsgul);
}

.mobile-nav-link:last-child {
  border-bottom: 0;
}

/* Keep button hidden on desktop; switch to dropdown nav on narrower screens. */
@media (max-width: 1100px) {
  .main-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }
}

.nav-link {
  color: var(--nebulosaröd);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
}

.nav-link.is-active,
.nav-link:hover {
  color: var(--stjärnstoftsgul);
}

.cart-link {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--norrskensgrön);
  color: white;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nebulosaröd);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

.page-content {
  padding: 2rem 0 3rem;
}

.page-intro {
  margin-bottom: 1.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}

h1 {
  margin: 0.35rem 0 0.55rem;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.1;
}

.page-intro > p:last-child {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.catalog-toolbar {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.product-image-wrap {
  aspect-ratio: 1 / 1;
  background: #e5eaf0;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  flex: 1;
  width: 100%;
}

.product-category {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--nebulosaröd);
  font-weight: 800;
}

.product-title {
  margin: 0;
  font-size: 1rem;
}

.product-price {
  margin: 0.25rem 0 0.8rem;
  font-size: 1.3rem;
  font-weight: 800;
}

.add-to-cart-form {
  margin-top: auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
}

.quantity-input {
  width: 52px;
  min-width: 52px;
  flex: 0 0 52px;
  height: 44px;
  margin: 0;
  padding: 0 0.4rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fa 100%);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  box-shadow: inset 0 1px 2px rgba(20, 40, 70, 0.06);
  justify-self: start;
  text-align: center;
}

.quantity-input:focus {
  outline: 2px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-color: var(--primary);
}

.add-to-cart-form .btn {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--norrskensgrön);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  filter: brightness(0.96);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
  max-width: 200px;
}

.empty-state {
  grid-column: 1 / -1;
  background: var(--surface);
  
  border-radius: 14px;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 1rem;
  align-items: start;
}

.cart-items,
.order-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-header h2,
.order-summary h2 {
  margin: 0;
  font-size: 1.15rem;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.cart-list {
  display: flex;
  flex-direction: column;
}

.cart-item {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 0.95rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.cart-item:first-child {
  border-top: 0;
}

.cart-item-image-wrap {
  width: 86px;
  height: 86px;
  border-radius: 12px;
  overflow: hidden;
  background: #e5eaf0;
}

.cart-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-history {
  grid-column: 2 ;
  min-width: 0; /* important so text can wrap normally */
}

.cart-item-info h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.cart-item-info p {
  margin: 0.1rem 0;
  font-size: 0.9rem;
}

.muted {
  color: var(--muted);
}

.cart-item-subtotal {
  margin: 0;
  align-self: start;
  font-weight: 800;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
}

.cart-remove-form {
  margin: 0;
}

.cart-remove-btn {
  width: auto;
  min-width: 120px;
}

.history-products-list {
  width: 100%;
}

.history-summary-block {
  padding: 1rem;
}

.history-summary-dropdown {
  padding: 0;
}

.history-summary-dropdown summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.history-summary-dropdown summary::-webkit-details-marker {
  display: none;
}

.history-summary-dropdown summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.history-summary-dropdown[open] summary::after {
  content: "▴";
}

.history-summary-content {
  padding: 1rem;
}

.history-summary-totals {
  padding-bottom: 0.8rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.history-product-item {
  width: 100%;
  padding: 0.9rem 0;
}

.history-product-content {
  padding: 0 0.45rem;
}

.history-product-item p {
  margin: 0.15rem 0;
}

.history-product-divider {
  border: 0;
  border-top: 1px solid #b5c0c9;
  margin: 0;
  width: 100%;
}

.order-summary {
  padding: 1rem;
  position: sticky;
  top: 90px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.8rem 0;
  color: var(--muted);
}

.summary-line.total {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--border);
  background-color: #174886;
}

.footer-row {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--nebulosaröd);
  font-size: 0.9rem;  
}

.footer-row:hover {
  color: var(--stjärnstoftsgul);
  border-bottom-color: var(--primary);
}

.form {
  display: grid;
  border-radius: 16px;
  background-color: #ffffff;
  padding: 20px;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.consent-field {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.consent-field input[type="checkbox"] {
  margin-top: 0.2rem;
}

.consent-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.consent-link:hover,
.consent-link:focus-visible {
  color: var(--primary-dark);
  border-bottom-color: currentColor;
  outline: none;
}

.form-error {
  grid-column: 1 / -1;
  margin: -0.35rem 0 0;
  color: var(--nebulosaröd);
  font-size: 0.9rem;
  font-weight: 700;
}

input[type=text], select {
  font-family: inherit;
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.form input[type="submit"] {
  grid-column: 1 / -1;   /* span both columns */
  justify-self: center; /* center horizontally */
  width: auto;          /* override .btn width: 100% */
  min-width: 200px;     /* optional, looks better */
}

.form input[type="submit"]:disabled,
.form button[type="submit"]:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.history-filter-form {
  grid-template-columns: 1.2fr 1fr 1fr;
  align-items: end;
  gap: 0.85rem 1rem;
}

.history-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.history-filter-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.history-filter-form input[type="text"],
.history-filter-form input[type="date"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  margin: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.history-filter-form input[type="date"] {
  min-height: 44px;
}

.history-filter-form input[type="text"]:focus,
.history-filter-form input[type="date"]:focus {
  outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
  border-color: var(--primary);
}

.history-filter-form input[type="submit"] {
  grid-column: 1 / -1;
  margin-top: 0.35rem;
}

@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .order-summary {
    position: static;
  }
}

@media (max-width: 760px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }

  .header-row {
    min-height: 84px;
  }

  .brand img {
    height: 4.8rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-filter-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .header-row {
    min-height: 62px;
  }

  .brand span:last-child {
    font-size: 0.9rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 72px 1fr;
  }

  .cart-item-subtotal {
    grid-column: 1 / -1;
    margin-top: 0.2rem;
  }

  .cart-item-actions {
    grid-column: 1 / -1;
    align-items: flex-start;
  }
}

.checkout-complete {
  display: grid;
  place-items: center;
  min-height: 65vh;
}

.checkout-complete-card {
  width: min(680px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.checkout-complete-icon {
  color: var(--success);
  font-size: 2.1rem;
}

.checkout-complete-card h1 {
  margin-top: 0.4rem;
}

.checkout-complete-card > p {
  margin: 0;
  color: var(--muted);
}

.checkout-complete-details {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.checkout-complete-details p {
  margin: 0.6rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.checkout-complete-details span {
  color: var(--muted);
}

.checkout-complete-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.checkout-btn {
  width: auto;
  min-width: 180px;
  padding: 0 1.1rem;
}

@media (max-width: 540px) {
  .checkout-btn {
    width: 100%;
  }
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.contact-role {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

/* .contact-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}

.contact-line span {
  color: var(--muted);
} */

.supplier-section {
  margin-top: 1rem;
}

.supplier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.supplier-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.supplier-text {
  margin: 0 0 1rem;
  color: var(--muted);
}

.supplier-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.supplier-list a {
  color: var(--norrskensgrön);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-line {
    flex-direction: column;
    align-items: flex-start;
  }
}

.message-wrap {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.message-box {
  background-color: #d32f2f;
  color: white;
  padding: 14px 22px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
