:root {
  --green: #59d93f;
  --green-dark: #45b82f;
  --green-light: #f0fce8;
  --green-glow: rgba(89, 217, 63, 0.22);
  --green-soft: rgba(89, 217, 63, 0.08);
  --green-mid: rgba(89, 217, 63, 0.14);
  --black: #111111;
  --gray-700: #333333;
  --gray-500: #666666;
  --gray-300: #d9d9d9;
  --white: #ffffff;
  --shadow: 0 12px 40px rgba(17, 17, 17, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: "Roboto", system-ui, sans-serif;
  --font-body: "Roboto", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, var(--green-soft), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 30%, var(--green-mid), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, var(--green-soft), transparent 45%);
  animation: ambient-drift 18s ease-in-out infinite alternate;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-300);
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.site-header.is-scrolled {
  border-bottom-color: rgba(89, 217, 63, 0.35);
  box-shadow: 0 4px 24px var(--green-glow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  flex-shrink: 0;
  height: 42px;
  width: auto;
  object-fit: contain;
}

.footer-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  position: relative;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-700);
  transition: color 0.25s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.main-nav a:hover {
  color: var(--green-dark);
}

.main-nav a:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--green);
  color: var(--white);
  box-shadow: 0 4px 14px var(--green-glow);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}

.btn-primary:hover {
  background: var(--green-dark);
  box-shadow: 0 6px 20px var(--green-glow);
}

.btn-primary:hover::after {
  transform: translateX(120%);
}

.btn-wide {
  width: 100%;
}

/* Hero */
.hero {
  position: relative;
  padding: 4rem 0 5rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 80%, var(--green-soft), transparent 40%),
    radial-gradient(circle at 85% 20%, var(--green-glow), transparent 45%),
    linear-gradient(180deg, var(--white) 0%, #fafafa 100%);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  animation: float-orb 12s ease-in-out infinite;
}

.hero-glow--left {
  width: 280px;
  height: 280px;
  left: -80px;
  top: 20%;
  background: var(--green-mid);
  opacity: 0.5;
}

.hero-glow--right {
  width: 200px;
  height: 200px;
  right: 10%;
  bottom: 10%;
  background: var(--green-glow);
  animation-delay: -4s;
  animation-duration: 14s;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--green-dark);
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 var(--green-glow);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.hero h1 .accent {
  color: var(--green);
  text-shadow: 0 0 40px var(--green-glow);
  animation: accent-glow 4s ease-in-out infinite;
}

.lead {
  margin: 0 0 1.75rem;
  max-width: 34rem;
  font-size: 1.08rem;
  color: var(--gray-700);
}

.hero-search {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero-search:focus-within {
  border-color: var(--green-dark);
  box-shadow: 0 0 0 4px var(--green-glow), var(--shadow);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: none;
  outline: none;
  background: transparent;
}

.hero-visual {
  position: relative;
  min-height: 320px;
}

.hero-feature-points {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 1.5rem;
  list-style: none;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow), -4px 0 0 var(--green);
  transition: box-shadow 0.35s ease;
}

.hero-feature-points:hover {
  box-shadow: var(--shadow), -4px 0 0 var(--green), 0 8px 32px var(--green-glow);
}

.hero-feature-points li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #333333;
  transition: transform 0.25s ease, padding-left 0.25s ease;
}

.hero-feature-points li:hover {
  padding-left: 0.25rem;
}

.hero-feature-points li:nth-child(1) .hero-feature-icon { animation-delay: 0s; }
.hero-feature-points li:nth-child(2) .hero-feature-icon { animation-delay: 0.4s; }
.hero-feature-points li:nth-child(3) .hero-feature-icon { animation-delay: 0.8s; }
.hero-feature-points li:nth-child(4) .hero-feature-icon { animation-delay: 1.2s; }

.hero-feature-points li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.hero-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--green);
  color: var(--black);
  flex-shrink: 0;
  animation: icon-breathe 3s ease-in-out infinite;
  transition: transform 0.25s ease;
}

.hero-feature-points li:hover .hero-feature-icon {
  transform: scale(1.08);
}

