html {
  font-size: 16px;
  min-height: 100%;
}

body {
  background: var(--off-white);
  color: var(--charcoal);
  font-family: var(--font-sans);
  margin: 0;
  overflow-x: hidden;
}

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

img,
svg {
  max-width: 100%;
}

img {
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
.brand {
  font-family: var(--font-display);
  letter-spacing: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(178, 138, 82, 0.6);
  outline-offset: 3px;
}

.container {
  max-width: var(--container-max);
  min-width: 0;
}

.topbar {
  background: var(--wine-900);
  color: var(--cream);
  font-size: 0.75rem;
  font-weight: 600;
  min-height: 26px;
  padding: 0.28rem 1rem;
  text-align: center;
}

.site-nav {
  background: rgba(252, 250, 246, 0.98);
  border-bottom: 1px solid rgba(231, 222, 210, 0.9);
  min-height: 70px;
  padding: 0.35rem 0;
}

.nav-shell {
  align-items: center;
  gap: 1.1rem;
}

.brand {
  align-items: center;
  color: var(--wine-800);
  display: inline-flex;
  gap: 0.6rem;
  min-width: max-content;
}

.brand:hover {
  color: var(--wine-700);
}

.brand-mark {
  color: var(--wine-700);
  display: inline-flex;
  height: 36px;
  width: 36px;
}

.brand-mark svg {
  fill: currentColor;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.brand strong {
  display: block;
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 0.9;
  text-transform: uppercase;
}

.brand small {
  color: var(--gray);
  display: block;
  font-family: var(--font-sans);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  margin-top: 0.18rem;
  text-transform: uppercase;
}

.navbar-nav {
  gap: 0.12rem;
}

.site-nav .nav-link {
  color: var(--charcoal);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.5rem 0.36rem;
  white-space: nowrap;
}

.site-nav .nav-link:hover {
  color: var(--wine-700);
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  margin-left: 0.55rem;
}

.header-search {
  align-items: center;
  background: #f1ece4;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--gray);
  display: flex;
  gap: 0.5rem;
  height: 40px;
  max-width: 250px;
  min-width: 200px;
  padding: 0 0.8rem;
}

.header-search:focus-within {
  background: var(--surface);
  border-color: var(--gold-muted);
}

.header-search svg,
.icon-action svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.header-search svg {
  flex: 0 0 18px;
  height: 18px;
  width: 18px;
}

.header-search input {
  background: transparent;
  border: 0;
  color: var(--charcoal);
  min-width: 0;
  outline: 0;
  width: 100%;
}

.header-search input::placeholder {
  color: #8a837a;
}

.icon-action {
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--charcoal);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  position: relative;
  width: 40px;
}

.icon-action:hover {
  background: var(--cream);
  color: var(--wine-700);
}

.icon-action svg {
  height: 24px;
  width: 24px;
}

.user-menu {
  position: relative;
}

.user-menu__trigger {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--charcoal);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  padding: 0;
  width: 40px;
}

.user-menu__trigger:hover,
.user-menu__trigger[aria-expanded="true"] {
  background: var(--cream);
  color: var(--wine-700);
}

.user-avatar {
  align-items: center;
  background: var(--cream);
  border: 1px solid rgba(195, 164, 113, 0.55);
  border-radius: 50%;
  color: var(--wine-800);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  line-height: 1;
  overflow: hidden;
  position: relative;
  width: 36px;
}

.user-avatar--large {
  font-size: 0.82rem;
  height: 42px;
  width: 42px;
}

.user-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.user-avatar svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 22px;
}

.user-avatar--with-image .user-avatar__fallback {
  display: none;
}

.user-avatar--with-image.is-fallback img {
  display: none;
}

.user-avatar--with-image.is-fallback .user-avatar__fallback {
  display: inline-flex;
}

.user-menu__dropdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  min-width: 260px;
  padding: 0.45rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: min(280px, calc(100vw - 2rem));
  z-index: 30;
}

