:root {
  --bg: #f5fbfa;
  --ink: #10231f;
  --muted: #536965;
  --line: #cfe9e5;
  --panel: #ffffff;
  --soft: #f1f8e8;
  --accent: #8cc63f;
  --accent-strong: #6fa82f;
  --accent-light: #dff1c7;
  --green: #8cc63f;
  --warm: #cc7418;
  --shadow: 0 18px 48px rgba(140, 198, 63, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: 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 {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(140, 198, 63, 0.2), transparent 32%),
    radial-gradient(circle at 88% 82%, rgba(140, 198, 63, 0.14), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.auth-panel {
  width: min(500px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid rgba(140, 198, 63, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-logo {
  display: block;
  width: min(330px, 100%);
  height: auto;
  justify-self: center;
  border: 1px solid #222;
  background: white;
}

.auth-panel h1 {
  margin: 0;
  font-size: clamp(1.65rem, 5vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
  color: var(--accent-strong);
}

.auth-copy,
.auth-message,
.auth-about {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-about {
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--soft);
  font-size: 0.94rem;
}

.auth-message {
  min-height: 1.4em;
  color: var(--accent-strong);
  font-weight: 800;
}

.auth-resend {
  justify-content: center;
}

.auth-switch {
  margin: 0;
  text-align: center;
  font-weight: 800;
}

.auth-switch a {
  color: var(--accent-strong);
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.eyebrow,
.hero-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

input {
  padding: 0 16px;
  font-size: 1.02rem;
}

select {
  padding: 0 12px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.18);
}

.app-hero {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(140, 198, 63, 0.12), transparent 62%),
    #ffffff;
}

.app-nav {
  width: min(1440px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 52px);
}

.nav-logo {
  width: 198px;
  max-width: 42vw;
  height: auto;
  border: 1px solid var(--line);
  background: white;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.user-badge {
  max-width: min(42vw, 420px);
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-search {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 52px) 36px;
}

.hero-search h1 {
  margin: 0 0 8px;
  font-size: clamp(2.1rem, 5.2vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
  color: var(--accent-strong);
}

.hero-subtitle {
  max-width: 620px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.hero-search-box {
  position: relative;
  color: var(--accent-strong);
}

.hero-search-box input {
  min-height: 64px;
  padding-left: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 18px 48px rgba(16, 35, 31, 0.08);
}

.hero-search-box::before {
  content: "";
  position: absolute;
  left: 17px;
  bottom: 18px;
  width: 15px;
  height: 15px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  z-index: 1;
}

.hero-search-box::after {
  content: "";
  position: absolute;
  left: 31px;
  bottom: 16px;
  width: 8px;
  height: 2px;
  background: var(--accent);
  transform: rotate(45deg);
  z-index: 1;
}

.vehicle-brands,
.hero-brands {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.vehicle-brands span,
.hero-brands span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.vehicle-brand-strip,
.brand-strip {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: brand-scroll 70s linear infinite;
}

.vehicle-brand-strip {
  animation-duration: 140s;
}

.vehicle-brand-marquee,
.brand-marquee {
  overflow: hidden;
  position: relative;
  padding: 2px 0;
}

.vehicle-brand-marquee:hover .vehicle-brand-strip,
.brand-marquee:hover .brand-strip {
  animation-play-state: paused;
}

.vehicle-brand-strip strong,
.vehicle-logo-card {
  min-width: 178px;
  height: 94px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--accent-strong);
  font-size: 1.18rem;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(16, 35, 31, 0.08);
}

.vehicle-logo-card {
  grid-template-rows: 1fr auto;
  gap: 6px;
  padding: 12px 14px 10px;
}

.vehicle-logo-card img {
  max-width: 132px;
  max-height: 56px;
  object-fit: contain;
}

.vehicle-logo-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.brand-strip img {
  width: 210px;
  height: 96px;
  flex: 0 0 auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(16, 35, 31, 0.08);
}

@keyframes brand-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 6px));
  }
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 52px) 56px;
  background: var(--bg);
}

.catalog-board {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 0;
}

.catalog-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(207, 233, 229, 0.7);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 34px rgba(16, 35, 31, 0.05);
}

.sidebar-title h2,
.result-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  letter-spacing: 0;
}

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.catalog-results {
  min-width: 0;
}

.hero-search-section {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.search-section {
  margin: 0;
}

.browse-section,
.tag-section,
.filter-panel {
  margin-bottom: 16px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.8vw, 2.15rem);
  letter-spacing: 0;
}

.section-copy {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.section-heading.compact {
  margin-bottom: 10px;
}

.category-grid {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 2px 16px;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--accent) #dce8d0;
}

.category-card {
  width: clamp(220px, 22vw, 280px);
  min-width: clamp(220px, 22vw, 280px);
  min-height: 270px;
  display: grid;
  align-content: stretch;
  gap: 0;
  padding: 14px;
  border: 0;
  border-radius: 24px;
  background: #f3f3f3;
  box-shadow: none;
  cursor: pointer;
  scroll-snap-align: start;
}

.category-card:hover,
.category-card.active {
  background: #edf7e4;
}

.category-card.active {
  box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.32);
}

.category-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  overflow: hidden;
  border-radius: 20px;
  background: white;
}

.category-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.category-icon {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: white;
  color: var(--accent-strong);
  font-size: 3rem;
  font-weight: 950;
}

