/* ============================================================
   GLOBAL.CSS — Ducarelli Pneus
   Design tokens · Reset · Botões globais · Skip link
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --color-primary:      #CC0000;
  --color-primary-dark: #990000;
  --color-black:        #0a0a0a;
  --color-surface:      #111111;
  --color-white:        #ffffff;
  --color-text-muted:   rgba(255, 255, 255, 0.70);
  --color-border:       rgba(255, 255, 255, 0.08);

  --font-main:     'Inter', sans-serif;
  --container-max: 1200px;
  --radius:        4px;
  --transition:    all 0.3s ease;
}

/* ── Header sticky ─────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--color-black);
  height: 70px;
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.3s ease;
}
header.scrolled {
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

/* ── Scroll offset para links âncora (compensa header sticky) ── */
section[id],
div[id] {
  scroll-margin-top: 70px;
}

/* ── Overflow mobile ───────────────────────────────────────── */
body {
  overflow-x: hidden;
  max-width: 100%;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  max-width: 100%;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--color-black);
  color: var(--color-white);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img  { max-width: 100%; height: auto; display: block; }
a    { text-decoration: none; }
ul   { list-style: none; margin: 0; padding: 0; }

/* ── Skip link ─────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus-visible { top: 0; }

/* ── :focus-visible global ─────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* ── .btn-primary ──────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(204, 0, 0, 0.35);
}

/* ── .btn-secondary ────────────────────────────────────────── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: var(--color-white);
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-secondary:hover {
  border-color: var(--color-white);
  background: rgba(255, 255, 255, 0.08);
}

/* ── .btn-white ────────────────────────────────────────────── */
.btn-white {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-white);
  color: var(--color-primary);
  padding: 1.1rem 2.5rem;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-white:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

/* ── a.service-card — card de serviço completamente clicável ── */
a.service-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.service-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(204,0,0,0.15);
}

.service-link {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: auto;
}

/* ============================================================
   DROPDOWN DE SERVIÇOS — nav header
   ============================================================ */

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* Área invisível que conecta trigger ao menu */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 1rem;
  background: transparent;
}

/* Trigger */
.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active {
  color: var(--color-primary);
}

/* Seta — rotaciona ao abrir */
.dropdown-arrow {
  transition: transform 0.25s ease;
  flex-shrink: 0;
  max-width: none;
}
.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.open  .dropdown-arrow {
  transform: rotate(180deg);
}

/* Menu dropdown */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 1rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 300px;
  white-space: nowrap;
  background: var(--color-black);
  border: 1px solid var(--color-border);
  border-top: 2px solid var(--color-primary);
  border-radius: 0 0 8px 8px;
  padding: 0.5rem 0;
  list-style: none;
  margin: 0;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

/* Manter aberto enquanto mouse está no dropdown inteiro (trigger + área + menu) */
@media (min-width: 1025px) {
  .nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    pointer-events: all;
  }
}

/* Triângulo decorativo */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 6px;
  background: var(--color-primary);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* Links do submenu */
.dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 400;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  max-width: none;
}
.dropdown-menu li a:hover {
  color: var(--color-primary);
  background: rgba(204,0,0,0.06);
  padding-left: 1.75rem;
}
.dropdown-menu li a svg {
  flex-shrink: 0;
  stroke: var(--color-primary);
  max-width: none;
}

/* Separador entre itens */
.dropdown-menu li + li {
  border-top: 1px solid var(--color-border);
}

/* ── Mobile ≤ 1024px ────────────────────────────────────────── */
@media (max-width: 1024px) {

  /* Menu mobile abre abaixo do header */
  #main-nav {
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--color-black);
    flex-direction: column;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
    z-index: 98;
    display: none;
    align-items: flex-start;
  }
  #main-nav.menu-open {
    display: flex;
  }

  /* Links diretos do nav */
  #main-nav > a {
    width: 100%;
    padding: 0.85rem 1.5rem;
    color: var(--color-text-muted);
    font-size: 1rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
  }
  #main-nav > a:hover {
    color: var(--color-primary);
    background: rgba(255,255,255,0.03);
  }

  /* Dropdown mobile */
  .nav-dropdown {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px solid var(--color-border);
  }
  .nav-dropdown-trigger {
    width: 100%;
    padding: 0.85rem 1.5rem;
    justify-content: space-between;
    font-size: 1rem;
  }

  /* Submenu mobile */
  .dropdown-menu {
    position: static;
    transform: none;
    left: auto;
    min-width: 100%;
    width: calc(100% - 1.5rem);
    border: none;
    border-top: none;
    border-left: 3px solid var(--color-primary);
    border-radius: 0;
    background: rgba(255,255,255,0.02);
    padding: 0.5rem 0;
    margin-left: 1.5rem;
    box-shadow: none;
    opacity: 1;
    pointer-events: all;
  }
  .dropdown-menu::before { display: none; }
  .dropdown-menu::after  { display: none; }

  /* Itens do submenu mobile */
  .dropdown-menu li a {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    white-space: normal;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  .dropdown-menu li a:hover {
    color: var(--color-primary);
    background: rgba(204,0,0,0.05);
    padding-left: 1.5rem;
  }

  /* Submenu começa fechado no mobile */
  .nav-dropdown:not(.open) .dropdown-menu { display: none; }
  .nav-dropdown.open .dropdown-menu       { display: block; }

  /* Remove área invisível no mobile */
  .nav-dropdown::after { display: none; }
}

/* ============================================================
   FOOTER — compartilhado por todas as páginas
   ============================================================ */
footer {
  background: var(--color-black);
  border-top: 1px solid var(--color-border);
  padding: 3.5rem 0 0;
}

.footer-grid {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem) 3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}

.footer-brand img {
  margin-bottom: 1rem;
}

.footer-brand p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  font-style: normal;
}

.footer-badges {
  display: flex;
  gap: 0.75rem;
}

.footer-badge {
  border: 1px solid var(--color-border);
  padding: 0.3rem 0.75rem;
  border-radius: 3px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: normal;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
}
.footer-badge:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.footer-links h4,
.footer-contact h4 {
  color: var(--color-white);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.footer-links ul,
.footer-contact ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a,
.footer-contact a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-style: normal;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-contact a:hover {
  color: var(--color-primary);
}

.footer-contact li {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-style: normal;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.5;
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem clamp(1.5rem, 5vw, 3rem);
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 0;
  font-style: normal;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  margin: 0;
  font-style: normal;
  text-align: center;
}

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

/* ============================================================
   WHATSAPP FLOAT — botão fixo global
   ============================================================ */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  z-index: 999;
  transition: all 0.3s ease;
  animation: whatsapp-pulse 2.5s ease-in-out infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,0.5);
}

.whatsapp-tooltip {
  position: absolute;
  right: 70px;
  background: #0a0a0a;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-family: var(--font-main);
}

.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
}

@keyframes whatsapp-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,0.4); }
  50%       { box-shadow: 0 4px 32px rgba(37,211,102,0.7), 0 0 0 8px rgba(37,211,102,0.1); }
}

@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 52px;
    height: 52px;
  }
  .whatsapp-tooltip { display: none; }
}
