:root {
  --ink: #171616;
  --muted: #69645f;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --line: #ddd8d0;
  --wine: #7b1e3a;
  --wine-dark: #561327;
  --teal: #106b68;
  --teal-dark: #084947;
  --rose: #f3d9dc;
  --gold: #b88b3a;
  --shadow: 0 18px 45px rgba(24, 23, 22, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

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

.announcement {
  min-height: 36px;
  padding: 0.55rem 1rem;
  color: #ffffff;
  background: var(--wine);
  text-align: center;
  font-size: 0.88rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem clamp(1rem, 3vw, 2.4rem);
  border-bottom: 1px solid rgba(23, 22, 22, 0.1);
  background: rgba(251, 250, 247, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.74rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.main-nav button,
.text-button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0.3rem 0.65rem;
}

.main-nav button:hover,
.main-nav button.active,
.text-button:hover {
  color: var(--wine);
}

.cart-button,
.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0.65rem 0.95rem;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.cart-button {
  justify-self: end;
  border-color: var(--ink);
  background: var(--surface);
}

.cart-button span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  margin-left: 0.35rem;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 0.78rem;
}

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

.primary-button:hover {
  background: var(--wine-dark);
  transform: translateY(-1px);
}

.secondary-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.ghost-button {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.ghost-button:hover {
  background: #ffffff;
  color: var(--ink);
}

.icon-button {
  width: 42px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
}

.full-button {
  width: 100%;
}

.hero {
  position: relative;
  display: grid;
  min-height: clamp(560px, 76vh, 760px);
  align-items: end;
  overflow: hidden;
  background-color: #2c2926;
  background-position: center;
  background-size: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 11, 11, 0.82), rgba(12, 11, 11, 0.24)),
    linear-gradient(0deg, rgba(12, 11, 11, 0.54), rgba(12, 11, 11, 0.04) 42%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, 92vw);
  padding: clamp(4rem, 9vw, 8rem) clamp(1rem, 6vw, 5rem) 8.5rem;
  color: #ffffff;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--wine);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f6c6cc;
}

.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 8vw, 7.6rem);
  line-height: 0.95;
  font-weight: 500;
}

.hero-subtitle {
  max-width: 620px;
  margin: 1.1rem 0 1.6rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.hero-actions,
.section-tools,
.card-actions,
.form-actions,
.admin-actions,
.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.hero-strip {
  position: absolute;
  right: clamp(1rem, 4vw, 3rem);
  bottom: 1.2rem;
  left: clamp(1rem, 4vw, 3rem);
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.hero-strip span {
  min-height: 58px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  backdrop-filter: blur(10px);
}

.section-band {
  padding: clamp(2.8rem, 7vw, 5.5rem) clamp(1rem, 4vw, 3rem);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto 1.5rem;
}

.section-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 500;
}

.collection-grid,
.product-grid,
.account-grid,
.metric-grid,
.report-grid {
  display: grid;
  max-width: 1280px;
  margin: 0 auto;
  gap: 1rem;
}

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

.collection-tile {
  position: relative;
  display: grid;
  min-height: 230px;
  align-items: end;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: #222;
  color: #ffffff;
  text-align: left;
}

.collection-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.collection-tile:hover img {
  transform: scale(1.04);
}

.collection-tile::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.08));
}

.collection-tile span {
  position: relative;
  z-index: 1;
  display: block;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.store-layout {
  background: #ffffff;
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, minmax(130px, 1fr));
  gap: 0.85rem;
  max-width: 1280px;
  margin: 0 auto 1.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
}

label {
  display: grid;
  gap: 0.38rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 0.62rem 0.72rem;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(16, 107, 104, 0.24);
  outline-offset: 2px;
}

.result-count {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.product-card,
.panel-form,
.panel-list,
.metric-card,
.admin-panel,
.table-shell,
.report-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.product-card {
  overflow: hidden;
}

.product-image-wrap {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #efefea;
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stock-badge,
.flag-badge,
.role-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0.24rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 800;
}

.stock-badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--teal-dark);
}

.stock-badge.low {
  color: var(--wine);
}

.stock-badge.out {
  color: #777;
}

