/* ============================================
   Monterrico — Sistema de tema claro / oscuro
   ============================================ */

:root {
  color-scheme: light;

  --theme-bg: #ffffff;
  --theme-bg-alt: #f7f6f2;
  --theme-bg-elevated: #ffffff;
  --theme-bg-muted: #e8ebe3;
  --theme-bg-inverse: #0a0a0a;

  --theme-text: #333333;
  --theme-text-secondary: #555555;
  --theme-text-muted: #888888;
  --theme-text-inverse: #ffffff;
  --theme-heading: #ffffff;

  --theme-border: #cccccc;
  --theme-border-subtle: #eeeeee;

  --theme-header-bg: #ffffff;
  --theme-header-bg-scrolled: rgba(255, 255, 255, 0.92);
  --theme-header-border: transparent;

  --theme-footer-bg: #0a0a0a;
  --theme-footer-bg-soft: #1a1a1a;
  --theme-footer-text: rgba(255, 255, 255, 0.8);
  --theme-footer-text-muted: rgba(255, 255, 255, 0.5);
  --theme-footer-border: rgba(255, 255, 255, 0.1);

  --theme-card-bg: #ffffff;
  --theme-input-bg: #ffffff;
  --theme-overlay: rgba(0, 0, 0, 0.3);
  --theme-shadow: rgba(0, 0, 0, 0.1);
  --theme-hero-overlay: linear-gradient(
    105deg,
    rgba(10, 10, 10, 0.82) 0%,
    rgba(10, 10, 10, 0.5) 48%,
    rgba(36, 136, 72, 0.28) 100%
  );

  --color-white: var(--theme-bg);
  --color-bg-alt: var(--theme-bg-alt);
  --color-gray-100: var(--theme-bg-muted);
}

[data-theme="dark"] {
  color-scheme: dark;

  --theme-bg: #141412;
  --theme-bg-alt: #1c1c1a;
  --theme-bg-elevated: #242422;
  --theme-bg-muted: #2a2a28;
  --theme-bg-inverse: #e8e6e3;

  --theme-text: #e8e6e3;
  --theme-text-secondary: #b8b6b3;
  --theme-text-muted: #787674;
  --theme-text-inverse: #121412;
  --theme-heading: #ffffff;

  --theme-border: #3a3a38;
  --theme-border-subtle: #2e2e2c;

  --theme-header-bg: #121412;
  --theme-header-bg-scrolled: rgba(20, 20, 18, 0.96);
  --theme-header-border: #3a3a38;

  --theme-footer-bg: #0a0a09;
  --theme-footer-bg-soft: #1a1a18;
  --theme-footer-text: rgba(255, 255, 255, 0.82);
  --theme-footer-text-muted: rgba(255, 255, 255, 0.45);
  --theme-footer-border: rgba(255, 255, 255, 0.08);

  --theme-card-bg: #242422;
  --theme-input-bg: #1c1c1a;
  --theme-overlay: rgba(0, 0, 0, 0.55);
  --theme-shadow: rgba(0, 0, 0, 0.35);
  --theme-hero-overlay: linear-gradient(
    105deg,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.55) 48%,
    rgba(36, 136, 72, 0.32) 100%
  );

  --color-white: var(--theme-bg);
  --color-bg-alt: var(--theme-bg-alt);
  --color-gray-100: var(--theme-bg-muted);
  --color-gray-300: var(--theme-border);
  --color-gray-700: var(--theme-text-secondary);
  --color-gray-900: var(--theme-text);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.45);
}

body {
  background-color: var(--theme-bg);
  color: var(--theme-text);
  transition: background-color 0.35s ease, color 0.35s ease;
}

.site-header {
  background: var(--theme-header-bg);
}

.site-header.is-scrolled {
  background: var(--theme-header-bg-scrolled);
}

.site-header.is-scrolled .header-inner {
  border-bottom-color: var(--theme-border);
}

.logo { color: var(--theme-text); }

[data-theme="dark"] .site-header .logo-name {
  color: var(--color-green);
}

