:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --panel: #fffdfa;
  --ink: #101522;
  --muted: #687083;
  --line: #e3ddd3;
  --brand: #101522;
  --brand-dark: #070a12;
  --accent: #d9af58;
  --accent-strong: #f4c96c;
  --teal: #0f766e;
  --coral: #d95b43;
  --soft: #f7f3ea;
  --danger: #b42318;
  --shadow: 0 24px 60px rgba(16, 21, 34, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(217, 175, 88, 0.18) 0%, rgba(244, 240, 232, 0) 34%),
    linear-gradient(225deg, rgba(15, 118, 110, 0.12) 0%, rgba(244, 240, 232, 0) 38%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px clamp(14px, 4vw, 48px);
  background: rgba(255, 252, 246, 0.9);
  border-bottom: 1px solid rgba(16, 21, 34, 0.08);
  box-shadow: 0 12px 34px rgba(16, 21, 34, 0.08);
  backdrop-filter: blur(16px);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--teal), #5b6ee1, var(--coral));
}

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

.brand-logo {
  width: 96px;
  height: 66px;
  object-fit: contain;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-button,
.cart-button,
.primary-button,
.whatsapp-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}

.ghost-button {
  border: 1px solid rgba(16, 21, 34, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(16, 21, 34, 0.05);
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #101522, #1d2435);
  color: #fff;
  box-shadow: 0 14px 28px rgba(16, 21, 34, 0.22);
}

.cart-button strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: var(--ink);
}

.shop-head {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  background: #080d18;
  color: #fff;
}

.shop-head::after {
  display: none;
}

.hero-banner-img {
  display: block;
  width: 100%;
  height: auto;
}

.shop-head > .hero-banner-img + div {
  position: relative;
  display: block;
  min-height: 82px;
  padding: 19px calc(clamp(14px, 4vw, 48px) + min(360px, 29vw) + 22px) 17px clamp(14px, 4vw, 48px);
  background: #080d18;
  white-space: nowrap;
  overflow: hidden;
}

.shop-head > .hero-banner-img + div .eyebrow {
  display: none;
}

.shop-head > .hero-banner-img + div h1 {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  font-size: clamp(21px, 2.08vw, 29px);
  line-height: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 0;
  color: inherit;
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.05;
}

.shop-copy {
  max-width: 660px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.shop-tools {
  position: absolute;
  right: clamp(14px, 4vw, 48px);
  bottom: 12px;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: min(360px, calc(100% - 28px));
  margin-left: auto;
  margin-right: 0;
}

.shop-head:has(.hero-banner-img) .shop-tools {
  bottom: 9px;
}

.search-box,
.field {
  display: grid;
  gap: 7px;
}

.search-box span,
.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.shop-head .search-box span {
  color: rgba(255, 255, 255, 0.78);
}

.search-box input,
.search-box select,
.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(16, 21, 34, 0.11);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.shop-head .search-box input {
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
}

.shop-head .search-box input::placeholder {
  color: #7b8497;
}

.search-box input:focus,
.search-box select:focus,
.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 175, 88, 0.22);
}

.catalog-wrap {
  padding: 18px clamp(14px, 4vw, 48px) 58px;
}

.brand-tabs {
  position: sticky;
  top: 76px;
  z-index: 9;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0 16px;
  background: rgba(244, 240, 232, 0.9);
  border-bottom: 1px solid rgba(16, 21, 34, 0.09);
  backdrop-filter: blur(10px);
  scrollbar-width: thin;
}

.brand-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  white-space: nowrap;
  border: 1px solid rgba(16, 21, 34, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--tone-a, #111827) 42%, #fff), color-mix(in srgb, var(--tone-b, #d9af58) 36%, #fff)) border-box;
  color: var(--ink);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(16, 21, 34, 0.06);
}

.brand-tab span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone-b, #d9af58) 18%, #f7f3ea);
  color: var(--muted);
  font-size: 11px;
}

.brand-tab.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--tone-a, #101522), var(--tone-b, #d9af58));
  color: #fff;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--tone-a, #101522) 28%, transparent);
}

.brand-tab.is-active span {
  background: var(--accent-strong);
  color: var(--ink);
}

.catalog-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 16px;
  color: var(--muted);
  font-weight: 800;
}

.admin-link {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
  text-decoration: none;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
  gap: 18px;
}

.product-card {
  display: grid;
  min-height: 348px;
  overflow: hidden;
  border: 1px solid rgba(16, 21, 34, 0.08);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(16, 21, 34, 0.1);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--tone-b, #d9af58) 46%, #fff);
  box-shadow: 0 24px 46px rgba(16, 21, 34, 0.16);
}

