/* ============================================
   EcoSistemas · Base Design System
   v2.0 · Consolidated
   ============================================ */

:root {
  --eco-primary: #FE7C00;
  --eco-secondary: #0069A8;
  --eco-whatsapp: #25D366;
  --eco-black: #000;
  --eco-white: #fff;
  --eco-detail: #fbfbfd;
  --eco-ink: #1d1d1f;
  --eco-subtle: #86868b;
  --eco-body: #515154;
  --eco-accent: #A8D0E8;
  --eco-border-light: #e8e8ed;
  --eco-border-mid: #d0d7de;
  --eco-border-grid: #d2d2d7;
  --eco-card: #f5f5f7;
  --eco-viewport-border: clamp(20px, 5vw, 40px);
  --eco-radius: 12px;
  --eco-radius-sm: 8px;
  --eco-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --eco-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --eco-z-sticky: 100;
  --eco-z-float: 200;
  --eco-z-modal: 1000;
}

/* ============================================
   1. RESET & BASE
   ============================================ */

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

html {
  min-width: 320px;
  background: var(--eco-black);
}

body {
  height: 100vh;
  min-height: 100dvh;
  border: var(--eco-viewport-border) solid var(--eco-black);
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  color: var(--eco-ink);
  background: var(--eco-black);
  overflow: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

button {
  cursor: pointer;
}

img,
svg,
iframe {
  max-width: 100%;
}

/* ============================================
   2. TYPOGRAPHY
   ============================================ */

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* ============================================
   3. FOCUS
   ============================================ */

:focus-visible {
  outline: 3px solid var(--eco-primary);
  outline-offset: 3px;
}

/* ============================================
   4. UTILITIES
   ============================================ */

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

/* ============================================
   5. NAVIGATION (btn-group flotante)
   ============================================ */

.btn-group {
  position: fixed;
  top: calc(var(--eco-viewport-border) + 16px);
  left: calc(var(--eco-viewport-border) + 16px);
  z-index: var(--eco-z-float);
  display: flex;
  gap: 8px;
}

.btn-group a,
.btn-group button {
  width: 44px;
  height: 44px;
  box-sizing: content-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--eco-radius-sm);
  color: #fff;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-group a:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}

/* ============================================
   6. GRID SYSTEM
   ============================================ */

.grid-layout,
.grid,
.viewport {
  height: calc(100dvh - (var(--eco-viewport-border) * 2));
  min-height: 520px;
}

.grid-cell {
  border: 2px solid var(--eco-black);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--eco-radius);
  background: var(--eco-white);
}

.pad,
.grid-cell,
.full,
.half,
.split-pad,
.media,
.split-cell {
  border-radius: var(--eco-radius);
}

/* ============================================
   7. PAD (scrollable container)
   ============================================ */

.pad {
  height: 100%;
  border: 2px solid var(--eco-black);
  border-radius: var(--eco-radius);
  background: var(--eco-detail);
  overflow-y: auto;
}

/* ============================================
   8. SPLIT / HALF SYSTEM
   ============================================ */

.split {
  display: flex;
  width: 100%;
}

.hero-split,
.split {
  height: calc(100dvh - (var(--eco-viewport-border) * 2) - 48px);
}

/* Half base — structural only; font-size stays page-specific */
.half {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--eco-ink);
  background: var(--eco-white);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  overflow: hidden;
  position: relative;
  padding: 32px 16px;
  transition: flex 1.8s var(--eco-ease), background 0.6s, color 0.6s,
    transform 1.2s var(--eco-ease), box-shadow 1.2s var(--eco-ease);
}

.half + .half {
  border-left: 2px solid var(--eco-black);
}

.half:hover {
  flex: 2.8;
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* Text morph */
.half .txt {
  pointer-events: none;
  text-align: center;
}

.half .txt .s {
  display: inline-block;
  transition: opacity 1.2s, transform 1.8s var(--eco-ease),
    font-size 1.8s var(--eco-ease);
  will-change: transform, opacity;
}

.half .txt .f {
  position: absolute;
  left: 12px;
  right: 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 1.2s 0.15s;
  white-space: nowrap;
}

.half:hover .txt .s {
  opacity: 0;
}

.half:hover .txt .f {
  opacity: 1;
}

/* Cross-rotation */
.split:has(.half:first-child:hover) .half:last-child .txt .s,
.split:has(.half:last-child:hover) .half:first-child .txt .s {
  transform: rotate(90deg);
  font-size: 0.5em;
  white-space: nowrap;
}

/* ============================================
   9. FULL-WIDTH VARIANT
   ============================================ */

.full {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--eco-ink);
  background: var(--eco-white);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  width: 100%;
  padding: 64px;
  position: relative;
  transition: background 0.6s, color 0.6s, transform 1.2s var(--eco-ease),
    box-shadow 1.2s var(--eco-ease);
}

.full:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.full .txt {
  pointer-events: none;
  text-align: center;
  line-height: 1;
}

