:root {
  --cream: #f3dfcc;
  --white: #fffaf4;
  --accent: #4a2d1b;
  --accent-soft: #6f472d;
  --overlay: rgba(54, 30, 16, 0.78);
  --hero-overlay: rgba(117, 62, 35, 0.62);
  --ink: #2e2017;
  --muted: #765941;
  --gold: #d99222;
  --gold-dark: #c47d12;
  --shadow: 0 10px 24px rgba(69, 42, 24, 0.14);
  --shadow-soft: 0 18px 38px rgba(47, 29, 18, 0.2);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: "Inter", "Avenir Next", "SF Pro Text", Arial, system-ui, sans-serif;
}

html,
body,
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  padding: 18px 16px 126px;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 4px 0 14px;
  backdrop-filter: none;
}

.brand-mark {
  width: 82px;
  height: 82px;
  justify-self: center;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.brand-mark img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  display: block;
}

.icon-button,
.tab {
  border: 0;
  color: var(--accent);
  background: var(--white);
  box-shadow: var(--shadow);
}

.icon-button {
  justify-self: start;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  position: relative;
}

.cart-shortcut {
  justify-self: end;
}

.icon-button svg,
.tab svg,
.mini-icon svg,
.button-icon,
.inline-icon,
.meta-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-icon,
.inline-icon,
.meta-icon {
  flex: 0 0 auto;
}

.button-icon {
  width: 18px;
  height: 18px;
}

.inline-icon {
  width: 16px;
  height: 16px;
}

.meta-icon {
  width: 14px;
  height: 14px;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold-dark);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
}

.screen {
  animation: screenIn 0.32s ease;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  width: min(392px, calc(100% - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  border-radius: 24px;
  background: var(--accent);
  box-shadow: 0 18px 36px rgba(34, 22, 15, 0.28);
}

.tabbar.is-admin-hidden {
  grid-template-columns: repeat(3, 1fr);
}

.tab {
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  color: var(--white);
  transition: 0.24s ease;
}

.tab[hidden] {
  display: none !important;
}

.tab.is-active {
  background: var(--gold-dark);
  color: var(--white);
  transform: translateY(-2px);
}

.hero {
  min-height: 520px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  margin-bottom: 90px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  color: var(--white);
  box-shadow: var(--shadow-soft);
  background:
    linear-gradient(var(--hero-overlay), var(--hero-overlay)),
    url("https://images.unsplash.com/photo-1529692236671-f1f6cf9683ba?auto=format&fit=crop&w=900&q=80") center / cover;
}

.hero::before,
.smoke::before,
.smoke::after {
  content: none;
  position: absolute;
  pointer-events: none;
  filter: blur(11px);
  opacity: 0.5;
  background: rgba(255, 239, 222, 0.58);
  border-radius: 999px;
  animation: smoke 7s ease-in-out infinite alternate;
}

.finish::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--overlay);
  pointer-events: none;
}

.hero::before {
  width: 170px;
  height: 58px;
  top: 52px;
  left: 44px;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.eyebrow,
.accent-text {
  font-family: inherit;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--white);
  font-size: 16px;
  margin-bottom: 12px;
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: inherit;
  color: var(--accent);
  margin: 0;
  letter-spacing: 0;
  font-weight: 800;
}

.hero h1 {
  color: var(--white);
  font-size: 42px;
  line-height: 1.05;
  max-width: 100%;
}

.hero p {
  color: var(--white);
  font-size: 16px;
  line-height: 1.45;
  margin: 16px 0 24px;
  max-width: 300px;
  font-weight: 600;
}

.hero .secondary-button {
  color: var(--white);
  background: rgba(255, 250, 244, 0.16);
  border: 1px solid rgba(255, 250, 244, 0.46);
}

