/* ========================================
   Mer-Plast Design System — Minimalist Modern
   Adapted from logo red palette
   ======================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Design Tokens --- */
:root {
  /* Colors — Logo-derived red palette */
  --background: #FAFAFA;
  --foreground: #3f0d0d;
  --muted: #F5F0F0;
  --muted-foreground: #6B6B7B;
  --accent: #B22222;
  --accent-secondary: #D4443B;
  --accent-foreground: #FFFFFF;
  --border: #E8E0E0;
  --card: #FFFFFF;
  --ring: #B22222;

  /* Gradient */
  --gradient: linear-gradient(135deg, #B22222, #D4443B);
  --gradient-subtle: linear-gradient(135deg, rgba(178,34,34,0.08), rgba(212,68,59,0.04));

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
  --shadow-accent: 0 4px 14px rgba(178,34,34,0.25);
  --shadow-accent-lg: 0 8px 24px rgba(178,34,34,0.35);

  /* Typography */
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --container-max: 72rem;
  --section-py: 4.75rem;
  --section-py-lg: 5.5rem;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { 
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-body);
  color: var(--foreground);
  background: var(--background);
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

/* --- Utilities --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }

/* --- Section Label (Badge) --- */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(178,34,34,0.25);
  background: rgba(178,34,34,0.06);
  padding: 0.625rem 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
}

.section-badge .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--accent);
  animation: pulse-dot 2s infinite;
  box-shadow: 0 0 8px rgba(178,34,34,0.4);
}

.section-badge span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 600;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.05); opacity: 0.5; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 0.875rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:hover { transform: translateY(-3px); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--gradient);
  color: var(--accent-foreground);
  box-shadow: 0 4px 16px rgba(178,34,34,0.3);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(178,34,34,0.4);
  filter: brightness(1.1);
}

.btn-primary .arrow { transition: transform 0.3s; }
.btn-primary:hover .arrow { transform: translateX(6px); }

.btn-secondary {
  background: rgba(255,255,255,0.8);
  color: var(--foreground);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  border-color: rgba(178,34,34,0.3);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
  padding: 0.5rem 1rem;
}

.btn-ghost:hover { color: var(--foreground); }

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px) scale(1.015);
}

.card-featured {
  position: relative;
  border: none;
  padding: 2px;
  background: var(--gradient);
  border-radius: 1rem;
}

.card-featured .card-inner {
  background: var(--card);
  border-radius: calc(1rem - 2px);
  padding: 1.5rem;
  height: 100%;
}

/* --- Inverted Section --- */
.section-inverted {
  background: var(--foreground);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}

.section-inverted::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250,250,250,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.nav-logo img {
  height: 2.5rem;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  border-radius: 1px;
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: -1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.5rem;
  min-width: 240px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--foreground);
}

.nav-dropdown-menu a:hover {
  background: var(--muted);
  color: var(--accent);
}

/* Mobile menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--foreground);
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 4.5rem;
    left: 0;
    right: 0;
    background: var(--card);
    flex-direction: column;
    padding: 1rem 1.5rem 1.25rem;
    gap: 0.25rem;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  .nav-links > li,
  .nav-links > li > a {
    width: 100%;
  }
  .nav-links > li > a {
    display: block;
    padding: 0.8rem 0.5rem;
    border-radius: 0.5rem;
  }
  .nav-links > li > a:hover,
  .nav-links > li > a.active {
    background: var(--muted);
  }
  .nav-dropdown-menu {
    display: none;
  }
}

/* --- Hero --- */
.hero {
  padding-top: 8rem;
  padding-bottom: var(--section-py);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: #0a0a0a;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.6) 100%);
  z-index: 1;
}

.hero-content {
  max-width: 50rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.75rem, 5vw, 5.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-title--light {
  color: #FFFFFF;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  max-width: 42rem;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-subtitle--light {
  color: rgba(255,255,255,0.85);
}

.section-badge--light {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
}

.section-badge--light span {
  color: rgba(255,255,255,0.9);
}

.section-badge--light .dot {
  background: #FF6B6B;
}

.btn-secondary--light {
  background: rgba(255,255,255,0.15);
  color: #FFFFFF;
  border-color: rgba(255,255,255,0.3);
  backdrop-filter: blur(8px);
}

.btn-secondary--light:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}

