:root {
  color-scheme: light;
  --bg: #f8f7f5;
  --surface: #ffffff;
  --text: #111111;
  --muted: #5c5c5c;
  --accent: #1c6dff;
  --accent-soft: #e7f0ff;
  --border: #e3e1dd;
}

body.theme-dark {
  color-scheme: dark;
  --bg: #111317;
  --surface: #171b22;
  --text: #f6f7f8;
  --muted: #a8b1bb;
  --accent: #6ea9ff;
  --accent-soft: rgba(110, 169, 255, 0.15);
  --border: #22272e;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0 !important;
}

body {
  opacity: 0;
  transition: opacity 0.35s ease-out;
}

body.page-loaded {
  opacity: 1;
}
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.wrapper {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

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

button {
  font: inherit;
}

.site-header,
.site-footer {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  font-weight: 800;
  letter-spacing: -0.05em;
}

.site-nav {
  display: flex;
  gap: 1rem;
}

.site-nav a {
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--text);
}

.nav-cart {
  position: relative;
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  margin-left: 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.85rem;
}

.hero {
  padding: 4rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.button,
.button-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.button-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.button-sm {
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
}

.featured-products,
.catalog-grid,
.content-block,
.product-detail,
.cart-page {
  padding: 3rem 0;
}

.product-grid,
.catalog-grid {
  display: grid;
  gap: 1.5rem;
}

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

.catalog-card {
  background-color: #ffffff !important;
  border-color: rgba(28, 28, 28, 0.08);
  box-shadow: 0 18px 42px rgba(18, 22, 23, 0.08);
}

.catalog-card:hover {
  box-shadow: 0 22px 52px rgba(18, 22, 23, 0.12);
}

.catalog-card-image-wrapper {
  aspect-ratio: 4 / 3;
  min-height: 0;
  background-color: rgba(229, 226, 225, 0.2);
}

.catalog-card-body {
  background-color: #ffffff;
  padding: 1.25rem;
  gap: 1rem;
}

.catalog-card-title {
  font-size: 0.5rem;
  line-height: 1.25;
}

.catalog-card-price {
  font-size: 0.9rem;
  color: #4f565c;
}

.catalog-card-actions {
  flex-wrap: wrap;
}

.catalog-card-actions button,
.catalog-card-actions a {
  min-width: 0;
}

.catalog-card-actions button,
.catalog-card-actions a {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}

.catalog-card-actions a {
  border: 1px solid rgba(28, 28, 28, 0.08);
  background: transparent;
}

.catalog-card-footer {
  padding-top: 1rem;
}

.catalog-card-footer span {
  font-size: 0.85rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  display: grid;
}

.product-card-image {
  padding: 1.5rem;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
}

.product-card-copy {
  padding: 1.5rem;
}

.product-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.page-intro,
.content-block,
.cart-page,
.product-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
}

.content-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.content-card {
  background: var(--bg);
  border-radius: 1rem;
  padding: 1.5rem;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.product-image {
  width: 100%;
  max-width: 480px;
  border-radius: 1rem;
}

.product-copy ul {
  list-style: disc;
  padding-left: 1.2rem;
  color: var(--muted);
}

.side-cart {
  position: fixed;
  right: -100%;
  top: 0;
  width: min(420px, 100%);
  height: 100vh;
  background: var(--surface);
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.14);
  transition: right 0.3s ease;
  z-index: 30;
  display: flex;
  flex-direction: column;
}

.side-cart.open {
  right: 0;
}

.side-cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 20;
  pointer-events: none;
}

.side-cart-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.side-cart-open {
  overflow: hidden;
}

.cart-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.cart-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.cart-close {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.cart-close:hover {
  background: var(--accent-soft);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.cart-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item div:first-child {
  min-width: 0;
}

.cart-item strong {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.cart-item p {
  margin: 0;
  color: var(--muted);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.cart-checkout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 1rem;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cart-checkout:hover,
#checkout-button:hover {
  background: #145fd3;
}

#checkout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: 1rem;
  border: none;
  cursor: pointer;
}

@media (max-width: 600px) {
  .side-cart {
    width: 100%;
  }

  .cart-header,
  .cart-footer,
  .cart-items {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.theme-toggle {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
}

@media (max-width: 900px) {
  .hero-grid,
  .product-detail-grid,
  .content-block {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }
}