.hero-actions {
  display: grid;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.chip,
.filter-pill {
  border: 0;
  border-radius: 16px;
  min-height: 48px;
  padding: 0 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-button {
  color: var(--white);
  background: var(--gold-dark);
  box-shadow: 0 12px 22px rgba(156, 93, 12, 0.24);
}

.secondary-button {
  color: var(--accent);
  background: var(--white);
  box-shadow: var(--shadow);
}

.ghost-button {
  color: var(--white);
  background: var(--accent);
  border: 1px solid rgba(255, 250, 244, 0.36);
}

.danger-button {
  color: #fff8f1;
  background: #9e4b38;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.chip:hover,
.filter-pill:hover {
  transform: translateY(-2px);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 28px 0 16px;
}

.section-head h2 {
  font-size: 30px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--accent-soft);
  line-height: 1.35;
}

.horizontal-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 2px 4px 18px;
  scroll-snap-type: x mandatory;
  touch-action: pan-x pan-y;
  cursor: grab;
}

.horizontal-scroll > * {
  scroll-snap-align: start;
}

.horizontal-scroll.is-dragging,
.filter-row.is-dragging,
.admin-section-tabs.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.product-grid,
.box-grid,
.admin-grid {
  display: grid;
  gap: 16px;
}

.product-card,
.box-card,
.panel,
.cart-item,
.order-card,
.admin-column {
  border: 1px solid rgba(86, 53, 30, 0.08);
  background: var(--white);
  backdrop-filter: none;
  box-shadow: var(--shadow);
}

.product-card,
.box-card {
  overflow: hidden;
  border-radius: var(--radius);
}

.product-card {
  display: grid;
  grid-template-rows: 190px 1fr;
  height: 100%;
}

.product-photo,
.box-photo {
  min-height: 190px;
  background-color: #d6b293;
  background-size: cover;
  background-position: center;
  position: relative;
}

.product-photo::after,
.box-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(64, 33, 11, 0.18);
}

.card-body {
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(60px, auto) auto auto;
  align-content: start;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-heading h3 {
  font-size: 22px;
  line-height: 1.12;
  min-height: 74px;
}

.card-body p {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.42;
  font-size: 14px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.season-chip,
.category,
.stock,
.status-chip,
.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #f7eadc;
  color: var(--accent);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.stock.is-empty {
  background: #f5ddd7;
  color: #8c3929;
}

.add-button {
  width: 100%;
}

.add-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.filters {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  cursor: grab;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  min-height: 32px;
  white-space: nowrap;
  color: var(--accent);
  background: var(--white);
  border: 1.2px solid rgba(86, 53, 30, 0.34);
  box-shadow: none;
  font-weight: 700;
}

.filter-row-primary .filter-pill {
  min-height: 36px;
  padding-inline: 17px;
  border-radius: 999px;
  font-size: 14px;
}

.filter-row-secondary .filter-pill {
  min-height: 25px;
  padding-inline: 10px;
  border-radius: 999px;
  border-color: rgba(86, 53, 30, 0.28);
  color: rgba(86, 53, 30, 0.72);
  font-size: 11px;
}

.filter-row-tertiary .filter-pill {
  min-height: 23px;
  padding-inline: 9px;
  border-radius: 999px;
  border-color: rgba(86, 53, 30, 0.24);
  color: rgba(86, 53, 30, 0.66);
  font-size: 10px;
}

.filter-pill.is-active {
  background: var(--gold-dark);
  border-color: transparent;
  color: var(--white);
}

.filter-row-primary .filter-pill.is-active {
  color: var(--white);
}

.filter-row-secondary .filter-pill.is-active,
.filter-row-tertiary .filter-pill.is-active {
  color: var(--white);
  background: var(--gold-dark);
}

.box-card {
  position: relative;
  color: var(--accent);
  min-height: 290px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  border: 0;
}

.box-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 250, 244, 0.78);
}

.box-card::after {
  content: none;
  position: absolute;
  width: 120px;
  height: 44px;
  right: 16px;
  top: 26px;
  border-radius: 999px;
  filter: blur(10px);
  background: rgba(255, 241, 224, 0.44);
}

.box-content {
  position: relative;
  z-index: 2;
  padding: 20px;
}

.box-content h3 {
  color: var(--accent);
  font-size: 28px;
}

.box-content p {
  color: var(--muted);
  line-height: 1.42;
}

.branch {
  display: none;
}

.branch::before,
.branch::after {
  content: none;
  position: absolute;
  width: 26px;
  height: 12px;
  border-radius: 100% 0;
  background: rgba(154, 167, 129, 0.72);
}

.branch::before {
  right: 24px;
  bottom: 2px;
  transform: rotate(42deg);
}

.branch::after {
  right: 52px;
  bottom: -3px;
  transform: rotate(-36deg);
}

.panel {
  border-radius: var(--radius);
  padding: 18px;
}

#contacts {
  background: var(--accent);
  color: var(--white);
}

#contacts h3,
#contacts .hint,
#contacts .mini-chip {
  color: var(--white);
}

#contacts .mini-chip {
  background: rgba(255, 250, 244, 0.16);
}

.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
}

.cart-list {
  display: grid;
  gap: 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 12px;
  align-items: center;
  border-radius: 20px;
  padding: 10px;
}

.cart-thumb {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
}

.cart-info h3 {
  font-size: 18px;
}

.cart-info p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.qty-controls {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.mini-icon {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #f8dfc9;
}

.mini-icon svg {
  width: 17px;
  height: 17px;
}

.qty {
  font-weight: 900;
  color: var(--accent);
}

.delivery-options {
  display: grid;
  gap: 9px;
}

.delivery-option {
  position: relative;
}

.delivery-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.delivery-option span {
  min-height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--white);
  color: var(--accent);
  font-weight: 800;
}