[data-theme="dark"] .logo--footer .logo-name {
  color: #ffffff;
}

.nav-trigger,
.nav-link { color: var(--theme-text); }

.nav-toggle-bar { background: var(--theme-text); }

.search-btn,
.theme-toggle { color: var(--theme-text-secondary); }

.search-btn:hover,
.theme-toggle:hover {
  background: var(--theme-bg-muted);
  color: var(--color-terracotta);
}

.btn-outline {
  color: var(--theme-text);
  border-color: var(--theme-text);
}

.btn-outline:hover {
  background: var(--theme-text);
  color: var(--theme-bg);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.mega-menu {
  background: var(--theme-bg-elevated);
  border-top-color: var(--theme-border);
}

.mega-menu-overlay { background: var(--theme-overlay); }

.mega-column a { color: var(--theme-text); }

.mega-card { background: var(--theme-bg-muted); }

.mega-card-body p { color: var(--theme-text-secondary); }

.hero-overlay { background: var(--theme-hero-overlay); }

[data-theme="dark"] .hero h1,
[data-theme="dark"] .page-hero-content h1,
[data-theme="dark"] .page-hero__content h1,
[data-theme="dark"] .page-hero--legal .page-hero-content h1,
[data-theme="dark"] .page-hero--legal .page-hero__content h1 {
  color: #ffffff;
}

[data-theme="dark"] .hero-actions .btn-primary,
[data-theme="dark"] .hero-actions .btn-primary:hover,
[data-theme="dark"] .hero-actions .btn-ghost,
[data-theme="dark"] .hero-actions .btn-ghost:hover,
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-secondary:hover {
  color: #ffffff;
}

[data-theme="dark"] .hero-actions .btn-ghost:hover {
  border-color: #ffffff;
}

.section--alt { background: var(--theme-bg-alt); }

.section--alt .split-content p,
.section-intro,
.split-content p,
.page-section p,
.portal-card p,
.product-card p,
.content-card-body p,
.feature-list li { color: var(--theme-text-secondary); }

.section h2,
.section-title,
.page-section h2 { color: var(--theme-text); }

.section--dark .section h2,
.section--dark .split-content h2,
.section--dark .section-title {
  color: #ffffff;
}

.section--dark .split-content p,
.section--dark .feature-list li {
  color: rgba(255, 255, 255, 0.85);
}

.content-card,
.product-card,
.portal-card,
.team-card,
.related-card,
.application-card,
.industry-card,
.doc-item,
.specs-table-wrapper,
.stat-box,
.operations-map__card {
  background: var(--theme-card-bg);
  border-color: var(--theme-border);
}

.portal-card { background: var(--theme-bg-alt); }
.portal-card:hover { background: var(--theme-card-bg); }

.content-card-body h3,
.product-card h3,
.portal-card h3,
.team-card h3 { color: var(--theme-text); }

.site-footer {
  background: var(--theme-footer-bg);
  color: var(--theme-footer-text);
}

.logo--footer { color: #ffffff; }
.footer-heading { color: #ffffff; }
.footer-links a { color: var(--theme-footer-text); }
.footer-links a:hover { color: #ffffff; }
.footer-tagline { color: var(--theme-footer-text); }
.footer-bottom { border-top-color: var(--theme-footer-border); }
.footer-bottom p { color: var(--theme-footer-text-muted); }
.social-links a { background: var(--theme-footer-bg-soft); color: #ffffff; }

.stats { color: #ffffff; }

.page-hero--legal {
  background: var(--theme-bg-alt);
  border-bottom: 1px solid var(--theme-border);
}

.page-hero--legal .page-hero-content h1,
.page-hero--legal .page-hero__content h1 { color: var(--theme-text); }

.page-hero--legal .page-hero-subtitle,
.page-hero--legal .page-hero__subtitle { color: var(--theme-text-secondary); }

.page-hero--legal .page-hero-meta { color: var(--theme-text-muted); }

.page-hero--legal .breadcrumb li { color: var(--theme-text-muted); }
.page-hero--legal .breadcrumb a { color: var(--theme-text-secondary); }
.page-hero--legal .breadcrumb a:hover { color: var(--theme-text); }

.page-section + .page-section { border-top-color: var(--theme-border); }
.page-section--alt { background: var(--theme-bg-alt); }

.page-section__media figcaption { color: var(--theme-text-muted); }

.anchor-nav {
  background: var(--theme-header-bg-scrolled);
  border-bottom-color: var(--theme-border);
}

.anchor-nav a { color: var(--theme-text-secondary); }

.anchor-nav a:hover,
.anchor-nav a.is-active {
  color: var(--color-primary);
}

.legal-nav a { color: var(--theme-text-secondary); }
.legal-content p,
.legal-content li { color: var(--theme-text-secondary); }
.legal-content h2 {
  border-bottom-color: var(--theme-border-subtle);
  color: var(--theme-text);
}

.legal-highlight { background: var(--theme-bg-alt); }

[data-theme="dark"] .specs-table th,
[data-theme="dark"] .specs-table th[scope="row"],
[data-theme="dark"] .specs-table th[scope="col"] {
  color: var(--theme-text-secondary);
  background: var(--theme-bg-muted);
}

[data-theme="dark"] .specs-table caption {
  color: var(--theme-text-secondary);
  background: var(--theme-bg-muted);
  border-bottom-color: var(--theme-border-subtle);
}

[data-theme="dark"] .specs-table td {
  color: var(--theme-text-secondary);
}

[data-theme="dark"] .specs-table th,
[data-theme="dark"] .specs-table td {
  border-bottom-color: var(--theme-border-subtle);
}

.page-cta {
  background: var(--theme-bg-alt);
  border-top-color: var(--theme-border);
}

.page-cta p { color: var(--theme-text-secondary); }

.form-group input,
.form-group select,
.form-group textarea,
.search-form input {
  background: var(--theme-input-bg);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

.form-group input::placeholder,
.search-form input::placeholder { color: var(--theme-text-muted); }

[data-theme="dark"] .contact-section__form {
  background: var(--theme-bg-elevated);
  border-color: var(--theme-border);
}

[data-theme="dark"] .contact-section__form .form-group input,
[data-theme="dark"] .contact-section__form .form-group select,
[data-theme="dark"] .contact-section__form .form-group textarea {
  background: var(--theme-bg-muted);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

:root:not([data-theme="dark"]) .contact-section__form .form-group input,
:root:not([data-theme="dark"]) .contact-section__form .form-group select,
:root:not([data-theme="dark"]) .contact-section__form .form-group textarea {
  background: var(--theme-bg-alt);
  border-color: var(--theme-border);
}

.search-modal-panel {
  background: var(--theme-bg-elevated);
  color: var(--theme-text);
}

.search-modal-close { color: var(--theme-text-secondary); }
.search-modal-close:hover { background: var(--theme-bg-muted); }

.operations-map__card p { color: var(--theme-text-secondary); }
.operations-map__card h3 { color: var(--theme-text); }
.operations-map__hint { color: var(--color-green); }

.img-skeleton-wrap {
  background: linear-gradient(
    90deg,
    var(--theme-bg-muted) 25%,
    var(--theme-bg-alt) 50%,
    var(--theme-bg-muted) 75%
  );
  background-size: 200% 100%;
}

.news-card p { color: var(--theme-text-secondary); }
.news-card h3 a { color: var(--theme-text); }
.news-card time { color: var(--theme-text-muted); }

@media (max-width: 768px) {
  .primary-nav { background: var(--theme-bg-elevated); }
  .nav-trigger,
  .nav-link { border-bottom-color: var(--theme-border-subtle); }
  .header-actions { border-top-color: var(--theme-border-subtle); }
}

.site-header,
.mega-menu,
.content-card,
.product-card,
.portal-card,
.site-footer,
.anchor-nav,
.search-modal-panel {
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}
