* {
  box-sizing: border-box;
}

:root {
  --page: #f3f5f4;
  --surface: #ffffff;
  --surface-muted: #eef2f0;
  --ink: #0b130f;
  --muted: #5c6f66;
  --line: #dce5e1;
  --line-strong: rgba(11, 19, 15, 0.14);
  --brand: #072f1f;
  --brand-soft: #174f2d;
  --accent: #c2410c;
  --price: #0f3d28;
  --badge: #fef3c7;
  --badge-ink: #92400e;
  --success: #15803d;
  --success-soft: #dcfce7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --radius-control: 0.5rem;
  --radius-card: 0.875rem;
  --shadow-soft: 0 8px 24px rgba(11, 19, 15, 0.06);
  --ring: 0 0 0 3px rgba(23, 79, 45, 0.22);
  font-size: 16px;
}

body {
  margin: 0;
  padding: 1.5rem;
  background: var(--page);
  color: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--brand-soft);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.page {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
}

.lesson-nav {
  margin: 0 0 1.5rem;
  padding: 0.75rem;
  background: var(--surface-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.lesson-nav a {
  flex: 1 1 7.5rem;
  padding: 0.55rem 0.7rem;
  background: var(--surface);
  border: 1px solid #a9bdaf;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.lesson-nav a:hover,
.lesson-nav a[aria-current="page"] {
  background: var(--brand-soft);
  color: #ffffff;
}

.page-header {
  margin: 0 0 1.5rem;
  padding: 2rem;
  background: var(--brand);
  border-radius: var(--radius-card);
  color: #ffffff;
}

.page-header h1,
.page-header p {
  margin: 0;
}

.page-header p {
  margin-top: 0.5rem;
  color: #dceade;
}

.panel,
.panel-alt {
  margin: 0 0 1.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.panel-alt {
  background: var(--surface-muted);
}

.panel h2,
.panel-alt h2 {
  margin: 0 0 0.5rem;
  color: var(--brand-soft);
}

.panel > p,
.panel-alt > p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.btn,
button {
  font: inherit;
  cursor: pointer;
}

.btn,
.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--brand-soft);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.btn-secondary,
.actions .btn-secondary {
  background: var(--surface);
  border-color: #789383;
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.field {
  margin: 0 0 1rem;
}

.field label,
.field-label {
  display: block;
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.buy-box input,
.buy-box select {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #789383;
  border-radius: var(--radius-control);
  background: #ffffff;
  font: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.buy-box input:focus,
.buy-box select:focus {
  outline: none;
  box-shadow: var(--ring);
  border-color: var(--brand-soft);
}

.help {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Store shell */
.store-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.store-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1.1rem;
  background: var(--brand);
  color: #ffffff;
}

.store-brand {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.store-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

.store-nav a {
  color: #e7f3ec;
  font-weight: 600;
  text-decoration: none;
}

.store-nav a[aria-current="page"] {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.store-actions a {
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-control);
}

.category-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}

.category-panel h3 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.category-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-panel a {
  display: block;
  padding: 0.2rem 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
}

.store-main {
  padding: 1.25rem 1.1rem;
}

.store-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  padding: 1.25rem 1.1rem;
  background: #0a1f16;
  color: #dceade;
}

.store-footer h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #ffffff;
}

.store-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.store-footer a {
  color: #b8d0c4;
  text-decoration: none;
  font-size: 0.9rem;
}

/* Product cards */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.section-head h2,
.section-head h3 {
  margin: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.product-media {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(145deg, #d7e5dc 0%, #a8c4b4 55%, #6f927f 100%);
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 800;
  font-size: 0.9rem;
}

.product-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem;
  flex: 1;
}

.product-body h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.product-body h3 a {
  color: inherit;
  text-decoration: none;
}

.rating-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.price {
  margin: 0;
  color: var(--price);
  font-size: 1.15rem;
  font-weight: 800;
}

.price-was {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  width: fit-content;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--badge);
  color: var(--badge-ink);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Filter catalog */
.catalog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}

.filter-aside {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.filter-aside h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.filter-aside fieldset {
  margin: 0 0 1rem;
  padding: 0.75rem 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.filter-aside legend {
  padding: 0;
  font-weight: 700;
  font-size: 0.9rem;
}

.choice-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.choice-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.choice-line label {
  font-weight: 500;
}

.price-range {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  align-items: end;
}

.price-range .field {
  margin: 0;
}

/* Product detail */
.pdp-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.pdp-layout-spaced {
  margin-top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gallery {
  display: grid;
  gap: 0.75rem;
}

.gallery-main {
  aspect-ratio: 1;
  border-radius: var(--radius-card);
  background:
    linear-gradient(160deg, #cfe0d6, #7fa892 70%);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--brand);
}

.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gallery-thumbs span {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  border: 2px solid var(--line);
  background: #d5e4db;
}

.gallery-thumbs span[aria-current="true"] {
  border-color: var(--brand-soft);
}

.buy-box {
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.buy-box h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  line-height: 1.3;
}

.buy-price {
  margin: 0.5rem 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--price);
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 0.75rem;
}

.swatch,
.size-chip {
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid #789383;
  border-radius: var(--radius-control);
  background: #ffffff;
  font: inherit;
  font-weight: 600;
}

.swatch[aria-pressed="true"],
.size-chip[aria-pressed="true"] {
  border-color: var(--brand-soft);
  box-shadow: var(--ring);
}

.tab-chrome {
  margin-top: 1.5rem;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.tab-list a,
.tab-list span {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border-radius: 0.5rem 0.5rem 0 0;
  font-weight: 700;
  text-decoration: none;
  color: var(--muted);
}

.tab-list [aria-current="page"] {
  color: var(--brand-soft);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-bottom-color: var(--surface-muted);
  margin-bottom: -1px;
}

.tab-panel {
  padding: 0.5rem 0;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table th,
.spec-table td {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.spec-table th {
  width: 35%;
  background: var(--surface-muted);
}

/* Cart / summary */
.cart-layout,
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  background: var(--surface-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.product-cell {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.product-thumb {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 0.4rem;
  background: #c9dcd1;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.qty-control input {
  width: 3.5rem;
  min-height: 2.2rem;
  text-align: center;
  border: 1px solid #789383;
  border-radius: var(--radius-control);
  font: inherit;
}

.order-summary {
  position: static;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.order-summary h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.summary-lines {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.summary-lines li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

/* Delivery cards */
.delivery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.delivery-card {
  position: relative;
  margin: 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.delivery-card:has(input:checked) {
  border-color: var(--brand-soft);
  box-shadow: var(--ring);
}

.delivery-card input {
  position: absolute;
  opacity: 0.01;
  width: 1px;
  height: 1px;
}

.delivery-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.delivery-card .fee {
  font-weight: 800;
  color: var(--price);
}

/* Account hub */
.profile-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.profile-identity {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.profile-identity h2 {
  margin: 0 0 0.25rem;
}

.metric-tile {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.metric-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.metric-tile strong {
  font-size: 1.35rem;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.status-shipped {
  background: #dbeafe;
  color: #1e40af;
}

.status-canceled {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-fulfilled {
  background: var(--success-soft);
  color: var(--success);
}

/* Stores + invoice */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 1rem;
}

.store-card {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  text-align: center;
}

.store-logo {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.65rem;
  border-radius: 999px;
  background: #c5d9cd;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--brand);
}

.invoice {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.invoice-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.invoice-meta h3 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.invoice-meta p {
  margin: 0;
  font-size: 0.95rem;
}

.invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

@media (min-width: 36rem) {
  .profile-header {
    grid-template-columns: 1fr 1fr;
  }

  .price-range {
    grid-template-columns: 1fr 1fr auto;
  }
}

@media (min-width: 52rem) {
  .catalog-layout {
    grid-template-columns: minmax(14rem, 16rem) 1fr;
  }

  .pdp-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }

  .cart-layout,
  .checkout-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(14rem, 18rem);
  }

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

  .profile-header {
    grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
  }
}

@media print {
  body {
    background: #ffffff;
    padding: 0;
  }

  .wb-nav,
  .lesson-nav,
  .page-header,
  .panel-alt,
  .source-section,
  .invoice-actions {
    display: none !important;
  }

  .invoice {
    border: 0;
    border-radius: 0;
    padding: 0;
  }
}
