:root {
  --color-primary: #C8102E;
  --color-primary-dark: #840A18;
  --color-bg: #FAFAF9;
  --color-surface: #FFFFFF;
  --color-text: #1A1A1A;
  --color-muted: #6B6B6B;
  --color-border: #E7E5E2;

  --radius-sm: 0.625rem;
  --radius-md: 1rem;
  --radius-pill: 999px;

  --gutter: 1rem;
  --gap: 0.75rem;
  --content-width: 68rem;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

main {
  flex: 1;
}

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

h1,
h2,
h3,
p {
  margin: 0;
  overflow-wrap: break-word;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */

.hero {
  padding: 1.75rem 0 1.5rem;
  text-align: center;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__logo {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.75rem;
  border-radius: 0.875rem;
}

.hero__tagline {
  max-width: 32rem;
  margin-bottom: 1rem;
  color: var(--color-muted);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.button:focus-visible,
.chip:focus-visible,
.footer__contact:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.button--primary {
  color: #FFFFFF;
  background: var(--color-primary);
}

.button--outline {
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}

.button--primary:active {
  background: var(--color-primary-dark);
}

@media (hover: hover) {
  .button--primary:hover {
    background: var(--color-primary-dark);
  }

  .button--outline:hover {
    color: #FFFFFF;
    background: var(--color-primary);
  }

  .chip:hover {
    border-color: var(--color-text);
  }

  .footer__contact:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
  }
}

/* Sections */

.section {
  padding-top: 2.5rem;
}

.section:last-child {
  padding-bottom: 3.5rem;
}

.section__title {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Featured: horizontal carousel on mobile, grid on larger screens */

.featured {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(62%, 16rem);
  gap: var(--gap);
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter) 0.25rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}

.featured::-webkit-scrollbar {
  display: none;
}

.featured > .card {
  scroll-snap-align: start;
}

/* Filters */

.filters {
  display: flex;
  gap: 0.5rem;
  margin: 0 calc(var(--gutter) * -1) 1.25rem;
  padding: 0 var(--gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  min-height: 2.25rem;
  padding: 0.375rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip[aria-pressed="true"] {
  color: #FFFFFF;
  background: var(--color-text);
  border-color: var(--color-text);
}

/* Grid */

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

/* Card */

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.card__media {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-surface);
}

.card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.75rem;
}

.card__name {
  display: -webkit-box;
  min-height: calc(2em * 1.35);
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card__description {
  display: -webkit-box;
  margin-top: 0.25rem;
  overflow: hidden;
  font-size: 0.8125rem;
  color: var(--color-muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card__price {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.card__cta {
  width: 100%;
  margin-top: auto;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.status {
  padding: 2rem 0;
  text-align: center;
  color: var(--color-muted);
}

/* Footer */

.footer {
  padding: 2rem 0 1.5rem;
  font-size: 0.875rem;
  color: var(--color-muted);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.footer__brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.footer__logo {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
}

.footer__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.footer__note {
  font-size: 0.8125rem;
}

.footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer__contact {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.footer__contact svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer__bottom {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  font-size: 0.8125rem;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 39.9375em) {
  .footer__social {
    width: 100%;
  }

  .footer__contact {
    flex: 1;
    justify-content: center;
  }
}

/* Very narrow screens or high zoom: one product per row */

@media (max-width: 22.4375em) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .featured {
    grid-auto-columns: 85%;
  }
}

/*
 * From tablet up, rows are centered and cards keep a fixed width range,
 * so a small catalog does not leave a gap on one side.
 */

@media (min-width: 40em) {
  :root {
    --gutter: 1.5rem;
    --gap: 1rem;
  }

  .section__title {
    text-align: center;
  }

  .filters {
    margin: 0 0 1.5rem;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
  }

  .featured,
  .grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 15.25rem));
    justify-content: center;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .card__body {
    padding: 1rem;
  }

  .card__name {
    font-size: 1rem;
  }

  .card__cta {
    font-size: 0.875rem;
  }
}

@media (min-width: 60em) {
  .hero {
    padding: 2.25rem 0 2rem;
  }

  .section {
    padding-top: 3rem;
  }

  .section:last-child {
    padding-bottom: 4.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }

  .featured {
    scroll-behavior: auto;
  }
}