.product-image {
  position: relative;
  display: grid;
  height: 164px;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.72), transparent 32%),
    linear-gradient(135deg, color-mix(in srgb, var(--tone-a, #0f766e) 16%, #f9fafb), color-mix(in srgb, var(--tone-b, #d9af58) 22%, #ffffff));
}

.product-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone-a, #0f766e) 22%, transparent), transparent 55%);
  opacity: 0.42;
}

.product-image img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.stock-pill {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(16, 21, 34, 0.88);
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 15px;
  border-top: 4px solid var(--tone-b, var(--accent));
}

.category {
  width: fit-content;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone-b, #d9af58) 17%, #fff);
  color: color-mix(in srgb, var(--tone-a, #101522) 74%, #111827);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.product-card h3 {
  min-height: 45px;
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.price {
  color: color-mix(in srgb, var(--tone-a, #101522) 82%, #111827);
  font-size: 21px;
  font-weight: 950;
}

.buy-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  align-items: center;
}

.quantity-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(16, 21, 34, 0.11);
  border-radius: 8px;
  padding: 0 10px;
  cursor: text;
}

.primary-button {
  background: linear-gradient(135deg, var(--tone-a, #101522), color-mix(in srgb, var(--tone-a, #101522) 72%, #000));
  color: #fff;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--tone-a, #101522) 26%, transparent);
}

.primary-button:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone-b, #d9af58) 35%, var(--tone-a, #101522)), var(--tone-a, #101522));
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #a9b7b3;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  background: rgba(16, 21, 34, 0.46);
}

.drawer.is-open {
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(460px, 100%);
  height: 100%;
  background: #fffdfa;
  box-shadow: var(--shadow);
}

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

.drawer-head h2 {
  margin: 0;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 24px;
}

.cart-list {
  overflow: auto;
  padding: 10px 24px;
}

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

.cart-item strong {
  display: block;
  margin-bottom: 4px;
}

.cart-item small {
  color: var(--muted);
}

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

.cart-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.cart-footer {
  display: grid;
  gap: 14px;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line);
}

.seller-choices {
  display: grid;
  gap: 10px;
}

.seller-choice {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(16, 21, 34, 0.1);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.seller-choice:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 12px 24px rgba(217, 175, 88, 0.18);
  transform: translateY(-1px);
}

.seller-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seller-check {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #c7c0b3;
  border-radius: 6px;
  background: #fff;
}

.seller-choice input:checked + .seller-check {
  border-color: #169b58;
  background: #169b58;
}

.seller-choice input:checked + .seller-check::after {
  content: "";
  width: 8px;
  height: 5px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.seller-choice strong,
.seller-choice small {
  display: block;
}

.seller-choice small,
.seller-empty {
  color: var(--muted);
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 18px;
}

.whatsapp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #169b58, #0f7a46);
  color: #fff;
}

.whatsapp-logo {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}

.modal {
  width: min(430px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(16, 21, 34, 0.46);
}

.modal-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 24px;
}

.product-modal {
  width: min(920px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  box-shadow: var(--shadow);
}

.product-modal::backdrop {
  background: rgba(16, 21, 34, 0.58);
  backdrop-filter: blur(5px);
}

.product-modal-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 1.05fr);
  overflow: hidden;
  border-radius: 8px;
  background: #fffdfa;
}

.product-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.9);
}

.product-modal-image {
  position: relative;
  min-height: 440px;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.7), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--tone-a, #0f766e) 18%, #f9fafb), color-mix(in srgb, var(--tone-b, #d9af58) 25%, #ffffff));
}

.product-modal-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone-a, #0f766e) 24%, transparent), transparent 60%);
  opacity: 0.44;
}

.product-modal-image img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-modal-info {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(24px, 4vw, 44px);
  border-left: 5px solid var(--tone-b, var(--accent));
}

.product-modal-info h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.modal-price {
  color: color-mix(in srgb, var(--tone-a, #101522) 82%, #111827);
  font-size: 28px;
}

.product-modal-info p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-line;
}

.modal-buy-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  margin-top: 6px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-right: 48px;
}

.tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-weight: 800;
}

.tab.is-active {
  border-color: var(--accent);
  background: #fff7e5;
  color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.hidden {
  display: none !important;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  display: none;
  transform: translateX(-50%);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ink), #263149);
  color: #fff;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.is-visible {
  display: block;
}

@media (max-width: 760px) {
  .topbar {
    align-items: center;
    padding: 14px;
  }

  .brand-logo {
    width: 76px;
    height: 54px;
  }

  .nav-actions {
    gap: 6px;
  }

  .ghost-button,
  .cart-button {
    padding: 0 11px;
  }

  .shop-head {
    min-height: 0;
  }

  .shop-head::after {
    display: none;
  }

  .shop-tools {
    grid-template-columns: 1fr;
    position: static;
    width: calc(100% - 28px);
    margin: 10px 14px 12px;
    padding-top: 0;
  }

  .catalog-wrap {
    padding: 0 14px 34px;
  }

  .catalog-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-tabs {
    top: 73px;
    margin-inline: -14px;
    padding-inline: 14px;
  }

  h1 {
    max-width: none;
    font-size: 24px;
  }

  .shop-head > .hero-banner-img + div {
    min-height: 58px;
    padding: 10px 14px;
  }

  .shop-head > .hero-banner-img + div h1 {
    font-size: 21px;
    white-space: normal;
    line-height: 1.12;
  }

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

  .product-modal-image {
    min-height: 270px;
  }

  .product-modal-info {
    border-left: 0;
    border-top: 5px solid var(--tone-b, var(--accent));
  }

  .modal-buy-row {
    grid-template-columns: 78px 1fr;
  }
}
