:root {
  --ink: #1f2a30;
  --muted: #6b7c84;
  --line: #dce3e6;
  --surface: #ffffff;
  --canvas: #f3f6f7;
  --teal: #00695c;
  --teal-dark: #004d40;
  --amber: #ffb300;
  --danger: #b3261e;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shop-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid #cfd8dc;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 10px rgba(31, 42, 48, 0.08);
}

.shop-header-inner {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.5fr) auto;
  align-items: center;
  gap: 24px;
  max-width: 1500px;
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 24px;
}

.shop-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.shop-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.shop-brand strong,
.shop-brand small {
  display: block;
}

.shop-brand strong {
  font-size: 17px;
}

.shop-brand small {
  margin-top: 2px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.shop-search {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  height: 42px;
  border: 1px solid #b0bec5;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
}

.shop-search i {
  color: #78909c;
  text-align: center;
}

.shop-search input {
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
}

.shop-search button {
  align-self: stretch;
  padding: 0 17px;
  border: 0;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.shop-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 4px;
  color: #455a64;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.shop-action:hover {
  background: #e0f2f1;
  color: var(--teal);
}

.shop-action b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--amber);
  color: #3b2a00;
  font-size: 11px;
}

.shop-shell {
  max-width: 1500px;
  min-height: calc(100vh - 130px);
  margin: 0 auto;
  padding: 22px 24px 40px;
}

.shop-notice {
  padding: 12px 15px;
  margin-bottom: 16px;
  border: 1px solid #90caf9;
  border-radius: 5px;
  background: #e3f2fd;
  color: #0d4772;
}

.shop-notice-warning {
  border-color: #ffe082;
  background: #fff8e1;
  color: #795d00;
}

.catalog-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 3px 0 18px;
}

.catalog-heading span,
.tracking-heading > div > span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-heading h1,
.tracking-heading h1 {
  margin: 4px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.catalog-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: start;
  gap: 18px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31, 42, 48, 0.12);
}

.product-image {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: #eef2f3;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image > span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 3px;
  background: #e8f5e9;
  color: #216e39;
  font-size: 10px;
  font-weight: 800;
}

.product-image > .out-stock {
  background: #ffebee;
  color: var(--danger);
}

.product-body {
  padding: 13px;
}

.product-body > small {
  display: block;
  min-height: 15px;
  color: #78909c;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.product-body h2 {
  min-height: 40px;
  margin: 5px 0 3px;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
}

.product-body p {
  min-height: 17px;
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.product-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #edf0f1;
}

.product-price strong {
  color: var(--teal-dark);
  font-size: 16px;
}

.product-price span {
  color: var(--muted);
  font-size: 10px;
}

.add-form {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 7px;
  margin-top: 10px;
}

.add-form input,
.cart-line input {
  width: 100%;
  height: 36px;
  padding: 6px 7px;
  border: 1px solid #b0bec5;
  border-radius: 4px;
  text-align: center;
}

.add-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.add-form button:disabled,
.checkout-button:disabled {
  background: #b0bec5;
  cursor: not-allowed;
}

.cart-panel {
  position: sticky;
  top: 90px;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(31, 42, 48, 0.08);
  overflow: hidden;
}

.cart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  background: #455a64;
  color: #fff;
}

.cart-heading span,
.cart-heading strong {
  display: block;
}

.cart-heading span {
  color: #cfd8dc;
  font-size: 10px;
  text-transform: uppercase;
}

.cart-heading strong {
  margin-top: 2px;
}

.cart-heading i {
  font-size: 21px;
}

.cart-lines {
  padding: 5px 15px 12px;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px auto;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f1;
}

.cart-line strong,
.cart-line small {
  display: block;
}

.cart-line strong {
  font-size: 12px;
}

.cart-line small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.cart-line b {
  font-size: 11px;
  white-space: nowrap;
}

