:root {
  --bg: #f4f9ff;
  --surface: #ffffff;
  --surface-soft: #e6f3ff;
  --ink: #071a33;
  --muted: #5c6f88;
  --line: #cbdff5;
  --blue: #006dff;
  --blue-dark: #062653;
  --orange: #ff970f;
  --orange-2: #ffb13d;
  --graphite: #061321;
  --shadow: 0 22px 60px rgba(6, 19, 33, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, rgba(126, 199, 255, 0.26), transparent 32%),
    radial-gradient(circle at 88% 10%, rgba(255, 151, 15, 0.14), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 58%, var(--surface-soft) 100%);
}

img {
  display: block;
  max-width: 100%;
}

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

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(244, 249, 255, 0.94);
  border-bottom: 1px solid rgba(203, 223, 245, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--graphite);
  font-size: 19px;
  font-weight: 900;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--graphite);
  font-size: 13px;
  font-weight: 800;
}

.nav a:not(.nav-button):hover {
  color: var(--blue);
}

.nav-button,
.button,
.link-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.nav-button,
.button.primary {
  border: 1px solid transparent;
  padding: 0 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), #0088ff);
  box-shadow: 0 12px 28px rgba(0, 109, 255, 0.24);
}

.button.secondary,
.nav-logout,
.link-button {
  border: 1px solid var(--line);
  padding: 0 16px;
  color: var(--graphite);
  background: #ffffff;
}

.button.secondary:hover,
.link-button:hover,
.product-actions a:hover {
  border-color: var(--orange);
  color: var(--blue-dark);
}

.auth-greeting {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.cart-link {
  position: relative;
}

.cart-count {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 7px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 40px auto 64px;
}

.product-shell,
.cart-shell {
  display: grid;
  gap: 24px;
}

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
  gap: 32px;
  align-items: center;
}

.product-media,
.product-panel,
.cart-panel,
.mini-product,
.cart-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.product-media {
  padding: clamp(14px, 3vw, 28px);
}

.product-main-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fbff;
}

.product-gallery-thumbs {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.product-gallery-thumbs button {
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f8fbff;
  cursor: pointer;
}

.product-gallery-thumbs button.active {
  border-color: var(--orange);
}

.product-gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-panel {
  padding: clamp(22px, 4vw, 36px);
  border-top: 5px solid var(--orange);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-size: clamp(2.2rem, 5vw, 4.3rem);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.price {
  margin: 0 0 22px;
  color: var(--graphite);
  font-size: 2rem;
  font-weight: 900;
}

.product-meta-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.product-meta-strip div {
  min-height: 76px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.product-meta-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.product-meta-strip strong {
  color: var(--blue-dark);
  font-size: 1rem;
}

.product-options {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.option-group {
  display: grid;
  gap: 9px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
}

.option-group textarea {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  resize: vertical;
}

.option-group textarea:focus,
.quantity-label input:focus {
  outline: 3px solid rgba(0, 109, 255, 0.16);
  border-color: var(--blue);
}

.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-option {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px 0 8px;
  background: #ffffff;
  cursor: pointer;
}

.color-option:has(input:checked) {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 109, 255, 0.12);
}

.color-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-option span {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(6, 19, 33, 0.22);
  border-radius: 999px;
  background: var(--swatch);
}

.color-option strong {
  color: var(--graphite);
  font-size: 13px;
}

.buy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.quantity-label {
  display: grid;
  gap: 7px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
}

.quantity-label input {
  width: 88px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.detail-list {
  margin: 20px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

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

.info-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(6, 19, 33, 0.08);
}

.info-panel h2 {
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-size: 1.1rem;
}

.info-panel p,
.info-panel li {
  color: var(--muted);
  line-height: 1.55;
}

.info-panel p {
  margin: 0;
}

.info-panel ul {
  margin: 0;
  padding-left: 18px;
}

.info-panel dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.info-panel dl div {
  display: grid;
  gap: 3px;
}

.info-panel dt {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.info-panel dd {
  margin: 0;
  color: var(--muted);
}

.shop-status {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--blue-dark);
  font-weight: 900;
}

.section-title {
  margin: 18px 0 14px;
  color: var(--blue-dark);
  font-size: 1.4rem;
}

.catalog-shell {
  display: grid;
  gap: 24px;
}

.catalog-hero,
.catalog-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.catalog-hero {
  min-height: 320px;
  padding: clamp(28px, 5vw, 54px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  border-top: 5px solid var(--orange);
}

.catalog-hero-actions {
  min-width: 220px;
  display: grid;
  gap: 10px;
}

.catalog-panel {
  padding: clamp(22px, 4vw, 34px);
}

.section-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-row h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.05;
}

.lead.compact {
  max-width: 620px;
  margin-bottom: 0;
}

.catalog-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.catalog-category-card {
  min-height: 220px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.catalog-category-card.active,
.catalog-category-card:hover {
  border-color: var(--orange);
  background: #ffffff;
}

.catalog-category-card span,
.product-tag {
  width: fit-content;
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255, 151, 15, 0.14);
  color: #9a5700;
  font-size: 12px;
  font-weight: 900;
}

.catalog-category-card span {
  padding: 7px 10px;
}

.catalog-category-card strong {
  color: var(--graphite);
  font-size: 1.05rem;
  line-height: 1.24;
}

.catalog-category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.catalog-category-card small {
  color: var(--blue);
  font-weight: 900;
}

.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.catalog-filters button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--blue-dark);
  background: #ffffff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.catalog-filters button.active {
  border-color: transparent;
  color: #ffffff;
  background: var(--blue);
}

.catalog-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 4px solid rgba(0, 109, 255, 0.64);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(6, 19, 33, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 151, 15, 0.62);
  border-top-color: var(--orange);
  box-shadow: 0 22px 50px rgba(6, 19, 33, 0.14);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f8fbff;
}

.product-card h3 {
  margin: 0;
  padding: 14px 18px 0;
  color: var(--graphite);
  font-size: 1.12rem;
  line-height: 1.25;
}

.product-card p {
  margin: 8px 0 0;
  padding: 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.product-tag {
  margin: 16px 18px 0;
  padding: 6px 10px;
}

.product-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 0;
}

.product-card-meta span {
  border-radius: 999px;
  background: #f8fbff;
  padding: 6px 9px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}

.product-price {
  display: block;
  padding: 14px 18px 0;
  color: var(--blue);
  font-size: 1.18rem;
  font-weight: 900;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 18px 18px;
}

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

.product-actions a,
.product-actions button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.product-actions a {
  border: 1px solid var(--line);
  color: var(--graphite);
  background: #ffffff;
}

.product-actions button {
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), #0088ff);
}

