/* ============================================
   RESET E VARIÁVEIS
   ============================================ */

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

/* Prevenir scrollbars horizontais em todos os elementos */
*,
*::before,
*::after {
    max-width: 100%;
}

/* Garantir que elementos com largura total não causem overflow */
img,
video,
iframe,
object,
embed {
    max-width: 100%;
    height: auto;
}

:root {
    --primary-color: #032233;
    --primary-color-light: rgba(3, 34, 52, 0.9);
    --primary-color-dark: #021a28;
    --accent-color: #D4AF37;
    --accent-color-hover: #C9A030;
    --text-dark: var(--primary-color);
    --text-light: #4a4a4a;
    --text-lighter: #6a6a6a;
    --bg-light: #F7F7F7;
    --bg-white: #FFFFFF;
    --bg-gray: #f0f0f0;
    --color-white: #FFFFFF;
    --color-white-hover: rgba(255, 255, 255, 0.95);
    --color-white-hover-light: #f5f5f5;
    --color-white-transparent: rgba(255, 255, 255, 0.9);
    --shadow-sm: 0 2px 8px rgba(3, 34, 52, 0.08);
    --shadow: 0 4px 12px rgba(3, 34, 52, 0.12);
    --shadow-md: 0 6px 16px rgba(3, 34, 52, 0.15);
    --shadow-hover: 0 8px 24px rgba(3, 34, 52, 0.2);
    --shadow-lg: 0 12px 32px rgba(3, 34, 52, 0.25);
    --focus-outline: 3px solid var(--primary-color);
    --focus-outline-offset: 2px;
    
    /* Tamanhos base responsivos - otimizados para todos os cenários */
    --font-size-base: clamp(0.9375rem, 0.9375vw + 0.5rem, 1.125rem);
    --spacing-xs: clamp(0.5rem, 1.5vw, 0.75rem);
    --spacing-sm: clamp(0.75rem, 2vw, 1rem);
    --spacing-md: clamp(1rem, 2.5vw, 1.5rem);
    --spacing-lg: clamp(1.5rem, 4vw, 2rem);
    --spacing-xl: clamp(2rem, 5vw, 3rem);
    --spacing-xxl: clamp(3rem, 7vw, 6.25rem);
    
    /* Card base styles - refinados e consistentes */
    --card-padding-y: clamp(1.5rem, 4vw, 2.5rem);
    --card-padding-x: clamp(1.25rem, 3vw, 1.875rem);
    --card-border-radius: 12px;
    --card-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border radius - consistente */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transitions - suaves e consistentes */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: clamp(14px, 1vw, 16px);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
}

/* Respeitar preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    overflow-x: hidden;
    font-size: var(--font-size-base);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--color-white);
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 10000;
    font-weight: 600;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    color: var(--color-white);
    outline: 3px solid var(--color-white);
    outline-offset: 2px;
}

/* Screen reader only - classe utilitária para acessibilidade */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Estilos de foco visível - WCAG 2.1 AA */
/* Fallback para navegadores sem suporte a :focus-visible */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Versão moderna com :focus-visible */
*:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
    border-radius: 2px;
}

/* Fallback para navegadores sem suporte a :focus-visible */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

button:focus-visible,
a:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
}

/* Garantir tamanho mínimo de toque (44x44px) para acessibilidade */
button,
a.btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Remover outline padrão - já aplicado acima */

/* ============================================
   UTILITÁRIOS
   ============================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 1.5rem);
    position: relative;
}

/* Imagens responsivas */
img {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Garantir que imagens não ultrapassem o container */
img[width],
img[height] {
    max-width: 100%;
    height: auto;
}

/* Imagens específicas com object-fit adequado */
.card__image-servico {
    object-fit: contain;
}

.card__image img,
.sobre-image img {
    object-fit: cover;
}

/* Scrollbar vertical - só aparece quando o conteúdo exceder a altura da viewport */
html {
    overflow-y: auto;
    /* Ocultar scrollbar horizontal se aparecer */
    scrollbar-width: thin;
    scrollbar-color: rgba(3, 34, 52, 0.3) transparent;
}

/* Estilizar scrollbar no WebKit (Chrome, Safari, Edge) */
html::-webkit-scrollbar {
    width: 8px;
}

html::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb {
    background-color: rgba(3, 34, 52, 0.3);
    border-radius: 4px;
}

html::-webkit-scrollbar-thumb:hover {
    background-color: rgba(3, 34, 52, 0.5);
}

body {
    overflow-y: auto;
}

/* ============================================
   MENSAGENS DE ERRO
   ============================================ */

.error-message {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background: var(--bg-light);
    border-left: 4px solid #dc3545;
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-size: clamp(0.9375rem, 1.8vw, 1.0625rem);
    line-height: 1.6;
    margin: clamp(1rem, 2.5vw, 1.5rem) 0;
    text-align: center;
}