.full .txt .s {
  transition: opacity 1.2s, transform 1.8s var(--eco-ease),
    font-size 1.8s var(--eco-ease);
}

.full .txt .f {
  position: absolute;
  left: 12px;
  right: 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 1.2s 0.15s;
  white-space: nowrap;
  font-size: 0.65em;
}

.full:hover .txt .s {
  opacity: 0;
}

.full:hover .txt .f {
  opacity: 1;
}

/* ============================================
   10. CONTACTO SPLIT (sp-half)
   ============================================ */

.split-pad {
  padding: 0;
  overflow: hidden;
  cursor: default;
}

.split-pad:hover {
  background: var(--eco-white);
  color: var(--eco-black);
  transform: none;
  box-shadow: none;
}

.sp-half {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--eco-ink);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  position: relative;
  border-right: 1px solid var(--eco-black);
  transition: flex 1.8s var(--eco-ease), background 0.3s, color 0.3s;
}

.sp-half:last-child {
  border-right: none;
}

.sp-half:hover {
  flex: 2.8;
  background: var(--eco-whatsapp);
  color: var(--eco-white);
}

.sp-half .s {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s, transform 1.2s var(--eco-ease);
}

.sp-half .s svg {
  width: 1em;
  height: 1em;
  fill: var(--eco-whatsapp);
}

.sp-half:hover .s {
  opacity: 0;
}

.sp-half:hover .s svg {
  fill: var(--eco-white);
}

.sp-half .f {
  position: absolute;
  opacity: 0;
  font-size: 0.45em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.7s 0.05s;
}

.sp-half:hover .f {
  opacity: 1;
}

/* ============================================
   11. DETAIL PAGE SHELL
   ============================================ */

/* Sticky nav */
nav {
  height: 48px;
  background: rgba(251, 251, 253, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: var(--eco-z-sticky);
  flex-shrink: 0;
}

nav a {
  text-decoration: none;
  color: var(--eco-ink);
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.5;
  transition: opacity 0.2s;
}

nav a:hover {
  opacity: 1;
}

nav span {
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: -0.01em;
}

/* Hero split */
.hero-split {
  display: flex;
}

.hero-left {
  flex: 1;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hero-right {
  flex: 1;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.hero-left h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.hero-left .sub {
  color: var(--eco-subtle);
  font-size: clamp(0.85rem, 1.3vw, 1rem);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Content area */
.content-wrap {
  padding: 40px 48px;
  overflow-wrap: anywhere;
}

.content-wrap p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--eco-body);
  max-width: 680px;
  margin: 0 0 20px;
}

.content-wrap h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--eco-primary);
  margin-top: 8px;
  border-radius: 2px;
}

.content-wrap .tag {
  display: inline-block;
  background: var(--eco-accent);
  color: var(--eco-ink);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

/* Brand grid inside content */
.content-wrap .brands {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 40px 0;
}

.content-wrap .brand {
  background: var(--eco-white);
  border: 1px solid var(--eco-border-grid);
  border-radius: var(--eco-radius);
  padding: 20px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  transition: all 0.3s ease;
}

.content-wrap .brand:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.content-wrap .brand img {
  max-width: 100%;
  max-height: 50px;
  object-fit: contain;
}

.content-wrap .brand .models {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--eco-subtle);
  margin-top: 8px;
}

.content-wrap .btn {
  display: inline-block;
  background: var(--eco-accent);
  color: var(--eco-ink);
  border-radius: 980px;
  padding: 12px 22px;
  font-size: 17px;
  font-weight: 400;
  text-decoration: none;
  transition: all 0.2s;
}

.content-wrap .btn:hover {
  background: var(--eco-primary);
}

/* Footer */
.footer {
  text-align: center;
  padding: 10px 24px;
  color: var(--eco-subtle);
  font-size: 0.65rem;
  flex-shrink: 0;
}

/* ============================================
   12. CLIENT PAGE SPLIT
   ============================================ */

.client-split {
  display: flex;
}

.client-split {
  height: calc(100dvh - 80px - 48px);
}

.client-split .left {
  flex: 1;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.client-split .right {
  flex: 1;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.client-split .right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.client-split .left h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.client-split .left .sub {
  color: var(--eco-subtle);
  font-size: clamp(0.85rem, 1.3vw, 1rem);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ============================================
   13. BUTTONS & HELPERS
   ============================================ */

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--eco-radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--eco-accent);
  color: var(--eco-ink);
}

.btn-primary:hover {
  background: var(--eco-primary);
  color: var(--eco-white);
}

.btn-secondary {
  color: var(--eco-accent);
  border: 1.5px solid var(--eco-border-mid);
}

.btn-secondary:hover {
  border-color: var(--eco-accent);
}

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.info-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.info-tag {
  font-size: 0.7rem;
  color: var(--eco-subtle);
  background: #f0f4f8;
  border: 1px solid var(--eco-border-light);
  border-radius: 6px;
  padding: 5px 10px;
}

/* ============================================
   14. COMMERCIAL SECTION
   ============================================ */

.detail-commercial {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--eco-border-light);
}