.catalog-empty {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.catalog-empty h2 {
  margin: 0 0 8px;
  color: var(--blue-dark);
}

.catalog-empty p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

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

.mini-product {
  overflow: hidden;
}

.mini-product img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f8fbff;
}

.mini-product strong,
.mini-product span {
  display: block;
  padding: 0 16px;
}

.mini-product strong {
  margin-top: 14px;
  color: var(--graphite);
}

.mini-product span {
  padding-bottom: 16px;
  color: var(--blue);
  font-weight: 900;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 24px;
  align-items: start;
}

.cart-items {
  display: grid;
  gap: 14px;
}

.cart-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 160px;
  gap: 16px;
  align-items: center;
  padding: 14px;
}

.cart-item img {
  width: 112px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fbff;
}

.cart-item h2 {
  margin: 0 0 6px;
  color: var(--blue-dark);
  font-size: 1.1rem;
}

.cart-item p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.45;
}

.cart-item strong {
  color: var(--graphite);
}

.cart-item-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.cart-item-options span {
  border-radius: 999px;
  background: #f8fbff;
  padding: 6px 9px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}

.cart-item-actions {
  display: grid;
  gap: 10px;
}

.cart-item-actions label {
  display: grid;
  gap: 6px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}

.cart-item-actions input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.cart-panel {
  padding: 22px;
  border-top: 5px solid var(--orange);
}

.cart-panel h2 {
  margin: 0 0 16px;
  color: var(--blue-dark);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.summary-row.total {
  border-bottom: 0;
  color: var(--graphite);
  font-size: 1.2rem;
  font-weight: 900;
}

.cart-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.empty-cart,
.missing-product {
  padding: 32px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--orange);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.empty-cart h1,
.missing-product h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

@media (max-width: 880px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .product-hero,
  .cart-layout,
  .product-info-grid {
    grid-template-columns: 1fr;
  }

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

  .catalog-hero,
  .section-row {
    grid-template-columns: 1fr;
  }

  .catalog-hero {
    align-items: start;
  }

  .section-row {
    display: grid;
  }

  .catalog-filters {
    justify-content: flex-start;
  }

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

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

  .cart-item-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .catalog-category-grid,
  .catalog-product-grid {
    grid-template-columns: 1fr;
  }

  .catalog-hero-actions,
  .catalog-hero-actions .button {
    width: 100%;
  }
}