.cart-update {
  margin-top: 10px;
  padding: 7px 9px;
  border: 1px solid #b0bec5;
  border-radius: 4px;
  background: #fff;
  color: #455a64;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-top: 1px solid #cfd8dc;
  border-bottom: 1px solid #cfd8dc;
  background: #f7f9fa;
}

.cart-total strong {
  color: var(--teal-dark);
  font-size: 18px;
}

.checkout-form {
  padding: 15px;
}

.checkout-form h2 {
  margin: 0 0 11px;
  font-size: 15px;
  letter-spacing: 0;
}

.checkout-form > label {
  display: block;
  margin-bottom: 10px;
}

.checkout-form > label > span {
  display: block;
  margin-bottom: 5px;
  color: #455a64;
  font-size: 11px;
  font-weight: 700;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #b0bec5;
  border-radius: 4px;
  background: #fff;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 10px;
  border: 1px solid #b0bec5;
  border-radius: 4px;
  overflow: hidden;
}

.segmented-control label {
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: block;
  padding: 8px;
  text-align: center;
  color: #455a64;
  font-size: 11px;
  font-weight: 700;
}

.segmented-control input:checked + span {
  background: #e0f2f1;
  color: var(--teal);
}

.checkout-button,
.shop-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 4px;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
}

.cart-empty,
.catalog-empty {
  padding: 35px 18px;
  color: var(--muted);
  text-align: center;
}

.cart-empty i {
  font-size: 28px;
}

.tracking-view {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(31, 42, 48, 0.08);
  overflow: hidden;
}

.tracking-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-left: 5px solid var(--amber);
  background: var(--teal);
  color: #fff;
}

.tracking-heading > div > span {
  color: #ffd54f;
}

.tracking-heading p {
  margin: 4px 0 0;
  color: #e0f2f1;
}

.tracking-status {
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 4px;
  text-align: right;
}

.tracking-status small,
.tracking-status strong {
  display: block;
}

.tracking-status small {
  color: #e0f2f1;
  font-size: 10px;
  text-transform: uppercase;
}

.tracking-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.tracking-summary > div {
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.tracking-summary > div:last-child {
  border-right: 0;
}

.tracking-summary span,
.tracking-summary strong {
  display: block;
}

.tracking-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.tracking-summary strong {
  margin-top: 4px;
  font-size: 13px;
}

.payment-intent {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 18px 20px 0;
  padding: 12px 14px;
  border: 1px solid #90caf9;
  border-radius: 5px;
  background: #e3f2fd;
  color: #0d4772;
}

.payment-intent i {
  font-size: 21px;
}

.payment-intent span,
.payment-intent strong {
  display: block;
}

.payment-intent span {
  font-size: 10px;
  text-transform: uppercase;
}

.tracking-grid {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 20px;
  padding: 20px;
}

.tracking-grid h2 {
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: 0;
}

.tracking-items > div,
.tracking-events > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #edf0f1;
}

.tracking-items strong,
.tracking-items small,
.tracking-events strong,
.tracking-events small {
  display: block;
}

.tracking-items small,
.tracking-events small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.tracking-events > div {
  justify-content: flex-start;
}

.tracking-events i {
  color: var(--teal);
}

.tracking-view > .shop-secondary-button {
  width: auto;
  margin: 0 20px 20px;
  background: #455a64;
}

.shop-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-top: 1px solid #cfd8dc;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .shop-header-inner {
    grid-template-columns: 1fr auto;
  }

  .shop-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .shop-layout {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .shop-header-inner,
  .shop-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .shop-action span {
    display: none;
  }

  .catalog-heading,
  .tracking-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tracking-summary,
  .tracking-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tracking-summary > div:nth-child(2) {
    border-right: 0;
  }

  .tracking-summary > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .tracking-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .shop-header-inner {
    gap: 10px;
  }

  .shop-brand small {
    display: none;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-body h2,
  .product-body p {
    min-height: 0;
  }

  .shop-footer {
    flex-direction: column;
  }
}