.detail-commercial h2 {
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  letter-spacing: -0.02em;
}

.detail-commercial p {
  max-width: 760px;
  margin: 0 0 20px;
  color: var(--eco-body);
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.7;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
}

.detail-card {
  border: 1px solid var(--eco-border-light);
  border-radius: var(--eco-radius);
  background: var(--eco-card);
  padding: 16px;
}

.detail-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--eco-secondary);
}

.detail-card span {
  display: block;
  color: var(--eco-body);
  font-size: 0.92rem;
  line-height: 1.55;
}

.eco-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.eco-cta-row .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 20px;
  border-radius: var(--eco-radius-sm);
  border: 1.5px solid transparent;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.6s, color 0.6s, border-color 0.6s,
    transform 1.2s var(--eco-ease);
}

.eco-cta-row .btn:hover {
  transform: translateY(-2px);
}

.eco-cta-row .btn-primary {
  background: var(--eco-accent);
  color: var(--eco-ink);
}

.eco-cta-row .btn-primary:hover {
  background: var(--eco-primary);
  color: var(--eco-white);
}

.eco-cta-row .btn-secondary {
  background: transparent;
  color: var(--eco-secondary);
  border-color: var(--eco-border-mid);
}

.eco-cta-row .btn-secondary:hover {
  border-color: var(--eco-secondary);
  background: rgba(0, 105, 168, 0.06);
}

/* ============================================
   15. BRAND CELL (index + empresa)
   ============================================ */

.logo-bg {
  position: absolute;
  inset: 0;
  background: url("../logo/logo-o.svg") center / contain no-repeat;
  opacity: 0.2;
  transform: scale(1.15);
  pointer-events: none;
  transition: opacity 0.4s;
  z-index: 0;
}

.grid-cell.brand .logo-bg {
  opacity: 0.3;
}

.grid-cell.brand:hover .logo-bg {
  opacity: 0;
}

/* ============================================
   16. PAD-MOTION NORMALIZATION
   ============================================ */

.grid-cell,
.pad {
  transition: opacity 0.55s var(--eco-ease), transform 0.55s var(--eco-ease);
}

/* ============================================
   17. CONTENT WRAP HELPERS
   ============================================ */

.content-wrap,
.left,
.hero-left {
  overflow-wrap: anywhere;
}

.content-wrap p,
.left p,
.hero-left p,
.msg-card p,
.detail-commercial p {
  text-wrap: pretty;
}

/* ============================================
   18. INDUSTRIAL DARK ADMIN
   ============================================ */

.admin-locked {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--eco-black);
}

.admin-locked-panel {
  width: min(680px, 100%);
  border: 2px solid var(--eco-black);
  border-radius: var(--eco-radius);
  background: var(--eco-detail);
  padding: clamp(28px, 5vw, 56px);
}

.admin-locked-panel .kicker {
  margin: 0 0 16px;
  color: var(--eco-subtle);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-locked-panel h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.admin-locked-panel p {
  max-width: 58ch;
  margin: 0 0 24px;
  color: var(--eco-body);
  line-height: 1.7;
}

.admin-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--eco-white);
  text-decoration: none;
  font-weight: 700;
}

/* ============================================
   19. RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  :root {
    --eco-viewport-border: 20px;
  }

  body {
    border-width: var(--eco-viewport-border);
  }

  .grid-layout,
  .grid,
  .viewport {
    min-height: 420px;
  }

  .hero-split,
  .split {
    height: auto;
    min-height: calc(100dvh - (var(--eco-viewport-border) * 2) - 48px);
  }

  .btn-group {
    top: calc(var(--eco-viewport-border) + 16px) !important;
    left: calc(var(--eco-viewport-border) + 16px) !important;
  }

  /* Mobile cells */
  .half {
    padding: 20px 12px;
  }

  .full {
    padding: 32px;
  }

  .grid-cell {
    border-width: 2px;
    border-radius: 8px;
    padding: 32px;
  }

  .pad {
    border-width: 2px;
    border-radius: 8px;
  }

  /* Detail mobile */
  .hero-split {
    flex-direction: column;
  }

  .hero-split .hero-left {
    padding: 24px 20px;
  }

  .hero-split .hero-right {
    padding: 0 20px 20px;
  }

  nav {
    padding: 0 16px;
  }

  .content-wrap {
    padding: 24px 20px;
  }

  .content-wrap .brands {
    grid-template-columns: 1fr 1fr;
  }

  /* Client split mobile */
  .client-split {
    flex-direction: column;
  }

  .client-split .left {
    padding: 24px 20px;
  }

  .client-split .right {
    padding: 0 20px 20px;
  }
}

/* ============================================
   20. REDUCED MOTION
   ============================================ */

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