.category-card strong {
  width: calc(100% - 28px);
  min-height: 62px;
  display: grid;
  place-items: center;
  justify-self: center;
  margin-top: -32px;
  padding: 10px 14px;
  overflow-wrap: anywhere;
  border-radius: 5px;
  background: var(--accent);
  color: white;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 950;
  line-height: 1.15;
  text-transform: uppercase;
  z-index: 1;
}

.category-card small {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.tag-list,
.tag-row,
.subcategory-list {
  display: grid;
  gap: 8px;
}

.tag-button,
.text-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--accent-strong);
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

.tag-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  text-align: left;
}

.tag-button::after {
  content: "+";
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
}

.tag-button.active {
  border-color: var(--accent);
  background: var(--soft);
}

.tag-button.active::after {
  content: "-";
}

.subcategory-list {
  padding: 2px 0 6px 14px;
}

.subcategory-button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-left: 3px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 0.86rem;
  font-weight: 760;
  cursor: pointer;
}

.subcategory-button:hover,
.subcategory-button.active {
  border-left-color: var(--accent);
  color: var(--accent-strong);
  background: var(--soft);
}

.muted-text.small {
  font-size: 0.86rem;
}

.text-button {
  padding: 0 12px;
}

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

.filter-panel {
  display: grid;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(207, 233, 229, 0.75);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(16, 35, 31, 0.04);
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.filters label {
  font-size: 0.72rem;
}

.filters select {
  min-height: 44px;
}

.exact-toggle {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.advanced-filters {
  width: fit-content;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 780;
}

.advanced-filters summary {
  cursor: pointer;
}

.exact-toggle input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.result-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 28px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.result-meta p {
  margin: 0;
}

.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.pagination-bottom {
  margin: 24px 0 0;
}

.page-button {
  min-width: 38px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--accent-strong);
  font-weight: 850;
  cursor: pointer;
}

.page-button:hover:not(:disabled),
.page-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.page-gap,
.page-summary {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.page-summary {
  margin-left: 4px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
  align-items: start;
}

.product-card {
  overflow: hidden;
  border: 1px solid rgba(207, 233, 229, 0.72);
  border-radius: 14px;
  background: white;
  box-shadow: 0 18px 44px rgba(16, 35, 31, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 54px rgba(16, 35, 31, 0.11);
}

.image-button {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.15 / 1;
  padding: 0;
  border: 0;
  background: #f6faf8;
  cursor: pointer;
}

.image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-error {
  opacity: 0;
}

.video-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(97, 164, 40, 0.94);
  color: white;
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1;
}

.card-body {
  padding: 16px;
  text-align: left;
}

.card-body h2 {
  margin: 0 0 8px;
  min-height: 2.55em;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.path {
  display: -webkit-box;
  min-height: 2.4em;
  margin-top: 7px !important;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button,
.ghost-button {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.ghost-button.light {
  color: var(--accent-strong);
  border-color: var(--line);
  background: white;
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: var(--accent);
}

.ghost-button.light:hover {
  border-color: var(--accent);
}

.empty-state {
  margin-top: 42px;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--ink);
}

.category-toggle {
  display: none;
  min-height: 36px;
  white-space: nowrap;
}

.muted-text {
  margin: 0;
  color: var(--muted);
}

.image-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.image-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.image-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  background: #1e1e1e;
}

.dialog-videos {
  padding: 14px 16px 0;
  background: var(--panel);
}

.dialog-videos h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

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

.dialog-video-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.dialog-video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dialog-video-item iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  background: #111;
}

.dialog-actions {
  justify-content: space-between;
  margin: 0;
  padding: 14px 16px;
}

.dialog-actions strong {
  display: block;
  margin-bottom: 3px;
}

.dialog-actions p {
  margin: 0;
  color: var(--muted);
}

.close-button {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: white;
  cursor: pointer;
}

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

  .top-actions {
    max-width: 54vw;
  }

  .catalog-board {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .catalog-sidebar {
    position: static;
    padding: 14px;
  }

  .sidebar-title h2 {
    font-size: 1.25rem;
  }

  .category-toggle {
    display: inline-flex;
  }

  .tag-section {
    display: none;
  }

  .tag-section.open {
    display: block;
  }

  .tag-list {
    display: grid;
  }

  .tag-row {
    display: grid;
  }

  .filter-panel,
  .filters {
    grid-template-columns: 1fr;
  }

  .exact-toggle {
    justify-content: flex-start;
  }

  .result-meta {
    display: grid;
  }

  .hero-search-section {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 8px 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
  }
}

@media (max-width: 560px) {
  .auth-panel {
    padding: 22px;
  }

  .app-nav {
    display: grid;
  }

  .nav-logo {
    width: 176px;
  }

  .top-actions {
    max-width: 100%;
    justify-content: flex-start;
  }

  .user-badge {
    max-width: 100%;
  }

  .hero-search {
    padding-top: 8px;
  }

  .category-grid {
    gap: 14px;
  }

  .category-card {
    width: 210px;
    min-width: 210px;
    min-height: 220px;
    padding: 10px;
    border-radius: 18px;
  }

  .category-preview,
  .category-icon {
    border-radius: 14px;
  }

  .category-card strong {
    width: calc(100% - 16px);
    min-height: 54px;
    margin-top: -26px;
    padding: 8px 9px;
    font-size: 0.76rem;
  }

  .brand-strip img {
    width: 176px;
    height: 82px;
  }

  .vehicle-brand-strip strong,
  .vehicle-logo-card {
    min-width: 148px;
    height: 78px;
    font-size: 1rem;
  }

  .vehicle-logo-card img {
    max-width: 108px;
    max-height: 42px;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card-body {
    padding: 14px;
  }

  .card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }
}
