:root {
  --page-bg: #fafafa;
  --surface: #ffffff;
  --foreground: #000000;
  --border: #e5e5e5;
  --muted-border: #d4d4d4;
  --muted-foreground: #737373;
  --accent: #2563eb;
  --accent-foreground: #ffffff;
  --focus-ring: #a3a3a3;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 48px;
  --home-max: 1536px;
  --footer-max: 1280px;
  --label-bg: rgba(255, 255, 255, 0.72);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--foreground);
  font-family: "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
input {
  font: inherit;
}

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

.hidden {
  display: none !important;
}

.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;
}

.site-nav {
  width: 100%;
}

.nav-shell,
.page-shell,
.site-footer {
  width: 100%;
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--home-max);
  margin: 0 auto;
  padding: var(--space-4);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.brand-link,
.footer-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-link {
  margin-right: var(--space-2);
}

.logo-square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.logo-square-sm {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-lg);
}

.brand-name {
  margin-left: var(--space-2);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.menu,
.footer-menu {
  display: none;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
}

.menu-link,
.footer-link {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-underline-offset: 4px;
}

.menu-link:hover,
.footer-link:hover,
.menu-link:focus-visible,
.footer-link:focus-visible {
  color: var(--foreground);
  text-decoration: underline;
}

.nav-search {
  position: relative;
  order: 3;
  width: 100%;
}

.nav-search input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 0 44px 0 var(--space-4);
  color: var(--foreground);
}

.nav-search input::placeholder {
  color: var(--muted-foreground);
}

.nav-search input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.search-button {
  position: absolute;
  top: 50%;
  right: var(--space-2);
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  transform: translateY(-50%);
  cursor: pointer;
}

.search-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.utility-button,
.footer-utility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--foreground);
}

.utility-button {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 500;
}

.footer-utility {
  min-height: 32px;
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
  font-size: 0.75rem;
  align-self: flex-start;
}

.utility-button:hover,
.footer-utility:hover,
.utility-button:focus-visible,
.footer-utility:focus-visible {
  border-color: var(--foreground);
}

.page-shell {
  padding-bottom: var(--space-6);
}

.featured-grid,
.search-grid,
.search-results-copy {
  max-width: var(--home-max);
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.featured-grid {
  display: grid;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
}

.featured-slot {
  min-width: 0;
}

.carousel-shell {
  width: 100%;
  overflow-x: auto;
  padding-top: var(--space-1);
  padding-bottom: var(--space-5);
}

.carousel-row {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  max-width: var(--home-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.carousel-item {
  position: relative;
  width: 66vw;
  max-width: 475px;
  height: 30vh;
  max-height: 275px;
  flex: 0 0 auto;
}

.search-results-copy {
  margin: 0 0 var(--space-4);
  font-size: 1rem;
  line-height: 1.5;
}

.search-results-copy strong {
  font-weight: 700;
}

.search-grid {
  display: grid;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
}

.product-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.product-link:hover,
.product-link:focus-visible {
  border-color: var(--accent);
}

.product-image-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 300ms ease-in-out;
}

.product-link:hover .product-image,
.product-link:focus-visible .product-image {
  transform: scale(1.05);
}

.product-label-wrap {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 100%;
  padding: 0 var(--space-4) var(--space-4);
}

.product-label-wrap.label-center {
  align-items: flex-end;
  padding-bottom: 35%;
}

.product-label {
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--label-bg);
  padding: var(--space-1);
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(12px);
}

.product-title {
  display: -webkit-box;
  max-width: min(100%, 520px);
  margin-right: var(--space-4);
  overflow: hidden;
  padding-left: var(--space-2);
  line-height: 1.1;
  letter-spacing: -0.02em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.price-pill {
  flex: none;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--accent-foreground);
  padding: var(--space-2);
  white-space: nowrap;
}

.site-footer {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.footer-main,
.footer-legal {
  max-width: var(--footer-max);
  margin: 0 auto;
}

.footer-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border-top: 1px solid var(--border);
  padding: var(--space-6) var(--space-5);
}

.footer-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.footer-brand {
  color: var(--foreground);
}

.footer-legal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  border-top: 1px solid var(--border);
  padding: var(--space-5) var(--space-4);
}

.footer-legal p {
  margin: 0;
}

@media (min-width: 640px) {
  .search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .nav-inner {
    flex-wrap: nowrap;
  }

  .nav-left {
    width: 33.3333%;
  }

  .menu {
    display: flex;
  }

  .nav-search {
    order: 2;
    width: 33.3333%;
  }

  .nav-right {
    width: 33.3333%;
  }

  .featured-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .featured-slot-large {
    grid-column: span 4 / span 4;
    grid-row: span 2 / span 2;
  }

  .featured-slot-small {
    grid-column: span 2 / span 2;
  }

  .carousel-item {
    width: 33vw;
  }

  .footer-main {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-6);
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .footer-utility {
    margin-left: auto;
  }

  .footer-legal {
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
  }

  .footer-note-right {
    margin-left: auto;
  }
}

@media (min-width: 1024px) {
  .search-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
