:root {
  --bg: #fff7ee;
  --surface: #ffffff;
  --surface-strong: #fff1df;
  --text: #2f261f;
  --muted: #74665c;
  --line: #ead9c7;
  --primary: #d56b45;
  --primary-dark: #a9472f;
  --accent: #316b5c;
  --shadow: 0 18px 45px rgba(70, 45, 28, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: rgba(255, 247, 238, 0.92);
  border-bottom: 1px solid rgba(234, 217, 199, 0.86);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  text-align: left;
}

.brand small,
.mini-store-hero small,
.order-card small {
  display: block;
  color: var(--muted);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: #fffaf4;
  font-weight: 800;
  letter-spacing: 0;
}

.top-actions,
.hero-actions,
.panel-actions,
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.link-btn,
.nav-pill {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-weight: 750;
  text-decoration: none;
}

.primary-btn {
  background: var(--primary);
  color: white;
  box-shadow: 0 8px 24px rgba(213, 107, 69, 0.22);
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.ghost-btn,
.link-btn {
  background: transparent;
  color: var(--text);
}

.link-btn {
  min-height: auto;
  padding: 6px 0;
  color: var(--primary-dark);
  border: 0;
}

.large {
  min-height: 52px;
  padding: 14px 20px;
}

.full {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.view {
  display: none;
  padding: clamp(20px, 4vw, 44px);
}

.view.active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.72fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
  min-height: calc(100vh - 88px);
  max-width: 1180px;
  margin: 0 auto;
}

.hero h1 {
  max-width: 780px;
  margin: 14px 0 18px;
  font-size: clamp(2.4rem, 6vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 650px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.7;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.trust-row span,
.store-badge {
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  font-weight: 750;
}

.phone-preview {
  width: min(100%, 390px);
  margin: 0 auto;
  padding: 14px;
  border: 10px solid #2c2420;
  border-radius: 30px;
  background: #fffaf4;
  box-shadow: var(--shadow);
}

.phone-status {
  width: 88px;
  height: 5px;
  margin: 4px auto 14px;
  border-radius: 999px;
  background: #2c2420;
}

.mini-store-hero {
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface-strong);
}

.mini-store-hero img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.mini-store-hero div {
  padding: 14px;
}

.mini-product {
  display: grid;
  grid-template-columns: 58px 1fr 38px;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.mini-product img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
}

.mini-product span {
  display: block;
  margin-top: 3px;
  color: var(--primary-dark);
  font-weight: 800;
}

.mini-product button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 0;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.mini-cart {
  margin-top: 12px;
  padding: 13px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  text-align: center;
  font-weight: 850;
}

.auth-view {
  min-height: calc(100vh - 76px);
  display: none;
  place-items: center;
}

.auth-view.active {
  display: grid;
}

.auth-card,
.panel-card,
.order-card {
  width: min(100%, 620px);
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card h2,
.workspace h2,
.section-header h2,
.catalog-header h2 {
  margin: 8px 0 20px;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.1;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: 0;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(213, 107, 69, 0.12);
}

.auth-card,
.panel-card form {
  display: grid;
  gap: 14px;
}

.auth-card > label,
.auth-card .two-cols {
  margin-bottom: 14px;
}

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

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

.workspace {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 24px;
  max-width: 1160px;
  margin: 0 auto;
}

.sidebar,
.dashboard-nav,
.live-preview,
.cart-panel,
.category-list {
  align-self: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.sidebar p {
  color: var(--muted);
  line-height: 1.6;
}

.steps {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 750;
}

.steps .done {
  color: var(--accent);
}

.steps .active {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 320px;
  gap: 20px;
  max-width: 1380px;
  margin: 0 auto;
}

.dashboard-nav {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 10px;
}

.nav-pill {
  text-align: left;
  background: transparent;
  color: var(--text);
  border-color: transparent;
}

.nav-pill.active {
  background: var(--text);
  color: #fff;
}

.dashboard-main,
.panel-section,
.product-admin-list,
.orders-grid,
.cart-items {
  display: grid;
  gap: 16px;
}

.panel-section {
  display: none;
}

.panel-section.active {
  display: grid;
}

.section-header {
  justify-content: space-between;
}

.panel-card.compact {
  width: 100%;
  box-shadow: none;
}

.product-admin-item {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-admin-item img {
  width: 82px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}

.product-admin-item p {
  margin: 5px 0 0;
  color: var(--muted);
}

.danger-btn {
  min-height: 38px;
  border: 1px solid #f1b1a2;
  border-radius: 8px;
  color: #9e3024;
  background: #fff0ed;
  font-weight: 800;
}

.order-card {
  width: 100%;
  display: grid;
  gap: 6px;
  box-shadow: none;
}

.live-preview {
  position: sticky;
  top: 92px;
}

.store-page {
  max-width: 1320px;
  margin: 0 auto;
}

.store-header {
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.store-cover {
  width: 100%;
  height: min(32vh, 330px);
  min-height: 210px;
  object-fit: cover;
}

.store-info {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 4vw, 34px);
}

.store-info h1 {
  margin: 14px 0 10px;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 0.95;
}

.store-info p {
  max-width: 680px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.store-info small {
  color: var(--accent);
  font-weight: 850;
}

.store-content {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 330px;
  gap: 18px;
  margin-top: 18px;
}

.category-list,
.cart-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 10px;
}

.category-btn {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  font-weight: 750;
}

.category-btn.active {
  background: var(--accent);
  color: #fff;
}

.catalog {
  min-width: 0;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 14px;
}

.catalog-header input {
  max-width: 270px;
}

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

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

.product-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.product-body h3 {
  margin: 0;
  font-size: 1.12rem;
}

.product-body p {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-row strong {
  color: var(--primary-dark);
  font-size: 1.12rem;
}

.cart-header,
.cart-line,
.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-line {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line span {
  color: var(--muted);
  font-size: 0.88rem;
}

.qty-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.qty-actions button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 900;
}

.cart-total {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 1.08rem;
}

.whatsapp-btn.disabled {
  pointer-events: none;
  opacity: 0.56;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: 360px;
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .dashboard-layout,
  .store-content {
    grid-template-columns: 1fr;
  }

  .dashboard-nav,
  .live-preview,
  .category-list,
  .cart-panel {
    position: static;
  }

  .dashboard-nav,
  .category-list {
    display: flex;
    flex-wrap: wrap;
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .phone-preview {
    width: 100%;
  }

  .two-cols,
  .form-grid,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .store-info,
  .catalog-header,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-header input {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .view {
    padding: 16px;
  }

  .topbar {
    padding: 12px 14px;
  }

  .brand small {
    display: none;
  }

  .top-actions .ghost-btn {
    display: none;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .product-admin-item {
    grid-template-columns: 64px 1fr;
  }

  .product-admin-item .danger-btn {
    grid-column: 1 / -1;
  }

  .product-card img {
    height: 180px;
  }
}