.wishlist-button {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: grid;
  min-width: 58px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(23, 22, 22, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--wine);
  padding: 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.product-body {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.product-body h3,
.panel-form h3,
.panel-list h3,
.modal h2,
.drawer-head h2,
.admin-panel h3,
.report-card h3 {
  margin: 0;
}

.price-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  font-weight: 900;
}

.price-line del {
  color: var(--muted);
  font-weight: 500;
}

.variant-dots {
  display: flex;
  gap: 0.35rem;
}

.variant-dot {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(23, 22, 22, 0.25);
  border-radius: 999px;
}

.empty-state {
  padding: 2rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.account-grid {
  grid-template-columns: minmax(260px, 0.9fr) repeat(3, minmax(0, 1fr));
  align-items: start;
}

.panel-form,
.panel-list {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.checkbox-line {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.checkbox-line input {
  width: auto;
  min-height: auto;
}

.inline-form,
.coupon-form,
.tracking-form {
  display: flex;
  gap: 0.65rem;
}

.inline-form input,
.coupon-form input,
.tracking-form input {
  min-width: 0;
}

.mini-list {
  display: grid;
  gap: 0.6rem;
}

.mini-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
}

.mini-item strong {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.tracking-form,
.tracking-result {
  max-width: 880px;
  margin: 0 auto;
}

.tracking-result {
  margin-top: 1rem;
}

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

.timeline-step {
  min-height: 72px;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline-step.active {
  border-color: var(--teal);
  background: rgba(16, 107, 104, 0.08);
  color: var(--teal-dark);
  font-weight: 800;
}

.admin-layout {
  background: #f2f5f3;
}

.role-picker {
  width: min(260px, 100%);
}

.admin-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
}

.admin-tabs {
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.admin-tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  padding: 0.7rem 0.8rem;
}

.admin-tabs button.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.admin-panel {
  min-height: 520px;
  padding: 1.2rem;
  overflow: hidden;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.metric-card,
.report-card {
  padding: 1rem;
}

.metric-card span,
.report-card span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.metric-card strong,
.report-card strong {
  display: block;
  margin-top: 0.3rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.table-shell {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #fbfaf7;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td .secondary-button,
td .primary-button {
  min-height: 34px;
  padding: 0.35rem 0.55rem;
}

.flag-badge {
  background: var(--rose);
  color: var(--wine-dark);
}

.role-badge {
  background: rgba(16, 107, 104, 0.12);
  color: var(--teal-dark);
}

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

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  width: min(420px, 100vw);
  height: 100vh;
  padding: 1rem;
  transform: translateX(105%);
  transition: transform 180ms ease;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cart-drawer.open {
  transform: translateX(0);
}

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

.cart-items {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  overflow-y: auto;
  padding: 1rem 0;
}

.cart-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.cart-line img {
  width: 72px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius);
}

.cart-line-body {
  display: grid;
  gap: 0.45rem;
}

.quantity-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.quantity-row button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.coupon-form {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.cart-summary {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem 0 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.summary-row.total {
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  font-size: 1.12rem;
  font-weight: 900;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(0, 0, 0, 0.36);
}

.scrim.open {
  display: block;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 50;
  display: none;
  width: min(980px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  transform: translate(-50%, -50%);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal.open {
  display: block;
}

.modal-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1fr);
}

.modal-image {
  min-height: 540px;
  background: #eeeeea;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: 1.2rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

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

.checkout-shell {
  padding: 1.2rem;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  margin-top: 1rem;
}

.checkout-summary {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: #fbfaf7;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  display: none;
  max-width: min(380px, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.toast.show {
  display: block;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: space-between;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  background: #161616;
  color: #ffffff;
}

.site-footer p {
  max-width: 620px;
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.social-links a {
  color: #ffffff;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .filters,
  .product-grid,
  .account-grid,
  .metric-grid,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .admin-tabs button {
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .hero {
    min-height: 660px;
  }

  .hero-content {
    padding-bottom: 14rem;
  }

  .hero-strip,
  .filters,
  .product-grid,
  .account-grid,
  .metric-grid,
  .report-grid,
  .checkout-grid,
  .modal-shell,
  .option-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .hero-strip {
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
  }

  .hero-strip span {
    min-height: auto;
    padding: 0.75rem;
  }

  .section-head {
    align-items: start;
  }

  .inline-form,
  .coupon-form,
  .tracking-form {
    display: grid;
  }

  .modal-image {
    min-height: 360px;
  }

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