/* ==========================================================================
   1. VARIABLES & THEMING (CSS Custom Properties)
   ========================================================================== */
:root {
    /* Colors */
    --color-primary: #009dff; /* Cyan/Blue from Cotizar button */
    --color-primary-hover: #007acc;
    --color-text-dark: #001a35; /* Dark navy for headings */
    --color-text-muted: #556b82; /* Muted gray/blue for paragraphs */
    --color-bg-light: #ffffff;
    --color-bg-cyan: #e0faff; /* Light cyan background for sections */
    
    /* Gradients con azul clarito brillante y luminoso (cero verde) */
    --gradient-hero: 
        radial-gradient(circle at 0% 0%, rgba(0, 195, 255, 0.28) 0%, rgba(80, 215, 255, 0.12) 35%, transparent 65%), 
        radial-gradient(circle at 100% 0%, rgba(0, 195, 255, 0.25) 0%, rgba(80, 215, 255, 0.10) 35%, transparent 65%),
        linear-gradient(180deg, rgba(220, 248, 255, 0.55) 0%, rgba(238, 251, 255, 0.25) 35%, rgba(255, 255, 255, 0.8) 70%, #ffffff 100%);
    --gradient-text: linear-gradient(90deg, #001a35 0%, #009dff 100%);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-h1: clamp(3.5rem, 8vw, 7rem);
    --font-size-h2: clamp(2.5rem, 5vw, 4rem);
    --font-size-h3: clamp(1.5rem, 3vw, 2.5rem);
    --font-size-p: 1.125rem;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
    
    /* Layout */
    --container-width: 1280px;
    --border-radius-sm: 4px;
    --border-radius-pill: 50px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
}

/* ==========================================================================
   2. RESET & NORMALIZE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    color: var(--color-text-dark);
    background-color: var(--color-bg-light);
    background-image: var(--gradient-hero);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: 100% 100%;
    background-position: top center;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

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

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text-dark);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }

p {
    color: var(--color-text-muted);
    font-size: var(--font-size-p);
    margin-bottom: var(--spacing-sm);
}

.text-highlight {
    color: var(--color-primary);
}

.text-gradient {
    background: linear-gradient(135deg, #0052d4 0%, #0099ff 50%, #00d2ff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    padding-bottom: 0.22em;
    margin-bottom: -0.22em;
    padding-right: 0.05em;
    padding-left: 0.02em;
    animation: textGradientShift 7s ease infinite alternate;
}

.text-gradient-cyan {
    background: linear-gradient(135deg, #0072ff 0%, #00bfff 55%, #4de0ff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    padding-bottom: 0.22em;
    margin-bottom: -0.22em;
    padding-right: 0.05em;
    padding-left: 0.02em;
    animation: textGradientShift 7s ease infinite alternate;
}

@keyframes textGradientShift {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* ==========================================================================
   4. LAYOUT UTILITIES
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) 0;
}

.flex-row {
    display: flex;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

/* ==========================================================================
   5. BUTTONS (BEM Methodology + Requested IDs)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    border-radius: var(--border-radius-pill);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 1rem;
}

/* Modifiers con colores vivos del concepto */
.btn--primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0066ff 0%, #00c8ff 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 25px rgba(0, 160, 255, 0.35);
}

.btn--primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -80%;
    width: 45px;
    height: 200%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 255, 255, 0.25), 
        rgba(255, 255, 255, 0.65), 
        rgba(255, 255, 255, 0.25), 
        transparent
    );
    transform: rotate(25deg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn--primary:hover::after {
    opacity: 1;
    animation: btnShimmer 0.8s ease-in-out;
}

@keyframes btnShimmer {
    0% {
        left: -80%;
    }
    100% {
        left: 160%;
    }
}

.btn--primary:hover {
    background: linear-gradient(135deg, #0052d4 0%, #00b4f0 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 160, 255, 0.5);
}

.btn--outline {
    background-color: rgba(255, 255, 255, 0.9);
    color: #0062ff;
    border: 1.5px solid #00c8ff;
    box-shadow: 0 4px 15px rgba(0, 200, 255, 0.1);
}
.btn--outline:hover {
    background-color: #0062ff;
    color: #ffffff;
    border-color: #0062ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 98, 255, 0.3);
}

/* Specific Buttons via IDs */
#btn-cotizar-header {
    padding: 0.6rem 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-cotizar__icon {
    display: none;
    font-size: 1.15rem;
}

.btn-cotizar__text-desktop {
    display: inline;
}

.btn-cotizar__text-mobile {
    display: none;
}

#btn-ver-proyectos {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

#btn-hablemos {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ==========================================================================

/* ==========================================================================
   PREVENCIÓN GLOBAL DE DESBORDAMIENTO HORIZONTAL & RESPONSIVE CONTAINER
   ========================================================================== */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }
}

/* ==========================================================================
   PÁGINAS DE ESTADO Y ERROR (404 Y 500)
   ========================================================================== */
.error-page-wrapper {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.5rem 4rem 1.5rem;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% 30%, rgba(0, 195, 255, 0.08) 0%, transparent 60%);
}

.error-card {
    max-width: 680px;
    width: 100%;
    text-align: center;
    background: #ffffff;
    border: 1px solid rgba(0, 195, 255, 0.22);
    border-radius: 28px;
    padding: 3.5rem 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 26, 53, 0.08);
    position: relative;
    z-index: 1;
}

.error-code {
    font-size: clamp(5.5rem, 14vw, 9rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #001a35 20%, #009dff 70%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
    display: block;
}

.error-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 157, 255, 0.08);
    border: 1px solid rgba(0, 157, 255, 0.25);
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #0072ee;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.error-badge__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #009dff;
    box-shadow: 0 0 8px #009dff;
}

.error-title {
    font-size: clamp(1.6rem, 2.5vw, 2.1rem);
    font-weight: 800;
    color: #001a35;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.error-desc {
    font-size: 1.02rem;
    line-height: 1.65;
    color: #556b82;
    margin-bottom: 2.5rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.error-support-note {
    font-size: 0.85rem;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.error-support-note a {
    color: #0072ee;
    font-weight: 600;
    text-decoration: none;
}

.error-support-note a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .error-card {
        padding: 2.5rem 1.5rem;
    }
    .error-actions {
        flex-direction: column;
        width: 100%;
    }
    .error-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