.hero-highlight {
  color: #B22222;
  background: rgba(255,255,255,0.85);
  padding: 0.15rem 0.625rem;
  border-radius: 0.5rem;
  display: inline-block;
}

@media (max-width: 768px) {
  .hero { min-height: auto; padding-top: 7rem; }
  .hero-content { max-width: 100%; }
}

/* --- Client logos --- */
.clients-section {
  padding: 2.5rem 0 3rem;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.clients-heading {
  margin-bottom: 1.5rem;
  text-align: center;
}

.clients-heading h2 {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.clients-viewport {
  overflow: hidden;
}

.clients-track,
.clients-logos {
  display: flex;
  width: max-content;
}

.clients-logos {
  gap: 1rem;
  padding-right: 1rem;
}

.client-logo {
  display: flex;
  flex: 0 0 10.5rem;
  align-items: center;
  justify-content: center;
  width: 10.5rem;
  height: 6.5rem;
  padding: 0.875rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
}

.client-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.clients-track.is-animated {
  animation: clients-scroll 48s linear infinite;
}

@media (hover: hover) and (pointer: fine) {
  .clients-viewport:hover .clients-track,
  .clients-viewport:focus-within .clients-track {
    animation-play-state: paused;
  }
}

@keyframes clients-scroll {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .clients-viewport { overflow-x: auto; }
  .clients-track.is-animated { animation: none; }
  .clients-logos-copy { display: none; }
}

/* --- Sections --- */
.section { 
  padding: var(--section-py) 0; 
  overflow: hidden;
}
.section-lg { padding: var(--section-py-lg) 0; }

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  max-width: 42rem;
  line-height: 1.8;
}

/* --- Home responsive layouts --- */
.home-about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 4rem;
  align-items: start;
}

.home-stats-panel {
  min-width: 0;
  padding: 3rem;
  border-radius: 1.5rem;
  position: relative;
  overflow: hidden;
}

.stats-grid.home-stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
}

.home-stats-grid .stat-number {
  font-variant-numeric: tabular-nums;
}

.home-corrocoat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4rem;
  align-items: center;
}

.home-corrocoat-visual {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
}

.home-corrocoat-orbit {
  position: relative;
  width: min(20rem, 100%);
  aspect-ratio: 1;
}

