[hidden] {
  display: none !important;
}

:root {
  --brand-green: #2dbe64;
  --brand-berry: #d7194b;
  --brand-graphite: #333333;
  --promo-yellow: #ffd508;
  --promo-orange: #fa5f0a;
  --promo-mint: #9ae894;
  --promo-red: #ff3c3c;
  --promo-blue: #54b3ff;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f4f5f7;
  --ink: var(--brand-graphite);
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: var(--brand-green);
  --accent-strong: #1f9e4e;
  --accent-soft: #e8faf0;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select {
  font: inherit;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 10px 18px;
  background: var(--accent);
  color: #ffffff;
  border-radius: 0 0 10px 10px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  z-index: 200;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* Auth screen */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-card {
  width: min(100%, 420px);
  margin: 20px;
  padding: 36px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--line);
}

.auth-logo {
  text-align: center;
  margin-bottom: 20px;
}

.auth-logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
}

.auth-card>p {
  margin: 0 0 28px;
  color: var(--muted);
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
}

.auth-field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.auth-field label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.auth-field input,
.auth-field select {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input:focus-visible,
.auth-field select:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgb(45 190 100 / 0.22);
  outline-offset: 2px;
}

.auth-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.auth-submit:hover {
  background: var(--accent-strong);
}

.auth-submit:active {
  transform: scale(0.99);
}

[tabindex="-1"] {
  outline: none;
}

.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-error:empty {
  display: none;
}

.auth-error {
  margin: -8px 0 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff0f0;
  color: var(--brand-berry);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.header-inner {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 14px clamp(16px, 3vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-mark-header img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}


/* Shell */
.shell {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 32px clamp(16px, 3vw, 36px) 40px;
}

/* Hero */
.hero {
  padding: 24px 0 32px;
}

.hero-title {
  margin: 0;
  font-family: 'Villula', Georgia, 'Times New Roman', serif;
  font-size: clamp(34px, 5.5vw, 56px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}

/* Landing cards */
.landing-cards {
  margin-bottom: 24px;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.landing-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 28px;
  border-radius: 20px;
  color: #ffffff;
  cursor: pointer;
  border: none;
  text-align: left;
  font-family: inherit;
  min-height: 160px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.landing-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
}

.landing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.landing-card:active {
  transform: translateY(-1px) scale(0.995);
}

.landing-card .card-icon {
  width: 32px;
  height: 32px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.landing-card h3 {
  margin: 0;
  font-family: 'Villula', Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

.landing-card .count {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 100px;
  position: relative;
  z-index: 1;
}

/* Big search */
.big-search-wrap {
  margin-bottom: 36px;
}

.big-search {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 22px;
  min-height: 64px;
  transition: box-shadow 0.2s ease;
}

.big-search:focus-within {
  box-shadow: 0 0 0 3px rgba(45, 190, 100, 0.25);
}

.big-search-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.big-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  outline: none;
  padding: 0;
  min-height: 64px;
}

.big-search input::placeholder {
  color: var(--muted);
}

/* Back button */
.back-button-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.back-button-header:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.back-button-header:active {
  transform: scale(0.98);
}

.back-button-header svg {
  transition: transform 0.2s ease;
}

.back-button-header:hover svg {
  transform: translateX(-2px);
}

/* Controls */
.controls {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 12px;
  margin-bottom: 12px;
  align-items: end;
}

.select-field {
  display: grid;
  gap: 7px;
}

.select-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 40px 0 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:focus-visible,
button:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgb(45 190 100 / 0.22);
  outline-offset: 2px;
}

.results-count {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* Catalog */
.catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.product-card {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.2s ease;
  animation: cardEnter 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.product-card.skeleton {
  cursor: default;
}

.product-card:active {
  transform: translateY(-1px) scale(0.995);
}

.product-card.cat-fruits {
  border-top-color: var(--accent);
}

.product-card.cat-vegetables {
  border-top-color: var(--brand-berry);
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

.product-card h3 {
  margin: 4px 0 0;
  flex-grow: 1;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.open-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 14px rgb(45 190 100 / 0.25);
}

.open-button:hover {
  background: var(--accent-strong);
  box-shadow: 0 6px 20px rgb(45 190 100 / 0.35);
}

.open-button:active {
  transform: translateY(1px) scale(0.99);
}

.open-button svg {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.open-button:hover svg {
  transform: translateX(2px);
}

/* Empty state */
.empty-state {
  padding: 48px 18px;
  text-align: center;
  transition: opacity 0.35s ease;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
  margin-bottom: 16px;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

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

.reset-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.reset-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.reset-button:active {
  transform: scale(0.98);
}

/* Skeleton */
.skeleton {
  pointer-events: none;
  animation: none !important;
}

.skeleton-line {
  display: block;
  background: linear-gradient(110deg, var(--surface-muted) 30%, #ffffff 50%, var(--surface-muted) 70%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: skeletonShimmer 1.6s infinite linear;
}

.skeleton-line--title {
  width: 70%;
  height: 24px;
}

.skeleton-line--btn {
  width: 100%;
  height: 48px;
  margin-top: auto;
  border-radius: 10px;
}

@keyframes skeletonShimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Toast */
.toast {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--ink);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  pointer-events: none;
}

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

/* Responsive */
@media (max-width: 1024px) {
  .catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    padding-top: 20px;
    padding-bottom: 24px;
  }

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

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

  .reset-button {
    justify-content: center;
  }

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

  .product-card {
    min-height: 260px;
  }

  .auth-card {
    padding: 28px 20px;
    margin: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}