.delivery-option input:checked + span {
  background: var(--accent);
  color: var(--white);
}

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

.field label {
  display: block;
  margin: 0 0 6px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select,
.admin-input {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--white);
  box-shadow: inset 0 0 0 1px rgba(86, 53, 30, 0.12);
  outline: 2px solid transparent;
}

.field textarea {
  padding-top: 13px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.admin-input:focus {
  outline-color: rgba(86, 53, 30, 0.18);
}

.image-upload-field input[type="file"] {
  display: flex;
  align-items: center;
  padding: 12px;
}

.image-upload-field input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 12px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--white);
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.actions-stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.summary-list {
  display: grid;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(86, 53, 30, 0.18);
}

.summary-row strong {
  color: var(--accent);
}

.finish {
  min-height: 610px;
  border-radius: 24px;
  padding: 26px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(var(--hero-overlay), var(--hero-overlay)),
    url("https://images.unsplash.com/photo-1544025162-d76694265947?auto=format&fit=crop&w=900&q=80") center / cover;
  box-shadow: var(--shadow-soft);
  color: var(--white);
}

.finish h1 {
  color: var(--white);
  font-size: 42px;
  line-height: 1;
  position: relative;
  z-index: 2;
}

.finish p {
  position: relative;
  z-index: 2;
  line-height: 1.45;
}

.smoke::before {
  width: 150px;
  height: 54px;
  top: 84px;
  left: 32px;
}

.smoke::after {
  width: 180px;
  height: 60px;
  right: 12px;
  bottom: 130px;
  animation-delay: 1.1s;
}

@keyframes smoke {
  to {
    transform: translate(18px, -18px) scale(1.12);
    opacity: 0.25;
  }
}

.finish .eyebrow,
.finish p,
.finish .actions-stack {
  position: relative;
  z-index: 2;
}

@keyframes smsIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.admin-section-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 16px;
  padding: 2px;
  touch-action: pan-x pan-y;
}

.admin-section-tab {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(86, 53, 30, 0.14);
  border-radius: 16px;
  padding: 0 14px;
  color: var(--accent);
  background: var(--white);
  box-shadow: var(--shadow);
  font-weight: 800;
  white-space: nowrap;
}

.admin-section-tab.is-active {
  border-color: transparent;
  color: var(--white);
  background: var(--gold-dark);
}

.admin-control-panel {
  display: grid;
  gap: 16px;
}

.admin-control-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.admin-control-head h3 {
  font-size: 22px;
}

.admin-control-head .hint {
  margin-top: 5px;
}

.admin-logout-button {
  min-height: 42px;
  padding-inline: 14px;
  white-space: nowrap;
}

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

.admin-search-field label {
  margin-left: 0;
}

.admin-main-action {
  width: 100%;
}

.admin-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-settings-grid {
  margin-top: 14px;
}

.admin-item-editor {
  display: grid;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px dashed rgba(86, 53, 30, 0.16);
}

.admin-item-editor:last-child {
  border-bottom: 0;
}

.admin-items {
  display: grid;
  gap: 2px;
  margin-top: 12px;
}

.admin-item-thumb {
  width: 100%;
  min-height: 150px;
  border-radius: 18px;
  background-color: #d6b293;
  background-size: cover;
  background-position: center;
}

.admin-toggle {
  margin-top: 12px;
}

.order-window {
  margin-bottom: 14px;
}

.order-window.is-closed {
  border-color: rgba(158, 75, 56, 0.24);
}

.admin-column {
  border-radius: 20px;
  padding: 14px;
}

.admin-column h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.order-card {
  border-radius: 16px;
  padding: 12px;
  margin-top: 10px;
  background: var(--white);
}

.order-card strong {
  color: var(--accent);
}

.order-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.inventory-row {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(86, 53, 30, 0.14);
}

.inventory-row input {
  min-height: 38px;
  border-radius: 14px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 80;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  width: min(360px, calc(100% - 40px));
  padding: 13px 16px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--white);
  text-align: center;
  box-shadow: 0 16px 34px rgba(34, 22, 15, 0.28);
  transition: 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 760px) {
  .app-shell {
    width: min(1120px, 100%);
    padding-inline: 28px;
  }

  .hero {
    min-height: 560px;
  }

  .hero-actions {
    grid-template-columns: repeat(3, auto);
    justify-content: start;
  }

  .product-grid,
  .box-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-section-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .admin-section-tab {
    min-width: 0;
  }

  .horizontal-scroll {
    grid-auto-columns: 31%;
  }
}