.hero-feature-icon svg {
  display: block;
}

.hero-feature-text {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: #eeeeee;
}

.gear-ring {
  position: absolute;
  inset: 10% 0 0 15%;
  border: 3px dashed var(--green);
  border-radius: 50%;
  opacity: 0.35;
  animation: spin 30s linear infinite, ring-glow 4s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Sections */
section {
  padding: 4.5rem 0;
}

.section-head {
  margin-bottom: 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--green);
}

.section-head h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.section-head h2 span,
.section-head h2 {
  background: linear-gradient(90deg, var(--black) 70%, var(--green-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-head p {
  margin: 0;
  color: var(--gray-500);
}

.product-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
}

/* Legacy search panel (removed from page) */
.search-panel {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.field-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-700);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--black);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.results-area {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-300);
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.results-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.results-header p {
  margin: 0;
  color: var(--gray-500);
  font-size: 0.92rem;
}

.results-table-wrap {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.results-table th,
.results-table td {
  padding: 0.85rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-300);
}

.results-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  background: #f7f7f7;
}

.results-table tbody tr:hover {
  background: var(--green-light);
}

.part-number {
  font-weight: 700;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-oem { background: var(--green-light); color: #2d6b1f; }
.badge-superseded { background: #fff3cd; color: #856404; }
.badge-aftermarket { background: #e8eaf6; color: #283593; }
.badge-direct { background: #e3f2fd; color: #1565c0; }

.btn-link {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-link:hover {
  background: var(--green);
  color: var(--white);
}

.empty-state,
.no-results {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--gray-500);
}

.empty-icon {
  display: inline-flex;
  margin-bottom: 1rem;
  color: var(--green);
}

.empty-state h3,
.no-results h3 {
  margin: 0 0 0.5rem;
  color: var(--black);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

/* Categories */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.category-card {
  padding: 1.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--green);
  box-shadow: var(--shadow);
}

.category-icon {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  font-style: italic;
  color: var(--green);
  margin-bottom: 0.75rem;
}

.category-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.category-card p {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--gray-500);
}

.category-card a {
  font-weight: 700;
  color: var(--green);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.contact-grid h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.contact-details {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.contact-details li {
  margin-bottom: 0.5rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

/* Footer */
.site-footer {
  position: relative;
  background: var(--black);
  color: #cccccc;
  padding: 3rem 0 0;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--green) 50%, transparent 95%);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-brand p {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  max-width: 18rem;
}

.site-footer h4 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  color: var(--white);
}

.site-footer a {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  color: #aaaaaa;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--green);
}

.footer-bottom {
  padding: 1rem 0 1.5rem;
  border-top: 1px solid #333333;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.85rem;
  color: #777777;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: var(--black);
  color: var(--white);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
}

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

/* Cart trigger */
.cart-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.cart-trigger:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--green);
  color: var(--black);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
  animation: cart-pulse 2.5s ease-in-out infinite;
}

.cart-count[hidden] {
  animation: none;
}

/* Products */
.products-section {
  position: relative;
  background: linear-gradient(180deg, #fafafa 0%, var(--white) 12%, var(--white) 100%);
}

.products-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0.7;
}

.product-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  background: var(--white);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--black);
}

.filter-btn.active {
  box-shadow: 0 0 0 3px var(--green-glow);
  animation: filter-pop 0.35s ease;
}

.product-grid,
.product-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.product-results-grid {
  margin-bottom: 1.5rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.product-card::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--green-dark));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(89, 217, 63, 0.5);
  box-shadow: 0 12px 36px var(--green-glow);
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-image-wrap {
  position: relative;
  aspect-ratio: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #eeeeee;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.product-card:hover .product-image-wrap {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--green-light);
}

.product-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.25rem;
  padding-bottom: 2.5rem;
  transition: transform 0.45s ease;
}

.product-card:hover .product-photo {
  transform: scale(1.03);
}

.product-watermark {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: min(42%, 108px);
  height: auto;
  opacity: 0.88;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.product-body {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.35rem;
}

.product-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-dark);
}

.product-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  line-height: 1.2;
}

