:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #fff7ed;
  --text: #121826;
  --muted: #667085;
  --line: #fed7aa;
  --primary: #f97316;
  --primary-2: #ea580c;
  --accent: #fb923c;
  --danger: #ef4444;
  --shadow: 0 18px 50px rgba(31, 41, 55, 0.1);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.18), transparent 30rem),
    linear-gradient(180deg, #fff7ed 0, var(--bg) 26rem);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: env(safe-area-inset-top) 20px calc(88px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 0 -20px 22px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(219, 227, 240, 0.8);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.header-logo {
  grid-column: 1 / -1;
  justify-self: center;
  display: block;
  width: min(380px, 72vw);
  aspect-ratio: 5 / 3;
  overflow: hidden;
  border: 1px solid rgba(249, 115, 22, 0.26);
  border-radius: 18px;
  background: #111827;
  box-shadow: 0 16px 38px rgba(154, 52, 18, 0.18);
}

.header-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.search svg {
  color: var(--muted);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link,
.bottom-link,
.icon-btn,
.primary-btn,
.ghost-btn {
  border: 0;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.nav-link {
  min-height: 42px;
  padding: 0 13px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--surface-2);
  color: var(--primary);
}

.cart-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 28px;
  align-items: center;
  min-height: 470px;
  padding: 22px 0 34px;
}

.hero-copy h1 {
  max-width: 780px;
  margin: 12px 0 14px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.eyebrow {
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 0 18px;
  font-weight: 850;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.28);
}

.primary-btn:hover {
  background: #ea580c;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.ghost-btn:hover {
  border-color: #b7c5dc;
  background: #f9fbff;
}

.primary-btn:active,
.ghost-btn:active,
.nav-link:active,
.bottom-link:active,
.icon-btn:active {
  transform: scale(0.97);
}

.wide {
  width: 100%;
}

.hero-visual {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #ffedd5;
  box-shadow: var(--shadow);
}

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

.section-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.section-strip article,
.panel,
.product-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.06);
}

.section-strip article {
  padding: 18px;
}

.section-strip span {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--primary);
  font-weight: 900;
}

.section-strip strong {
  display: block;
  margin-bottom: 4px;
}

.section-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.workspace.home-products {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.home-products .filters,
.workspace.home-products .cart-panel {
  display: none;
}

.workspace.cart-only {
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
}

.workspace.cart-only .filters,
.workspace.cart-only .content-stack {
  display: none;
}

.workspace.cart-only .cart-panel {
  display: block;
  position: static;
  grid-column: 1;
}

.panel {
  padding: 18px;
}

.filters,
.cart-panel {
  position: sticky;
  top: 90px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: #ffedd5;
  color: var(--primary);
  font-weight: 900;
}

.profile-card strong,
.profile-card small {
  display: block;
}

.profile-card small {
  color: var(--muted);
  font-size: 12px;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group label,
.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.filter-group select,
.admin-form input,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: 0;
}

.filter-group select,
.admin-form input {
  height: 44px;
  padding: 0 12px;
}

.admin-form textarea {
  resize: vertical;
  padding: 12px;
}

.filter-group select:focus,
.admin-form input:focus,
.admin-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.switch-row input {
  width: 42px;
  height: 24px;
  accent-color: var(--primary);
}

.content-stack {
  min-width: 0;
}

.view-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.view-head h2,
.panel-head h2 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.15;
}

.result-pill {
  white-space: nowrap;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--primary);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 850;
}

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

.catalog-banner {
  position: relative;
  display: block;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff7ed;
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.08);
}

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

.banner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(22px, 6vw, 64px);
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.76), rgba(248, 250, 252, 0.18));
  color: #111827;
}

.banner-overlay small {
  margin-bottom: 12px;
  color: #ea580c;
  font-size: clamp(12px, 2vw, 22px);
  font-weight: 900;
}

.banner-overlay strong,
.banner-overlay b {
  line-height: 1.05;
}

.banner-overlay strong {
  color: #475569;
  font-size: clamp(20px, 5vw, 54px);
  font-weight: 650;
}

.banner-overlay b {
  max-width: 780px;
  font-size: clamp(25px, 6vw, 70px);
  font-weight: 950;
}

.product-card {
  overflow: hidden;
}

.product-media {
  position: relative;
  aspect-ratio: 1.18;
  background: #fff7ed;
}

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

.stock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 850;
}

.stock-badge.is-out {
  color: var(--danger);
}

.favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
}

.favorite-btn.is-on {
  color: var(--danger);
}

.favorite-btn.is-on svg {
  fill: currentColor;
}

.product-info {
  padding: 14px;
}

.product-category {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.product-info h3 {
  min-height: 44px;
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.25;
}

.product-info p {
  min-height: 40px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.price {
  font-size: 18px;
  font-weight: 950;
}

.add-btn {
  min-width: 46px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.add-btn:disabled {
  cursor: not-allowed;
  background: #cbd5e1;
}

.empty-state {
  padding: 44px 18px;
  text-align: center;
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.icon-btn {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
}

.icon-btn:hover {
  background: #fee2e2;
  color: var(--danger);
}

.cart-list {
  display: grid;
  gap: 10px;
  min-height: 110px;
}

.cart-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.cart-item img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-2);
}

.cart-item strong,
.cart-item small {
  display: block;
}

.cart-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.cart-item small {
  color: var(--muted);
  font-size: 12px;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.qty-row button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cart-total strong {
  font-size: 22px;
}

.admin-section {
  margin-top: 24px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.admin-form .full-row,
.admin-form .switch-row,
.admin-form button {
  grid-column: 1 / -1;
}

.admin-table {
  overflow: auto;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 160px 110px 160px;
  gap: 12px;
  align-items: center;
  min-width: 680px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.table-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.small-btn {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
  font-weight: 800;
}

.small-btn.danger {
  color: var(--danger);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.bottom-link {
  position: relative;
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
}

.bottom-link.is-active {
  background: var(--surface-2);
  color: var(--primary);
}

.bottom-link .cart-count {
  position: absolute;
  top: 2px;
  right: calc(50% - 24px);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 14px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .cart-panel {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: env(safe-area-inset-top) 14px calc(82px + env(safe-area-inset-bottom));
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-right: -14px;
    margin-left: -14px;
    padding: 12px 14px;
  }

  .desktop-nav {
    display: none;
  }

  .brand small {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-copy h1 {
    font-size: clamp(36px, 12vw, 56px);
  }

  .section-strip {
    grid-template-columns: 1fr;
  }

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

  .filters,
  .cart-panel {
    position: static;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .profile-card {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .bottom-nav {
    display: grid;
  }

  .toast {
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 620px) {
  .hero-copy p {
    font-size: 16px;
  }

  .hero-actions {
    display: grid;
  }

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

  .view-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .catalog-banner {
    margin-bottom: 12px;
    border-radius: 18px;
  }

  .product-info {
    padding: 11px;
  }

  .product-info h3 {
    min-height: 40px;
    font-size: 14px;
  }

  .product-info p {
    display: none;
  }

  .product-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .add-btn {
    width: 100%;
  }
}