@media (max-width: 900px) {
  .home-about-grid,
  .home-corrocoat-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.product-grid--four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-grid--three-four {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.product-grid--three-four > :nth-child(-n + 3) {
  grid-column: span 4;
}

.product-grid--three-four > :nth-child(n + 4) {
  grid-column: span 3;
}

@media (max-width: 900px) {
  .product-grid--four-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-grid--three-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-grid--three-four > * {
    grid-column: auto;
  }
}

.product-card {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.product-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  transform: translateY(-8px);
  border-color: rgba(178,34,34,0.2);
}

.product-card:hover::before {
  opacity: 1;
}

.product-card:hover .product-card-img-placeholder,
.product-card:hover img,
.product-card:hover .product-card-video {
  transform: scale(1.08);
  filter: brightness(1.05);
}

.product-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card img {
  display: block;
  object-fit: cover;
  object-position: center;
  background-repeat: no-repeat;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.product-card-body {
  padding: 1.5rem;
}

.product-card-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.625rem;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.product-card-body p {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.7;
}

.product-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
  transition: all 0.3s;
}

.product-card-link:hover {
  gap: 0.875rem;
  color: var(--accent-secondary);
}

/* --- Stats --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
  text-align: center;
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.section-inverted .stat-number {
  background: linear-gradient(135deg, #FF6B6B, #FFA07A);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.section-inverted .stat-label { color: rgba(255,255,255,0.7); }

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: start;
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--background);
  transition: all 0.3s;
  margin-bottom: 1.25rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(178,34,34,0.1);
  background: var(--card);
}

.contact-form textarea { min-height: 160px; resize: vertical; }

.contact-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-status {
  min-height: 1.5rem;
  margin-top: 0.875rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-status.is-success { color: #176b3a; }
.contact-status.is-error { color: #a11c1c; }
.contact-form .btn:disabled { cursor: wait; opacity: 0.7; transform: none; }

.contact-info-item {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding: 1.25rem;
  border-radius: 1rem;
  transition: all 0.3s;
}

.contact-info-item:hover {
  background: var(--muted);
}

.contact-info-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(178,34,34,0.2);
}

.contact-info-icon svg { width: 1.5rem; height: 1.5rem; color: white; }

/* --- Footer --- */
.footer {
  background: var(--foreground);
  color: rgba(255,255,255,0.7);
  padding: 3rem 0 1.5rem;
}

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

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer h4 {
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer a {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  padding: 0.25rem 0;
  transition: color 0.2s;
}

.footer a:hover { color: #FFFFFF; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

@media (max-width: 768px) {
  .footer-bottom { flex-direction: column; gap: 0.75rem; text-align: center; }
}

/* --- Page Header (for inner pages) --- */
.page-header {
  padding: 7rem 0 2rem;
  background: var(--muted);
  text-align: center;
}

.page-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.25rem);
  margin-bottom: 0.5rem;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }

/* --- Animations (CSS-based) --- */
.fade-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in.will-animate {
  opacity: 0;
  transform: translateY(28px);
}

.fade-in.will-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger.will-animate > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger.will-animate.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.will-animate.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.will-animate.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger.will-animate.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger.will-animate.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger.will-animate.visible > *:nth-child(6) { transition-delay: 0.3s; }

.stagger.will-animate.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Float animation */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.float { animation: float 5s ease-in-out infinite; }
.float-delay { animation: float 4s ease-in-out infinite 0.5s; }

/* Rotate */
@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotate-slow { animation: rotate-slow 60s linear infinite; }

/* --- CTA Section --- */
.cta-section {
  position: relative;
  overflow: hidden;
}

/* --- WhatsApp Button --- */
.whatsapp-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.375rem;
  height: 3.375rem;
  border-radius: 9999px;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 16px rgba(37,211,102,0.3);
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(37,211,102,0.5);
}

.whatsapp-btn svg { width: 1.875rem; height: 1.875rem; color: white; }

/* --- Sub-product sidebar layout --- */
.sub-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  padding: 3rem 0;
}

@media (max-width: 768px) {
  .sub-layout { grid-template-columns: 1fr; }
}

.sidebar { position: sticky; top: 6rem; align-self: start; }

.sidebar-link {
  display: block;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: all 0.2s;
  border-left: 2px solid transparent;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: var(--accent);
  background: rgba(178,34,34,0.05);
  border-left-color: var(--accent);
}

/* --- Image Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.gallery-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.gallery-grid img:hover {
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
}

/* --- Specs / Technical Content --- */
.specs-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
  color: var(--foreground);
}

.specs-content p {
  margin-bottom: 1rem;
  line-height: 1.75;
  color: var(--muted-foreground);
}

.specs-content strong { color: var(--foreground); }

.specs-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.specs-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* --- Technical Tables --- */
.specs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.specs-content table thead {
  background: var(--gradient);
  color: #FFFFFF;
}

.specs-content table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.specs-content table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.specs-content table tbody tr:hover {
  background: rgba(178, 34, 34, 0.03);
}

.specs-content table tbody tr:last-child td {
  border-bottom: none;
}

/* --- Responsive Overflow Fixes --- */
@media (max-width: 768px) {
  .hero-video {
    object-position: center center;
  }
  
  .hero-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.7) 100%);
  }
  
  .section-inverted {
    overflow: hidden;
  }
  
  .section-inverted .float,
  .section-inverted .float-delay {
    display: none;
  }
  
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  
  .section-title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }
  
  .contact-form {
    padding: 1.5rem;
  }
  
  .stats-grid {
    gap: 1.5rem;
  }
  
  .stat-number {
    font-size: 2.25rem;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
  }
  
  .sub-layout {
    grid-template-columns: 1fr;
  }
}

/* Source-aligned product catalogue */
.source-content {
  max-width: 58rem;
}

.source-content:has(.source-gallery),
.source-content:has(.product-grid) {
  max-width: 72rem;
}

