:root {
  color-scheme: light;
  --navy: #0d334d;
  --navy-2: #164b69;
  --aqua: #00aaa5;
  --aqua-soft: #d9f4f1;
  --red: #e51f43;
  --ink: #102d3f;
  --muted: #627582;
  --line: #d7e1e6;
  --surface: #ffffff;
  --page: #f3f7f8;
  --success: #0b766f;
  --shadow: 0 12px 32px rgba(13, 51, 77, 0.12);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.store-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  border-bottom: 1px solid rgba(215, 225, 230, 0.9);
  padding: 10px max(20px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.store-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
}

.store-brand img {
  display: block;
  width: 138px;
  height: 52px;
  object-fit: contain;
}

.store-brand span {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 15px;
  color: #fff;
  background: var(--navy);
  font-weight: 850;
}

.cart-button strong {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--navy);
  background: #fff;
  font-size: 12px;
}

main {
  width: min(calc(100% - 40px), 1180px);
  margin: 0 auto;
}

.store-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  min-height: 168px;
  padding: 34px 0 28px;
}

.store-intro p,
.store-intro h1 {
  margin: 0;
}

.store-intro p {
  margin-bottom: 6px;
  color: var(--aqua);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.store-intro h1 {
  max-width: 760px;
  color: var(--navy);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.team-price-badge {
  border: 1px solid #89d7d1;
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--success);
  background: var(--aqua-soft);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.store-status {
  margin-bottom: 20px;
  border-left: 4px solid var(--aqua);
  border-radius: 4px;
  padding: 14px 16px;
  color: var(--navy);
  background: #fff;
  font-weight: 750;
}

.store-status.is-error {
  border-left-color: var(--red);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.store-loading,
.store-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--muted);
  text-align: center;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(13, 51, 77, 0.05);
}

.product-card button {
  display: grid;
  width: 100%;
  min-height: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.product-image-wrap {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #edf3f5;
}

.product-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.product-card button:hover img,
.product-card button:focus-visible img {
  transform: scale(1.025);
}

.product-card-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 15px;
}

.product-card-copy h2,
.product-card-copy p {
  margin: 0;
}

.product-card-copy h2 {
  color: var(--navy);
  font-size: 17px;
  line-height: 1.25;
}

.product-card-copy p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.store-confidence {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin: 54px 0 0;
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.store-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(calc(100% - 40px), 1180px);
  min-height: 104px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.store-footer nav {
  display: flex;
  gap: 18px;
}

.store-footer a {
  color: var(--navy-2);
  font-weight: 800;
  text-decoration: none;
}

.product-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  overflow: auto;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
}

.product-dialog::backdrop {
  background: rgba(7, 29, 44, 0.64);
}

.dialog-close-row {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  justify-content: flex-end;
  padding: 12px;
  background: #fff;
}

.icon-close {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--navy);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 28px;
  padding: 0 24px 28px;
}

.product-detail-media {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  background: #edf3f5;
}

.product-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 0;
}

.product-detail-copy h2,
.product-detail-copy p {
  margin: 0;
}

.product-detail-copy h2 {
  color: var(--navy);
  font-size: 30px;
  line-height: 1.1;
}

.product-detail-copy > p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.product-price {
  margin-top: 18px;
  color: var(--navy);
  font-size: 25px;
  font-weight: 900;
}

.variant-field {
  display: grid;
  gap: 7px;
  margin-top: 22px;
}

.variant-field span,
.checkout-email span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.variant-field select,
.checkout-email input {
  width: 100%;
  height: 48px;
  border: 1px solid #bdccd5;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.add-cart-button,
.checkout-button {
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: var(--aqua);
  font-weight: 900;
}

.add-cart-button {
  width: 100%;
  margin-top: auto;
}

.cart-backdrop {
  position: fixed;
  z-index: 39;
  inset: 0;
  background: rgba(7, 29, 44, 0.54);
}

.cart-drawer {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(440px, 100vw);
  height: 100dvh;
  transform: translateX(102%);
  background: #fff;
  box-shadow: -12px 0 36px rgba(7, 29, 44, 0.18);
  transition: transform 180ms ease;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
}

.cart-head p,
.cart-head h2 {
  margin: 0;
}

.cart-head p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.cart-head h2 {
  color: var(--navy);
  font-size: 24px;
}

.cart-lines {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px 20px;
}

.cart-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
}

.cart-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.cart-line img {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  background: #edf3f5;
}

.cart-line-copy {
  min-width: 0;
}

.cart-line-copy strong,
.cart-line-copy span {
  display: block;
}

.cart-line-copy strong {
  overflow: hidden;
  color: var(--navy);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-line-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.cart-line-controls {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.quantity-control {
  display: grid;
  grid-template-columns: 30px 30px 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.quantity-control button {
  height: 30px;
  border: 0;
  color: var(--navy);
  background: #f5f8f9;
  font-weight: 900;
}

.quantity-control span {
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.remove-line {
  border: 0;
  padding: 0;
  color: #b41c39;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.cart-checkout {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 18px 20px max(20px, env(safe-area-inset-bottom));
  background: #fff;
}

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--navy);
  font-size: 18px;
  font-weight: 900;
}

.checkout-email {
  display: grid;
  gap: 6px;
}

.checkout-button:disabled,
.add-cart-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.cart-checkout > p {
  min-height: 16px;
  margin: 0;
  color: #b41c39;
  font-size: 12px;
  font-weight: 750;
}

.receipt-screen {
  position: fixed;
  z-index: 60;
  inset: 0;
  overflow: auto;
  padding: 50px 20px;
  background: var(--page);
}

.receipt-card {
  width: min(680px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}

.receipt-card > img {
  width: 150px;
  height: 60px;
  object-fit: contain;
}

.receipt-card h1 {
  margin: 20px 0 6px;
  color: var(--navy);
  font-size: 30px;
}

.receipt-card > p {
  margin: 0 0 22px;
  color: var(--muted);
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.receipt-total {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  border-top: 2px solid var(--navy);
  padding-top: 16px;
  color: var(--navy);
  font-size: 19px;
  font-weight: 900;
}

.receipt-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 24px;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: var(--navy);
  font-weight: 850;
  text-decoration: none;
}

.store-toast {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  border-radius: 6px;
  padding: 12px 16px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 800;
}

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

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

  .add-cart-button {
    margin-top: 24px;
  }

  .store-confidence {
    align-items: center;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .store-header {
    min-height: 66px;
    padding: 8px 14px;
  }

  .store-brand img {
    width: 112px;
    height: 43px;
  }

  .store-brand span {
    display: none;
  }

  .cart-button {
    min-height: 40px;
  }

  main,
  .store-footer {
    width: min(calc(100% - 28px), 1180px);
  }

  .store-intro {
    min-height: 132px;
    padding: 24px 0 20px;
  }

  .store-intro h1 {
    font-size: 36px;
  }

  .team-price-badge {
    padding: 7px 10px;
    font-size: 11px;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .product-card-copy {
    padding: 13px;
  }

  .product-dialog {
    width: 100vw;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
  }

  .product-detail {
    gap: 18px;
    padding: 0 16px 24px;
  }

  .product-detail-copy h2 {
    font-size: 25px;
  }

  .store-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 22px 0;
  }

  .cart-line {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .cart-line img {
    width: 60px;
    height: 60px;
  }

  .cart-line-controls {
    grid-column: 2;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