.product-part {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--gray-500);
}

.product-brand {
  font-size: 0.88rem;
  color: var(--gray-700);
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 900;
}

.product-price-was {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted, #8a8f98);
  text-decoration: line-through;
}

.product-save {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1f8a4c;
}

.product-condition {
  margin: 0.25rem 0 0;
  font-size: 0.76rem;
  color: var(--muted, #8a8f98);
}

.product-profit {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0d5cab;
}

.product-price small {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gray-500);
}

.fluid-modal[hidden] {
  display: none !important;
}

.fluid-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.fluid-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.fluid-modal-dialog {
  position: relative;
  width: min(100%, 380px);
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.fluid-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-700);
}

.fluid-modal-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.25rem 0 1rem;
  min-height: 220px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--radius-sm);
}

.fluid-modal-image-wrap img {
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
}

.fluid-modal-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  line-height: 1.2;
}

.fluid-modal-brand,
.fluid-modal-part {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.fluid-modal-part {
  font-family: ui-monospace, Consolas, monospace;
}

.fluid-modal-sizes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 1rem 0;
}

.fluid-size-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.fluid-size-btn span {
  font-size: 1rem;
  font-weight: 900;
}

.fluid-size-btn small {
  font-size: 0.82rem;
  color: var(--gray-600);
}

.fluid-size-btn:hover,
.fluid-size-btn.active {
  border-color: var(--green-dark);
  background: var(--green);
}

.fluid-size-btn.active small {
  color: var(--black);
}

.fluid-modal-price {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 900;
  text-align: center;
}

body.fluid-open {
  overflow: hidden;
}

.btn-add {
  flex-shrink: 0;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: var(--black);
  font-weight: 900;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-add:hover {
  background: var(--green-dark);
  color: var(--white);
  transform: translateY(-1px);
}

.stock-in { color: var(--green-dark); font-weight: 700; font-size: 0.8rem; }
.stock-low { color: #b8860b; font-weight: 700; font-size: 0.8rem; }
.stock-out { color: #999; font-weight: 700; font-size: 0.8rem; }

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.product-demand,
.product-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-700);
  background: #f3f4f6;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.product-badge--warn {
  color: #8a5a00;
  background: #fff4d6;
}

.product-trade {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.product-trade--yes {
  color: var(--green-dark);
  background: var(--green-light);
}

.product-trade--no {
  color: #8a5a00;
  background: #fff4d6;
}

.product-supplier {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-700);
  text-decoration: none;
  border-bottom: 1px solid rgba(89, 217, 63, 0.45);
}

.product-supplier:hover {
  color: var(--green-dark);
}

.product-cost {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--gray-500);
}

.product-grid-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--gray-700);
  font-weight: 700;
}

.product-pagination {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pagination-summary,
.pagination-status {
  margin: 0;
  font-size: 0.92rem;
  color: var(--gray-700);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pagination-btn {
  padding: 0.55rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--green);
  background: var(--green-light);
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Cart drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.45);
  z-index: 150;
}

.cart-overlay[hidden],
.cart-drawer[hidden] {
  display: none;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 160;
  display: flex;
  flex-direction: column;
  width: min(400px, 100%);
  height: 100%;
  background: var(--white);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
}

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-300);
  background: linear-gradient(180deg, var(--green-light) 0%, var(--white) 100%);
}

.cart-drawer-head h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.cart-close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.75rem;
  align-items: start;
}

.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #f5f5f5;
  border-radius: var(--radius-sm);
  padding: 4px;
}

.cart-item-info h4 {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.cart-item-info p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--gray-500);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.cart-item-qty button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  font-weight: 700;
}

.cart-item-qty span {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
}

.cart-item-price {
  font-weight: 900;
  text-align: right;
}

.cart-item-remove {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 0;
  border: none;
  background: none;
  color: var(--gray-500);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  color: var(--gray-500);
}

.cart-empty[hidden],
.cart-footer[hidden] {
  display: none;
}

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--gray-300);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.cart-total-row strong {
  font-size: 1.35rem;
}