.source-content > * + * {
  margin-top: 1.25rem;
}

.source-content > h2,
.source-content > h3 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.source-content > h2:first-child,
.source-content > h3:first-child {
  margin-top: 0;
}

.source-content p,
.source-content li {
  color: var(--muted-foreground);
  font-size: 1.025rem;
  line-height: 1.85;
}

.source-content ul,
.source-content ol {
  display: grid;
  gap: 0.65rem;
  padding-left: 1.4rem;
}

.source-content strong {
  color: var(--foreground);
}

.source-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.source-gallery:not(.source-gallery-enhanced) a,
.source-gallery:not(.source-gallery-enhanced) > img {
  min-height: 14rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fff;
  overflow: hidden;
}

.source-gallery:not(.source-gallery-enhanced) img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 14rem;
  max-height: 28rem;
  object-fit: contain;
}

.source-gallery.source-gallery-enhanced {
  display: block;
}

.product-carousel {
  width: 100%;
}

.product-carousel-stage {
  position: relative;
  min-height: min(62vh, 42rem);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(145deg, #fff, #f6f7f9);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.product-carousel-zoom {
  width: 100%;
  min-height: min(62vh, 42rem);
  display: grid;
  place-items: center;
  padding: 2.5rem 5rem;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.product-carousel-main {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 36rem;
  object-fit: contain;
}

.product-carousel-zoom-hint,
.product-carousel-counter {
  position: absolute;
  bottom: 1rem;
  z-index: 2;
  border-radius: 999px;
  background: rgba(16, 18, 28, 0.78);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.product-carousel-zoom-hint {
  right: 1rem;
  padding: 0.45rem 0.8rem;
}

.product-carousel-counter {
  left: 1rem;
  padding: 0.45rem 0.75rem;
}

.product-carousel-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(16, 18, 28, 0.78);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.product-carousel-nav:hover {
  background: var(--accent);
  transform: translateY(-50%) scale(1.06);
}

.product-carousel-nav svg,
.product-lightbox-nav svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

.product-carousel-prev { left: 1rem; }
.product-carousel-next { right: 1rem; }

.product-carousel-thumbnails {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.25rem 0.1rem 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.product-carousel-thumbnail {
  flex: 0 0 6.5rem;
  width: 6.5rem;
  height: 5rem;
  padding: 0.25rem;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: center;
  opacity: 0.7;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.product-carousel-thumbnail:hover,
.product-carousel-thumbnail.active {
  opacity: 1;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.product-carousel-thumbnail img {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0.45rem;
  object-fit: cover;
}

/* Single-image carousel: hide nav, counter, and thumbnails */
.product-carousel.single-image .product-carousel-nav,
.product-carousel.single-image .product-carousel-counter,
.product-carousel.single-image .product-carousel-thumbnails {
  display: none;
}

.product-lightbox {
  width: min(94vw, 88rem);
  height: min(92vh, 58rem);
  margin: auto;
  padding: 2.5rem;
  border: 0;
  border-radius: 1rem;
  background: rgba(12, 14, 22, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  -webkit-user-select: none;
  user-select: none;
}

.product-lightbox::backdrop {
  background: rgba(5, 7, 12, 0.78);
  backdrop-filter: blur(5px);
}

.product-lightbox img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}

.product-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
}

.product-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
}

.product-lightbox-nav:hover,
.product-lightbox-nav:focus-visible {
  background: var(--accent);
}

.product-lightbox-prev { left: 0.75rem; }
.product-lightbox-next { right: 0.75rem; }

.product-lightbox.single-image .product-lightbox-nav {
  display: none;
}

.source-card-image {
  width: 100%;
  height: 14rem;
  overflow: hidden;
  background: #fff;
}

.source-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background-repeat: no-repeat;
}

.product-grid--contain-images .source-card-image img {
  object-fit: contain;
}

.source-product-card .product-card-body {
  min-height: 8.5rem;
}

.source-wide-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem auto 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fff;
}

.source-notice {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

/* Specification pages */
.spec-article > h2:first-child {
  margin-bottom: 1.5rem;
}

.spec-block {
  display: grid;
  /*grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.75fr);*/
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--border);
}

.spec-block img {
  display: block;
  width: 100%;
  max-height: 24rem;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.spec-definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0 3rem;
}

.spec-definition-grid > div {
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.spec-definition-grid h4 {
  margin: 0 0 0.55rem;
  color: var(--accent);
}

.spec-definition-grid p {
  margin: 0;
}

.spec-data-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 2rem 0;
}

.spec-data-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: var(--surface, #f7f7f8);
}

.spec-data-list span {
  color: var(--muted-foreground);
}

.spec-data-list strong {
  color: var(--foreground);
  text-align: right;
}

.spec-numbered-list {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
  padding-left: 1.5rem;
}

.spec-numbered-list li {
  padding-left: 0.4rem;
}

@media (max-width: 900px) {
  .source-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spec-block {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --section-py: 3.25rem;
    --section-py-lg: 4rem;
  }

  .container,
  .nav-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .page-header {
    padding-top: 6rem;
    padding-bottom: 1.5rem;
  }

  .page-header h1,
  .hero-title,
  .section-title,
  .breadcrumb,
  .source-content,
  .contact-info-item {
    overflow-wrap: anywhere;
  }

  .hero .btn {
    width: 100%;
    justify-content: center;
  }

  .home-stats-panel,
  .contact-form {
    padding: 1.5rem;
    border-radius: 1rem;
  }

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

  .stats-grid.home-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 1rem;
  }

  .home-corrocoat-orbit {
    width: min(17rem, 100%);
  }

  .contact-info-item {
    gap: 0.9rem;
    padding: 1rem 0;
  }

  .source-gallery {
    grid-template-columns: 1fr;
  }

  .product-carousel-stage,
  .product-carousel-zoom {
    min-height: 20rem;
  }

  .product-carousel-zoom {
    padding: 1.5rem 3.25rem;
  }

  .product-carousel-nav {
    width: 2.5rem;
    height: 2.5rem;
  }

  .product-carousel-prev { left: 0.5rem; }
  .product-carousel-next { right: 0.5rem; }

  .product-carousel-zoom-hint {
    display: none;
  }

  .product-lightbox {
    width: calc(100vw - 1rem);
    height: calc(100dvh - 1rem);
    padding: 3.5rem 1rem 1rem;
  }

  .product-lightbox-nav {
    width: 2.5rem;
    height: 2.5rem;
  }

  .product-lightbox-prev { left: 0.25rem; }
  .product-lightbox-next { right: 0.25rem; }

  .spec-definition-grid,
  .spec-data-list {
    grid-template-columns: 1fr;
  }

  .spec-data-list > div {
    flex-direction: column;
    gap: 0.3rem;
  }

  .spec-data-list strong {
    text-align: left;
  }
}

/* --- Motion and interaction polish --- */
:root { --motion-ease: cubic-bezier(0.22, 1, 0.36, 1); }

/* The indicator gives long product/specification pages a sense of place. */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 301;
  height: 3px;
  background: var(--gradient);
  box-shadow: 0 1px 8px rgba(178, 34, 34, 0.3);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

#productos, #contacto { scroll-margin-top: 5.5rem; }

.hero-video {
  transform: translate3d(0, var(--hero-shift, 0px), 0) scale(1.08);
  animation: hero-video-enter 1.6s var(--motion-ease) backwards;
  will-change: transform;
}

.hero-overlay {
  background: linear-gradient(105deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.57) 52%, rgba(0,0,0,0.42) 100%),
              radial-gradient(circle at 85% 30%, rgba(178,34,34,0.27), transparent 45%);
}

