:root {
  --accent: #ad2b2b;
  --accent-dark: #8f2222;
  --ink: #251b17;
  --muted: #756b64;
  --paper: #f4f1ec;
  --surface: #fffaf3;
  --line: #e2d9cf;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.app {
  min-height: 100vh;
  padding: 24px clamp(14px, 4vw, 48px) 110px;
}

.store-header {
  max-width: 1580px;
  margin: 0 auto 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(37, 27, 23, 0.08);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: var(--accent);
  color: #fff;
}

.logos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.logos img {
  height: 48px;
  width: auto;
  max-width: 170px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  padding: 6px 10px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.header-actions a,
.header-actions button {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  padding: 9px 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.store-header h1 {
  margin: 0;
  padding: 22px 28px 8px;
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search {
  display: block;
  padding: 12px 28px 26px;
}

.search span,
.field span,
.quantity span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search input,
.field select,
.quantity input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 18px;
  outline: none;
}

.category-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1580px;
  margin: 0 auto 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 236, 0.96);
  padding: 14px 0;
  backdrop-filter: blur(10px);
}

.category-bar a,
.mobile-category-menu a {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 10px 18px;
  box-shadow: 0 8px 20px rgba(37, 27, 23, 0.08);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.catalog {
  max-width: 1580px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  padding: clamp(18px, 3vw, 34px);
}

.category-section {
  scroll-margin-top: 96px;
  margin-bottom: 58px;
}

.section-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  margin-bottom: 28px;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  text-align: center;
}

.section-banner img {
  max-height: 72px;
  max-width: min(300px, 80vw);
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
  padding: 8px 16px;
}

.section-banner h2 {
  margin: 12px 0 0;
  font-size: clamp(1.6rem, 3vw, 3rem);
  font-family: Georgia, serif;
  font-weight: 500;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink);
}

.section-heading::before,
.section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  font-family: Georgia, serif;
  font-weight: 500;
}

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

.product-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 14px 28px rgba(37, 27, 23, 0.07);
}

.product-media {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #faf2e6, #ece1cf);
  padding: 14px;
}

.product-media img {
  width: 100%;
  height: 260px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  object-fit: contain;
}

.product-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.product-info h2 {
  overflow-wrap: anywhere;
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(1.55rem, 2.1vw, 2.3rem);
  font-weight: 500;
  line-height: 1.05;
}

.selected-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 14px;
}

.selected-box span,
.selected-box small {
  display: block;
  color: var(--muted);
}

.selected-box b {
  display: block;
  margin-top: 8px;
  font-size: 1.25rem;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.option[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.option:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.swatch {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
}

.stock-line {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.add-button,
.stripe-button,
.checkout-button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.add-button:disabled,
.stripe-button:disabled,
.checkout-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.stripe-button {
  background: #635bff;
}

.stripe-button[hidden] {
  display: none;
}

.cart {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: min(380px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 46px rgba(37, 27, 23, 0.16);
  padding: 14px;
  backdrop-filter: blur(12px);
}

.cart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cart-summary button {
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cart-body {
  margin-top: 14px;
}

.cart-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
  margin-bottom: 10px;
}

.cart-item strong {
  display: block;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.cart-controls button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  min-width: 32px;
  min-height: 32px;
}

.cart-note,
.cart-error {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.cart-error {
  color: var(--accent-dark);
  font-weight: 800;
}

.mobile-category-button,
.mobile-category-menu {
  display: none;
}

.inventory-shell {
  max-width: 1580px;
  margin: 0 auto;
}

.inventory-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fffaf3;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 18px 40px rgba(37, 27, 23, 0.08);
}

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

.inventory-header h2 {
  margin: 6px 0 0;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
}

.inventory-header p {
  margin: 8px 0;
  color: var(--muted);
}

.inventory-header strong {
  display: block;
  color: var(--accent);
  font-size: 0.95rem;
}

.inventory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inventory-actions button {
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inventory-actions a,
.inventory-footer-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inventory-actions .primary-action,
.inventory-footer-actions .primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.inventory-actions .primary-action:disabled,
.inventory-footer-actions .primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.inventory-actions.secondary button {
  border-color: var(--line);
  color: var(--muted);
}

.inventory-note {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff7ed;
  color: #8a3f12;
  padding: 14px 16px;
  font-weight: 700;
}

.inventory-gate {
  max-width: 560px;
  margin: 0 auto;
}

.inventory-gate-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fffaf3;
  padding: clamp(22px, 4vw, 34px);
  box-shadow: 0 18px 40px rgba(37, 27, 23, 0.08);
}

.inventory-gate-card h2 {
  margin: 8px 0;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
}

.inventory-gate-card p {
  color: var(--muted);
}

.inventory-gate-card label {
  display: block;
  margin-top: 16px;
}

.inventory-gate-card label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inventory-gate-card input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
}

.inventory-gate-card button {
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#inventory-login-message {
  color: var(--accent);
  font-weight: 800;
}

.inventory-locked .inventory-panel,
.inventory-locked .inventory-search-wrap {
  display: none;
}

body:not(.inventory-locked) .inventory-gate {
  display: none;
}

.inventory-login {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 210px) minmax(150px, 210px) auto;
  align-items: end;
  gap: 14px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
}

.inventory-login h3,
.inventory-login p {
  margin: 4px 0 0;
}

.inventory-login p {
  color: var(--muted);
}

.inventory-login label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inventory-login input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
}

.inventory-login button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  min-height: 42px;
  padding: 0 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.inventory-list-shell {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  padding: 18px;
}

.inventory-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.inventory-list-header h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.75rem;
  font-weight: 500;
}

