/**
 * ECODRIVO DESIGN SYSTEM — CORE STYLESHEET
 * Premium Electric Mobility Aesthetic: Charcoal, Warm White & Pure Emerald Green Accent.
 */

:root {
  /* Brand Palette */
  --color-brand-black: #111315;
  --color-brand-charcoal: #1a1d20;
  --color-brand-dark: #23272b;
  --color-brand-green: #10b981;
  --color-brand-green-hover: #059669;
  --color-brand-green-soft: #ecfdf5;
  --color-brand-white: #ffffff;
  --color-brand-offwhite: #f8fafc;
  --color-brand-subtle: #f1f5f9;

  /* Neutrals & Borders */
  --color-text-main: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-border-dark: #334155;

  /* Typography */
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout & Spacing */
  --max-width: 1240px;
  --header-height: 76px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.2);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--color-text-main);
  background-color: var(--color-brand-offwhite);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

img, svg, picture, video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-brand-black);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

h4 {
  font-size: 1.25rem;
}

p {
  color: var(--color-text-secondary);
}

p.lead {
  font-size: 1.15rem;
  line-height: 1.7;
}

.text-accent {
  color: var(--color-brand-green);
}

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

.text-white {
  color: var(--color-brand-white) !important;
}

.text-center {
  text-align: center;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section {
  padding: 80px 0;
}

.section-sm {
  padding: 48px 0;
}

.section-lg {
  padding: 100px 0;
}

.bg-white {
  background-color: var(--color-brand-white);
}

.bg-light {
  background-color: var(--color-brand-offwhite);
}

.bg-dark {
  background-color: var(--color-brand-black);
  color: var(--color-brand-white);
}

.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4 {
  color: var(--color-brand-white);
}

.bg-dark p {
  color: #94a3b8;
}

.section-header {
  margin-bottom: 48px;
}

.section-header.text-center {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-brand-green);
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-top: 12px;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 32px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .section {
    padding: 60px 0;
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .section {
    padding: 48px 0;
  }
}

/* Announcement Bar */
.announcement-bar {
  background-color: var(--color-brand-black);
  color: #cbd5e1;
  font-size: 0.8rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.announcement-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 640px) {
  .announcement-bar {
    font-size: 0.75rem;
    padding: 6px 0;
  }
  .announcement-inner {
    justify-content: center;
    text-align: center;
    gap: 6px;
  }
  .announcement-showroom {
    font-size: 0.725rem;
  }
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: all var(--transition-normal);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo img {
  height: 42px;
  width: auto;
  max-width: 155px;
  object-fit: contain;
  transition: height var(--transition-fast);
}

.nav-desktop,
.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--color-text-main);
  padding: 8px 12px;
  position: relative;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--color-brand-green);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background-color: var(--color-brand-green);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-header-cta .btn-text-short {
  display: none;
}

.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  color: var(--color-brand-black);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.mobile-toggle:hover, .mobile-toggle:focus-visible {
  background-color: var(--color-brand-subtle);
  border-color: var(--color-border);
}

@media (max-width: 1024px) {
  .nav-desktop,
  .site-nav {
    display: none !important;
  }
  .mobile-toggle {
    display: flex !important;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 64px;
  }
  .brand-logo img {
    height: 34px;
    max-width: 125px;
  }
  .header-actions {
    gap: 8px;
  }
  .header-actions .btn-whatsapp {
    padding: 8px 10px;
  }
  .header-actions .btn-whatsapp .btn-text {
    display: none;
  }
  .btn-header-cta {
    padding: 8px 12px;
    font-size: 0.825rem;
  }
}

@media (max-width: 400px) {
  :root {
    --header-height: 58px;
  }
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  .brand-logo img {
    height: 30px;
    max-width: 110px;
  }
  .header-actions {
    gap: 6px;
  }
  .header-actions .btn-whatsapp {
    padding: 6px 8px;
  }
  .btn-header-cta {
    padding: 6px 8px;
    font-size: 0.775rem;
  }
  .btn-header-cta .btn-text-full {
    display: none;
  }
  .btn-header-cta .btn-text-short {
    display: inline;
  }
  .mobile-toggle {
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
  }
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 360px;
  height: 100vh;
  height: 100dvh;
  background-color: var(--color-brand-white);
  z-index: 1100;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transition: right var(--transition-smooth);
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer.active {
  right: 0;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.drawer-close {
  background: none;
  border: 1px solid transparent;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
}

.drawer-close:hover {
  background-color: var(--color-brand-subtle);
  color: var(--color-brand-black);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.drawer-nav .nav-link {
  font-size: 1.05rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: block;
}

.drawer-nav .nav-link:hover, .drawer-nav .nav-link.active {
  background-color: var(--color-brand-green-soft);
  color: var(--color-brand-green-hover);
}

.drawer-nav .nav-link.active::after {
  display: none;
}

.drawer-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

/* Card & Section Utilities */
.responsive-card {
  background-color: var(--color-brand-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .responsive-card {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }
}

/* Target element scroll margins for sticky header */
[id] {
  scroll-margin-top: calc(var(--header-height) + 24px);
}

/* Footer */
.site-footer {
  background-color: var(--color-brand-black);
  color: #94a3b8;
  padding: 80px 0 32px;
  border-top: 1px solid var(--color-border-dark);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  margin-bottom: 60px;
}

.footer-col h4 {
  color: var(--color-brand-white);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

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

@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
}

@media (max-width: 600px) {
  .footer-top {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