.hero::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 14rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.36));
  pointer-events: none;
}

@keyframes hero-video-enter {
  from { opacity: 0.35; transform: translate3d(0, 0, 0) scale(1.16); }
  to { opacity: 1; transform: translate3d(0, var(--hero-shift, 0px), 0) scale(1.08); }
}

/* A short, deliberate sequence makes every hero element readable as it enters. */
.hero-intro { animation: hero-content-enter 0.85s var(--motion-ease) backwards; }
.hero-intro--badge { animation-delay: 0.12s; --hero-enter-x: -18px; --hero-enter-y: 0px; }
.hero-intro--title { animation-delay: 0.26s; --hero-enter-x: 0px; --hero-enter-y: 34px; }
.hero-intro--subtitle { animation-delay: 0.49s; --hero-enter-x: 0px; --hero-enter-y: 24px; }

@keyframes hero-content-enter {
  from { opacity: 0; transform: translate3d(var(--hero-enter-x, 0px), var(--hero-enter-y, 22px), 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.hero-actions { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.hero-actions .btn { animation: hero-action-enter 0.7s var(--motion-ease) backwards; }
.hero-actions .btn:first-child { animation-delay: 0.76s; }
.hero-actions .btn:last-child { animation-delay: 0.88s; }
@keyframes hero-action-enter {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.96); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.hero-scroll-cue { animation: hero-cue-enter 0.7s var(--motion-ease) 1.1s backwards; }
@keyframes hero-cue-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-highlight { position: relative; isolation: isolate; overflow: hidden; }
.hero-highlight::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.65) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: highlight-sweep 1.1s var(--motion-ease) 1.15s both;
  pointer-events: none;
}
@keyframes highlight-sweep { to { transform: translateX(120%); } }

.hero-scroll-cue {
  position: absolute;
  z-index: 3;
  left: max(1.5rem, calc((100vw - var(--container-max)) / 2 + 1.5rem));
  bottom: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: rgba(255,255,255,0.84);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.25s ease;
}
.hero-scroll-cue:hover { color: #fff; }
.hero-scroll-cue-arrow {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 50%;
  font-family: var(--font-body);
  font-size: 1.1rem;
  transition: transform 0.3s var(--motion-ease), background 0.3s ease;
}
.hero-scroll-cue:hover .hero-scroll-cue-arrow { transform: translateY(4px); background: rgba(255,255,255,0.15); }

.page-header h1, .page-header .breadcrumb {
  animation: page-heading-enter 0.75s var(--motion-ease) both;
}
.page-header .breadcrumb { animation-delay: 0.12s; }
@keyframes page-heading-enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { transition-timing-function: var(--motion-ease); }
.fade-in.will-animate { transform: translateY(36px); }
.stagger.will-animate > * {
  transform: translateY(26px) scale(0.98);
  transition-duration: 0.65s;
  transition-timing-function: var(--motion-ease);
}
.stagger.will-animate.visible > * { transform: translateY(0) scale(1); }
.stagger.will-animate.visible > *:nth-child(n + 7) { transition-delay: 0.3s; }

@media (hover: hover) and (pointer: fine) {
  .stagger.will-animate.visible > .product-card:hover,
  .product-card:hover { transform: translateY(-8px) scale(1.012); }
  .product-card:hover .product-card-link span { transform: translateX(5px); }
  .nav-links > li > a:not(.active)::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -5px;
    height: 2px;
    border-radius: 2px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.28s var(--motion-ease);
  }
  .nav-links > li > a:not(.active):hover::after { transform: scaleX(1); }
}

.product-card-link span { transition: transform 0.3s var(--motion-ease); }
.product-card:focus-visible, .btn:focus-visible, .hero-scroll-cue:focus-visible,
.nav-links a:focus-visible, .nav-toggle:focus-visible, .product-carousel button:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 4px;
}
.hero .btn:focus-visible, .hero-scroll-cue:focus-visible { outline-color: #fff; }
.product-card:focus-visible { transform: translateY(-5px); box-shadow: var(--shadow-xl); }

@media (max-width: 768px) {
  .hero { padding-bottom: 3rem; flex-direction: column; align-items: stretch; }
  .hero-scroll-cue { position: relative; left: auto; bottom: auto; align-self: flex-start; margin: 3rem 1rem 0; }
  .hero-video { transform: scale(1.08); }
}

@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; }
  .fade-in.will-animate, .stagger.will-animate > *, .page-header h1, .page-header .breadcrumb { opacity: 1; transform: none; }
  .hero-intro, .hero-actions .btn, .hero-scroll-cue { animation: none !important; opacity: 1; transform: none; }
  .hero { background: #161010 url('../img/home/banner1.jpg') center / cover no-repeat; }
  .hero-video { display: none; }
  .hero-highlight::after { display: none; }
}