.inventory-list-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.inventory-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.inventory-product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 16px;
}

.inventory-product-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.inventory-product-heading p {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.inventory-product-heading h4 {
  overflow-wrap: anywhere;
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.1;
}

.inventory-product-heading span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.inventory-variants {
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.inventory-variant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.inventory-variant-row:last-child {
  border-bottom: 0;
}

.inventory-variant-row strong,
.inventory-variant-row small {
  display: block;
}

.inventory-variant-row strong {
  font-size: 0.92rem;
}

.inventory-variant-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.inventory-variant-row input {
  width: 92px;
  border: 2px solid var(--accent);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  text-align: center;
  font-weight: 900;
}

.inventory-variant-row.is-sold-out {
  background: #f5f5f5;
  color: #777;
}

.inventory-variant-row.is-low-stock {
  background: #fff7ed;
}

.inventory-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

@media (max-width: 980px) {
  .app {
    padding: 18px 14px 120px;
  }

  .brand-row {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .logos img {
    height: 38px;
    max-width: 132px;
  }

  .header-actions a,
  .header-actions button {
    padding: 8px 11px;
    font-size: 0.74rem;
  }

  .store-header h1,
  .search {
    padding-left: 16px;
    padding-right: 16px;
  }

  .category-bar {
    position: static;
    display: flex;
    gap: 8px;
  }

  .category-bar a {
    padding: 8px 12px;
    font-size: 0.72rem;
  }

  .catalog {
    padding: 14px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card {
    grid-template-columns: 1fr;
    gap: 12px;
    border-radius: 18px;
    padding: 10px;
  }

  .product-media {
    padding: 8px;
  }

  .product-media img {
    height: 150px;
  }

  .product-info {
    gap: 10px;
  }

  .product-info h2 {
    font-size: 1.2rem;
  }

  .selected-box {
    padding: 10px;
    font-size: 0.84rem;
  }

  .option {
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  .add-button {
    padding: 11px 10px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
  }

  .mobile-category-button {
    display: block;
    position: fixed;
    left: 14px;
    bottom: 20px;
    z-index: 50;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    padding: 12px 16px;
    box-shadow: 0 12px 26px rgba(37, 27, 23, 0.22);
    font-weight: 900;
  }

  .mobile-category-menu {
    position: fixed;
    left: 14px;
    bottom: 74px;
    z-index: 50;
    display: grid;
    gap: 8px;
  }

  .mobile-category-menu[hidden] {
    display: none;
  }

  .cart {
    right: 10px;
    bottom: 10px;
    width: min(300px, calc(100vw - 28px));
  }

  .inventory-header,
  .inventory-list-header,
  .inventory-login {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-login {
    display: flex;
  }

  .inventory-groups {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 981px) and (max-width: 1300px) {
  .inventory-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  .store-header,
  .inventory-note,
  .inventory-actions,
  .inventory-footer-actions {
    display: none;
  }

  .app {
    padding: 0;
  }

  .inventory-list-shell,
  .inventory-panel {
    box-shadow: none;
  }
}

@media (max-width: 520px) {
  .product-grid {
    gap: 10px;
  }

  .product-card {
    padding: 8px;
  }

  .product-media img {
    height: 120px;
  }

  .product-info h2 {
    font-size: 1.05rem;
  }
}