body.cart-open {
  overflow: hidden;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

.reveal-delay-1 {
  transition-delay: 0.12s;
}

.product-card.reveal {
  transition-delay: calc(var(--reveal-index, 0) * 0.07s);
}

/* Keyframe animations */
@keyframes ambient-drift {
  0% { opacity: 0.85; transform: scale(1) translateY(0); }
  100% { opacity: 1; transform: scale(1.02) translateY(-8px); }
}

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(12px, -16px); }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 var(--green-glow); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

@keyframes accent-glow {
  0%, 100% { text-shadow: 0 0 24px var(--green-glow); }
  50% { text-shadow: 0 0 48px rgba(89, 217, 63, 0.35); }
}

@keyframes icon-breathe {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 12px var(--green-glow); }
}

@keyframes ring-glow {
  0%, 100% { opacity: 0.3; filter: drop-shadow(0 0 0 transparent); }
  50% { opacity: 0.45; filter: drop-shadow(0 0 8px var(--green)); }
}

@keyframes filter-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes cart-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  body::before {
    animation: none;
  }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid,
  .field-row,
  .category-grid,
  .contact-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .field-row .btn-wide {
    width: auto;
  }

  .hero-visual {
    min-height: auto;
  }

  .gear-ring {
    display: none;
  }
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 1rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
  }

  .main-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding-top: 2.5rem;
  }

  .hero-search {
    flex-direction: column;
  }
}

/* Mobile shop — desktop layout unchanged above 768px */
@media (max-width: 767px) {
  .container {
    width: min(1120px, calc(100% - 1.25rem));
  }

  .header-inner {
    min-height: 64px;
  }

  .brand-logo {
    height: 36px;
  }

  .cart-trigger {
    width: 48px;
    height: 48px;
  }

  .hero {
    padding: 2rem 0 2.75rem;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 8.5vw, 2.35rem);
  }

  .lead {
    margin-bottom: 1.25rem;
    font-size: 1rem;
  }

  .hero-search input {
    font-size: 16px;
    padding: 0.9rem 1rem;
  }

  .hero-search .btn-primary {
    width: 100%;
    min-height: 48px;
  }

  .hero-feature-points {
    padding: 1.15rem;
    gap: 0.7rem;
  }

  .hero-feature-text {
    font-size: 0.9rem;
  }

  section {
    padding: 3rem 0;
  }

  .section-head {
    margin-bottom: 1.35rem;
  }

  .product-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    gap: 0.45rem;
    margin: 0 -0.25rem 1.25rem;
    padding: 0.15rem 0.25rem 0.5rem;
    scrollbar-width: none;
  }

  .product-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
    scroll-snap-align: start;
    min-height: 44px;
    padding: 0.55rem 1rem;
  }

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

  .product-card:hover {
    transform: none;
  }

  .product-body {
    padding: 0.75rem;
    gap: 0.25rem;
  }

  .product-title {
    font-size: 0.82rem;
  }

  .product-part {
    font-size: 0.72rem;
    word-break: break-all;
  }

  .product-brand {
    font-size: 0.78rem;
  }

  .product-photo {
    padding: 0.85rem;
    padding-bottom: 1.75rem;
  }

  .product-watermark {
    width: min(48%, 72px);
    right: 6px;
    bottom: 6px;
  }

  .product-meta {
    gap: 0.25rem;
  }

  .product-badge,
  .stock-in,
  .stock-low,
  .stock-out {
    font-size: 0.68rem;
  }

  .product-condition {
    font-size: 0.68rem;
    line-height: 1.3;
  }

  .product-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.35rem;
    padding-top: 0.55rem;
  }

  .product-price {
    font-size: 1.1rem;
  }

  .btn-add {
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 0.85rem;
    font-size: 0.82rem;
  }

  .product-pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pagination-controls {
    justify-content: center;
  }

  .pagination-btn {
    min-height: 44px;
    flex: 1;
    max-width: 9rem;
  }

  .cart-drawer {
    width: 100%;
  }

  .cart-footer {
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .cart-footer .btn-primary {
    min-height: 48px;
  }

  .cart-item-qty button {
    width: 36px;
    height: 36px;
  }

  .fluid-modal {
    align-items: flex-end;
    padding: 0;
  }

  .fluid-modal-dialog {
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1.15rem 1.15rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
  }

  .fluid-modal-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .fluid-size-btn {
    min-height: 56px;
  }

  #fluidModalAdd {
    min-height: 48px;
  }

  .footer-grid {
    gap: 1.5rem;
  }

  .site-footer {
    padding-top: 2.5rem;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    text-align: center;
  }

  body.mobile-cart-visible .toast.show {
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-cart-visible .site-footer {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-cart-visible main {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }
}

.mobile-cart-bar {
  display: none;
}

@media (max-width: 767px) {
  .mobile-cart-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(89, 217, 63, 0.35);
    box-shadow: 0 -10px 28px rgba(17, 17, 17, 0.1);
  }

  .mobile-cart-bar[hidden] {
    display: none;
  }

  .mobile-cart-bar-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 52px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--green);
    color: var(--white);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--green-glow);
  }

  .mobile-cart-bar-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    text-align: left;
  }

  .mobile-cart-bar-label {
    font-size: 0.95rem;
    text-transform: uppercase;
    font-style: italic;
  }

  .mobile-cart-bar-count {
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.92;
  }

  .mobile-cart-bar-total {
    font-size: 1.15rem;
    white-space: nowrap;
  }
}