.user-menu__header {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  padding: 0.55rem 0.6rem 0.7rem;
}

.user-menu__header strong,
.user-menu__header small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__header strong {
  color: var(--wine-900);
  font-size: 0.9rem;
  font-weight: 900;
}

.user-menu__header small {
  color: var(--gray);
  font-size: 0.74rem;
  margin-top: 0.12rem;
  max-width: 185px;
}

.user-menu__section {
  border-top: 1px solid var(--border);
  padding: 0.35rem 0;
}

.user-menu__item {
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--charcoal);
  display: block;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 0.58rem 0.6rem;
  text-align: left;
  width: 100%;
}

.user-menu__item:hover,
.user-menu__item:focus-visible {
  background: var(--cream);
  color: var(--wine-700);
}

.user-menu__logout {
  color: var(--wine-800);
}

.cart-icon span {
  align-items: center;
  background: var(--wine-700);
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 0.66rem;
  font-weight: 800;
  height: 17px;
  justify-content: center;
  position: absolute;
  right: 1px;
  top: 1px;
  width: 17px;
}

.btn-wine,
.btn-outline-wine,
.btn-gold,
.newsletter-strip button,
.catalog-search button,
.card-actions button,
.card-actions a,
.cart-quantity button {
  border-radius: var(--radius-sm);
  font-weight: 800;
  min-height: 40px;
  padding: 0.72rem 1.2rem;
}

.btn-wine,
.newsletter-strip button,
.catalog-search button,
.card-actions button,
.card-actions a,
.cart-quantity button {
  background: var(--wine-700);
  border: 1px solid var(--wine-700);
  color: #fff;
}

.btn-wine:hover,
.newsletter-strip button:hover,
.catalog-search button:hover,
.card-actions button:hover,
.card-actions a:hover,
.cart-quantity button:hover {
  background: var(--wine-800);
  border-color: var(--wine-800);
  color: #fff;
}

.btn-outline-wine {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(252, 250, 246, 0.64);
  color: var(--off-white);
}

.btn-outline-wine:hover {
  background: var(--off-white);
  color: var(--wine-800);
}

.btn-gold {
  background: var(--gold);
  border: 1px solid var(--gold);
  color: var(--wine-900);
}

.btn-gold:hover {
  background: var(--gold-muted);
  border-color: var(--gold-muted);
  color: var(--wine-900);
}

