:root {
  color-scheme: light;
  --ink: #24212a;
  --muted: #756f79;
  --line: #e2d9d2;
  --paper: #ffffff;
  --paper-soft: #fffaf5;
  --back: #f8f2ec;
  --brand: #8a2d45;
  --brand-dark: #5b1f33;
  --accent: #7b7f36;
  --accent-soft: #fff0e9;
  --success-soft: #edf8ef;
  --shadow: 0 16px 34px rgba(76, 43, 35, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(138, 45, 69, 0.1), transparent 28rem),
    linear-gradient(180deg, #fffafd 0%, var(--back) 46%, #f4f7fb 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

select {
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

button,
.primary-button,
.ghost-button {
  align-items: center;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
}

button,
.primary-button {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 8px 18px rgba(138, 45, 69, 0.18);
  color: white;
}

button:hover,
.primary-button:hover {
  filter: brightness(1.04);
}

.ghost-button {
  align-items: center;
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: white;
  display: inline-flex;
  justify-content: center;
}

input {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(138, 45, 69, 0.14);
  outline: 0;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.landing,
.dashboard,
.storefront {
  margin: 0 auto;
  max-width: 1280px;
  padding: 24px;
}

.admin-hero,
.store-hero {
  background: linear-gradient(115deg, rgba(91, 31, 51, 0.93), rgba(36, 33, 42, 0.86), rgba(123, 127, 54, 0.72)), url("https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: white;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  min-height: 250px;
  padding: 40px;
}

.admin-hero h1,
.store-hero h1 {
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
  margin: 0 0 14px;
  max-width: 790px;
}

.admin-hero p,
.store-hero p {
  font-size: 18px;
  line-height: 1.55;
  margin: 0;
  max-width: 720px;
}

.eyebrow {
  color: #ffd7c7;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.notice {
  background: var(--success-soft);
  border: 1px solid #b7e2bd;
  border-radius: 7px;
  font-weight: 700;
  margin: 18px 0;
  padding: 12px 14px;
}

.admin-layout {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(280px, 360px) 1fr;
  margin-top: 24px;
}

.provision-form,
.tables section,
.cart-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(76, 43, 35, 0.07);
  padding: 18px;
}

.provision-form {
  display: grid;
  gap: 14px;
}

h2 {
  font-size: 20px;
  margin: 0 0 14px;
}

table {
  border-collapse: collapse;
  font-size: 14px;
  width: 100%;
}

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

td span,
td a {
  display: block;
  margin-top: 4px;
}

.tables {
  display: grid;
  gap: 18px;
  min-width: 0;
  overflow-x: auto;
}

.storefront {
  display: grid;
  gap: 24px;
}

.store-body {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 360px;
}

.landing {
  display: grid;
  gap: 28px;
}

.landing-hero {
  align-items: stretch;
  background: linear-gradient(115deg, rgba(91, 31, 51, 0.94), rgba(36, 33, 42, 0.9), rgba(123, 127, 54, 0.72)), url("https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: white;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.75fr);
  min-height: 520px;
  overflow: hidden;
  padding: 48px;
}

.landing-copy {
  align-self: center;
}

.landing-copy h1 {
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.96;
  margin: 0 0 18px;
  max-width: 850px;
}

.landing-copy p {
  font-size: 19px;
  line-height: 1.58;
  margin: 0;
  max-width: 700px;
}

.landing-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.landing-actions span {
  color: #ffe7dc;
  font-size: 14px;
  font-weight: 800;
}

.hero-collage {
  align-self: stretch;
  display: grid;
  gap: 16px;
  grid-template-rows: 1fr 0.72fr;
  min-height: 380px;
}

.hero-collage img {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.24);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.hero-collage img:first-child {
  transform: translateY(10px);
}

.hero-collage img:last-child {
  justify-self: end;
  width: 82%;
}

.landing-band {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-band article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(76, 43, 35, 0.07);
  overflow: hidden;
}

.landing-band img {
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  width: 100%;
}

.landing-band h2 {
  margin: 18px 18px 8px;
}

.landing-band p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 18px 20px;
}

.catalog-grid {
  display: grid;
  gap: 18px;
}

.price-catalogs {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.price-catalog-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(76, 43, 35, 0.08);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font: inherit;
  overflow: hidden;
  padding: 0;
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.price-catalog-card:hover,
.price-catalog-card.active {
  border-color: var(--brand);
  box-shadow: 0 16px 32px rgba(76, 43, 35, 0.13);
  transform: translateY(-2px);
}

.price-catalog-card img {
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  width: 100%;
}

.price-catalog-body {
  display: grid;
  gap: 7px;
  padding: 16px;
}

.price-catalog-body strong {
  font-size: 21px;
}

.price-catalog-body span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.price-catalog-body span:last-child {
  color: var(--brand);
}

.catalog-tools {
  align-items: end;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr minmax(170px, 230px) minmax(170px, 220px) auto;
  padding: 14px;
}

.catalog-tools span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  padding-bottom: 12px;
  white-space: nowrap;
}

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

.load-more {
  justify-self: center;
  min-width: 180px;
}

.product-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(76, 43, 35, 0.08);
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.product-card:hover {
  box-shadow: 0 16px 32px rgba(76, 43, 35, 0.13);
  transform: translateY(-2px);
}

.product-card img {
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  width: 100%;
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.product-body h2 {
  margin: 0;
}

.product-body p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.product-meta {
  color: var(--accent);
  display: flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: space-between;
  text-transform: uppercase;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.tiers li {
  background: var(--accent-soft);
  border-radius: 7px;
  color: #744115;
  font-size: 13px;
  padding: 7px 9px;
}

.buy-row,
.otp-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
}

.buy-row {
  grid-template-columns: 1fr auto auto;
}

.share-button,
.ghost-action {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 7px;
  color: var(--brand-dark);
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
}

.product-video {
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  margin-top: 10px;
  width: 100%;
}

.cart-panel {
  position: sticky;
  top: 20px;
}

.cart-head,
.cart-total {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.cart-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.cart-items {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.cart-line {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 82px auto;
  padding-bottom: 10px;
}

.cart-line span,
.muted {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.cart-line button {
  background: #c2415d;
  box-shadow: 0 8px 18px rgba(194, 65, 93, 0.16);
}

.cart-total {
  border-top: 2px solid var(--ink);
  font-size: 18px;
  padding-top: 14px;
}

.tier-progress,
.minimum-order {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  margin: 12px 0;
}

.progress-track {
  background: #eadfd7;
  border-radius: 999px;
  height: 9px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-track span {
  background: linear-gradient(135deg, var(--accent), var(--brand));
  display: block;
  height: 100%;
}

.checkout-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.checkout-result {
  color: var(--brand-dark);
  font-weight: 800;
  line-height: 1.45;
  margin-top: 12px;
}

.sticky-actions {
  bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 18px));
  display: flex;
  gap: 10px;
  position: fixed;
  right: 18px;
  z-index: 20;
}

.sticky-actions .primary-button,
.sticky-actions .ghost-action {
  box-shadow: 0 12px 28px rgba(36, 33, 42, 0.2);
}

.store-footer {
  background: var(--ink);
  border-radius: 8px;
  color: white;
  display: grid;
  gap: 22px;
  grid-template-columns: 1.2fr 1fr 1.3fr;
  margin-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  padding: 28px;
}

.store-footer h2,
.store-footer h3,
.store-footer p {
  margin: 0;
}

.store-footer h2 {
  font-size: 28px;
}

.store-footer h3 {
  color: #ffe7dc;
  font-size: 14px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.store-footer p,
.store-footer a,
.powered-by {
  color: rgba(255, 255, 255, 0.78);
  display: block;
  line-height: 1.55;
}

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

.footer-links a {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 10px;
}

.powered-by {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  grid-column: 1 / -1;
  padding-top: 14px;
}

.no-results {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  justify-items: start;
  padding: 18px;
}

.admin-page,
.admin-login {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 1280px;
  padding: 24px;
}

.admin-login {
  align-items: start;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  min-height: 100vh;
  place-content: center;
}

.admin-top {
  align-items: end;
  background: linear-gradient(115deg, rgba(91, 31, 51, 0.94), rgba(36, 33, 42, 0.9));
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: white;
  display: flex;
  justify-content: space-between;
  padding: 30px;
}

.admin-top h1 {
  font-size: clamp(32px, 5vw, 56px);
  margin: 0 0 10px;
}

.admin-top p {
  margin: 0;
}

.admin-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 360px;
}

.admin-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(76, 43, 35, 0.07);
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  min-height: 88px;
  padding: 9px 11px;
  width: 100%;
}

textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(138, 45, 69, 0.14);
  outline: 0;
}

.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-products {
  display: grid;
  gap: 10px;
}

.admin-product {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.admin-product summary {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.admin-product summary span {
  color: var(--muted);
  font-size: 13px;
}

.admin-product form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.danger-button {
  background: #c2415d;
  justify-self: start;
}

.empty {
  display: grid;
  min-height: 80vh;
  place-content: center;
  text-align: center;
}

@media (max-width: 980px) {
  .landing-hero,
  .admin-grid,
  .admin-login,
  .admin-layout,
  .store-body {
    grid-template-columns: 1fr;
  }

  .landing-band {
    grid-template-columns: 1fr;
  }

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

  .cart-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .dashboard,
  .landing,
  .storefront {
    padding: 14px;
  }

  .storefront {
    gap: 18px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  }

  .landing-hero,
  .admin-hero,
  .store-hero {
    display: block;
    min-height: 0;
    padding: 20px;
  }

  .store-hero h1 {
    font-size: 38px;
    line-height: 1.02;
    margin-bottom: 12px;
  }

  .store-hero p {
    font-size: 16px;
    line-height: 1.45;
  }

  .store-hero .ghost-button {
    margin-top: 16px;
    width: 100%;
  }

  .hero-collage {
    margin-top: 28px;
    min-height: 0;
  }

  .hero-collage img,
  .hero-collage img:last-child {
    height: 210px;
    transform: none;
    width: 100%;
  }

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

  .catalog-tools {
    grid-template-columns: 1fr;
  }

  .price-catalogs {
    display: flex;
    gap: 10px;
    margin-left: -14px;
    margin-right: -14px;
    overflow-x: auto;
    padding: 0 14px 2px;
    scroll-padding: 14px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .price-catalog-card {
    flex: 0 0 min(78vw, 285px);
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 104px;
    scroll-snap-align: start;
  }

  .price-catalog-card:hover,
  .price-catalog-card.active {
    transform: none;
  }

  .price-catalog-card img {
    aspect-ratio: auto;
    height: 100%;
  }

  .price-catalog-body {
    align-content: center;
    gap: 5px;
    padding: 12px;
  }

  .price-catalog-body strong {
    font-size: 16px;
    line-height: 1.15;
  }

  .price-catalog-body span {
    font-size: 12px;
  }

  .catalog-tools span {
    padding-bottom: 0;
  }

  .product-list {
    grid-template-columns: 1fr;
  }

  .cart-line {
    grid-template-columns: 1fr;
  }

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

  .sticky-actions {
    background: linear-gradient(180deg, rgba(248, 242, 236, 0), rgba(248, 242, 236, 0.96) 28%);
    bottom: max(34px, calc(env(safe-area-inset-bottom, 0px) + 24px));
    gap: 8px;
    left: 0;
    padding: 18px 10px 0;
    right: 0;
  }

  .sticky-actions a {
    flex: 1;
    min-width: 0;
  }

  .store-footer {
    margin-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }
}