@media (hover: none) and (pointer: coarse) {
  .product-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--gray-300);
  }

  .product-card:hover::before {
    transform: scaleX(0);
  }

  .product-card:hover .product-photo {
    transform: none;
  }

  .btn:hover,
  .btn-primary:hover {
    transform: none;
  }
}

.btn-secondary {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.btn-small {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
}

.admin-body {
  background: #f7f8fa;
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.admin-login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 0.85rem;
  padding: 2rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.admin-login-card h1 {
  margin: 0;
  font-size: 1.5rem;
}

.admin-login-card label {
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-login-card input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}

.admin-login-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--gray-500);
}

.admin-back-link {
  justify-self: start;
  font-size: 0.88rem;
  color: var(--gray-700);
}

.admin-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  padding: 1.25rem 0;
}

.admin-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-header-inner h1 {
  margin: 0.15rem 0 0;
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-import-btn {
  cursor: pointer;
}

.admin-main {
  padding: 1.5rem 0 3rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-stat-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
}

.admin-stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
}

.admin-stat-card strong {
  font-size: 1.5rem;
}

.admin-toolbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-search {
  display: flex;
  gap: 0.75rem;
}

.admin-search input {
  flex: 1;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.admin-table th,
.admin-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid #ececec;
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

.admin-table th {
  position: sticky;
  top: 0;
  background: #fafafa;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table tr.is-hidden {
  opacity: 0.65;
}

.admin-part-cell {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.admin-part-cell img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
}

.admin-part-cell strong {
  display: block;
}

.admin-part-cell span,
.admin-part-cell small {
  display: block;
  color: var(--gray-500);
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-pill {
  display: inline-flex;
  margin-right: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-pill--live {
  color: var(--green-dark);
  background: var(--green-light);
}

.admin-pill--hidden {
  color: #8a2f2f;
  background: #ffe8e8;
}

.admin-pill--review {
  color: #8a5a00;
  background: #fff4d6;
}

.admin-empty {
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
}

.admin-pagination {
  margin-top: 1rem;
}

.admin-dialog {
  width: min(760px, calc(100% - 2rem));
  border: none;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

.admin-dialog::backdrop {
  background: rgba(17, 17, 17, 0.45);
}

.admin-dialog-body {
  padding: 1.25rem;
}

.admin-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-dialog-head h2 {
  margin: 0;
}

.admin-dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.admin-detail-block p {
  margin: 0.35rem 0;
  font-size: 0.9rem;
}

.admin-edit-fields {
  display: grid;
  gap: 0.85rem;
}

.admin-edit-fields label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-edit-fields input,
.admin-edit-fields select {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-weight: 400;
}

.admin-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

@media (max-width: 768px) {
  .admin-dialog-grid,
  .admin-search {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}