.eyebrow,
.section-heading span {
  color: var(--gold);
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-heading h2 {
  color: var(--wine-900);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin: 0;
}

.section-heading p {
  color: var(--gray);
  font-size: 0.95rem;
  margin: 0.25rem 0 0;
}

.section-heading > a {
  color: var(--wine-700);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.wine-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.wine-card {
  background: var(--surface);
  border: 1px solid rgba(231, 222, 210, 0.95);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 0 rgba(41, 37, 34, 0.03);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.wine-card-media {
  align-items: center;
  aspect-ratio: auto;
  background: linear-gradient(180deg, #fff, #f7f1e7);
  display: flex;
  height: 260px;
  justify-content: center;
  padding: 0.7rem;
  position: relative;
}

.wine-card-media img {
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  width: 100%;
}

.promo-badge {
  background: var(--wine-700);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  left: 0.65rem;
  line-height: 1;
  padding: 0.36rem 0.48rem;
  position: absolute;
  top: 0.65rem;
}

.wine-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.38rem;
  padding: 0.72rem;
}

.wine-card h3 {
  color: var(--charcoal);
  display: -webkit-box;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 800;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.18;
  margin: 0;
  min-height: 2.32em;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.wine-card h3 a:hover {
  color: var(--wine-700);
}

.wine-winery,
.wine-origin {
  color: var(--gray);
  font-size: 0.76rem;
  line-height: 1.25;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wine-winery span::before {
  content: " · ";
}

.wine-origin {
  display: block;
}

.grape-pill {
  align-self: start;
  background: var(--cream);
  border-radius: 999px;
  color: var(--wine-700);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.28rem 0.48rem;
}

.rating-line,
.price-line {
  align-items: baseline;
  display: flex;
  gap: 0.25rem;
}

.rating-line {
  color: #c88426;
  font-size: 0.78rem;
}

.rating-line strong {
  color: var(--charcoal);
}

.rating-line small {
  color: var(--gray);
}

.rating-stars {
  color: #d19a2e;
  display: inline-flex;
  gap: 0.08rem;
  line-height: 1;
}

.rating-stars span {
  color: #d6d0c7;
}

.rating-stars .filled {
  color: #c88426;
}

.price-line {
  margin-top: auto;
}

.price-line strong {
  color: var(--wine-700);
  font-size: 1.12rem;
  font-weight: 900;
}

.price-line del {
  color: var(--gray);
  font-size: 0.82rem;
}

.card-actions {
  margin-top: 0.2rem;
}

.card-actions button,
.card-actions a {
  display: block;
  font-size: 0.76rem;
  min-height: 34px;
  padding: 0.45rem 0.55rem;
  text-align: center;
  width: 100%;
}

.card-action-row {
  align-items: stretch;
  display: grid;
  gap: 0.4rem;
  grid-template-columns: minmax(0, 1fr) 38px;
  margin-top: 0.2rem;
}

.card-action-row .card-actions {
  margin-top: 0;
}

.card-favorite {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--wine-700);
  display: inline-flex;
  height: 100%;
  justify-content: center;
  min-height: 34px;
  width: 100%;
}

.card-favorite svg,
.favorite-button svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 20px;
}

.card-favorite.active svg,
.favorite-button.active svg {
  fill: currentColor;
}

.site-footer {
  background: #241f1d;
  color: var(--cream);
  padding: 2.2rem 0 0;
}

.footer-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: 1.7fr repeat(5, 1fr);
}

.footer-brand p {
  color: rgba(247, 241, 231, 0.72);
  font-size: 0.9rem;
  max-width: 310px;
}

.footer-logo {
  color: var(--cream);
}

.footer-logo .brand-mark {
  color: var(--gold-muted);
}

.site-footer nav {
  display: grid;
  gap: 0.42rem;
}

.site-footer nav strong {
  color: #fff;
  font-size: 0.9rem;
}

.site-footer nav a {
  color: rgba(247, 241, 231, 0.72);
  font-size: 0.82rem;
}

.site-footer nav a:hover {
  color: #fff;
}

.footer-bottom {
  align-items: center;
  border-top: 1px solid rgba(247, 241, 231, 0.14);
  color: rgba(247, 241, 231, 0.72);
  display: flex;
  gap: 1rem;
  grid-column: 1 / -1;
  justify-content: space-between;
  margin-top: 0.9rem;
  padding: 0.9rem 0;
}

.footer-bottom span {
  color: var(--gold-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

@media (max-width: 1199px) {
  .header-actions {
    align-items: stretch;
    margin: 0.8rem 0 0;
  }

  .user-menu {
    align-self: start;
  }

  .header-search {
    max-width: none;
    min-width: 0;
    width: 100%;
  }

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

  .wine-card-media {
    height: 230px;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .topbar {
    font-size: 0.68rem;
  }

  .brand strong {
    font-size: 1.16rem;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    height: 31px;
    width: 31px;
  }

  .section-heading {
    align-items: start;
    display: grid;
    gap: 0.45rem;
  }

  .section-heading h2 {
    font-size: 1.75rem;
  }

  .wine-grid {
    display: flex;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.35rem;
    scroll-snap-type: x proximity;
  }

  .wine-card {
    flex: 0 0 min(210px, 76vw);
    scroll-snap-align: start;
  }

  .wine-card-media {
    height: 210px;
  }

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

  .footer-bottom {
    align-items: start;
    display: grid;
  }
}

@media (max-width: 430px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
