/* 
 * FERRARI CRANE - Hoja de Estilos Principal
 * Diseño: Moderno, Responsivo, Industrial-Premium
 */

:root {
    /* Colores Principales */
    --color-primary: #d32f2f; /* Rojo Ferrari Crane */
    --color-primary-dark: #b71c1c;
    --color-secondary: #1a237e; /* Azul Industrial */
    --color-accent: #2e7d32; /* Verde para éxitos */
    
    /* Escala de Grises */
    --color-bg: #ffffff;
    --color-bg-alt: #f5f7fa;
    --color-text: #263238;
    --color-text-light: #455a64;
    --color-text-muted: #78909c;
    --color-border: #eceff1;
    --color-white: #ffffff;
    
    /* Tipografía */
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Roboto Slab', serif;
    
    /* Sombras y Bordes */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    /* Transiciones */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --header-height: 80px;
    --container-width: 1200px;
}

/* 1. RESET & BASE */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-bg);
    overflow-x: hidden;
}

.site-wrapper {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--color-secondary);
}

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

ul {
    list-style: none;
}

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

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* 2. LAYOUT & GRIDS */
.section {
    padding: 80px 0;
}

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

.section-primary {
    background-color: var(--color-secondary);
    color: var(--color-white);
    text-align: center;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 15px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--color-primary);
}

.grid-2, .grid-3, .grid-4, .grid-5 {
    display: grid;
    gap: 30px;
}

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

.page-header {
    padding: calc(var(--header-height) + 60px) 0 60px;
    background-color: var(--color-secondary);
    background-image: linear-gradient(rgba(26, 35, 126, 0.8), rgba(26, 35, 126, 0.8)), url('../images/hero-grua.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
}

.page-header h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.grid-align-center {
    align-items: center;
}

/* 3. HEADER & NAV */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: transparent;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    height: 70px;
    box-shadow: var(--shadow-sm);
}

.site-header.scrolled .logo-text {
    color: var(--color-secondary);
}

.site-header.scrolled .main-nav a {
    color: var(--color-text-light);
}

.site-header.scrolled .main-nav a:hover,
.site-header.scrolled .main-nav a.active {
    color: var(--color-primary);
}

.header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    background: var(--color-primary);
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
}

.logo-text {
    font-size: 1.5rem;
    color: white;
    font-family: var(--font-heading);
}

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

.main-nav ul {
    display: flex;
    gap: 20px;
    align-items: center;
}

.main-nav a {
    font-weight: 500;
    font-size: 0.95rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    position: relative;
}

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

.nav-icon {
    width: 18px;
    height: 18px;
}

.mobile-menu-header {
    display: none;
}

/* Submenús Desktop */
.has-submenu {
    position: relative;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 240px;
    padding: 15px 0;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    display: block !important; /* Sobreescribir flex de ul */
}

.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    display: block;
}

.submenu a {
    padding: 10px 20px;
    display: block;
    color: var(--color-text-light);
}

.submenu a:hover {
    background: var(--color-bg-alt);
    padding-left: 25px;
}

.submenu-toggle {
    display: none; /* Solo móvil */
}

/* Botones Nav */
.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--color-primary);
    color: white !important;
    padding: 10px 20px !important;
    border-radius: var(--radius-sm);
}

.btn-nav:hover {
    background: var(--color-primary-dark) !important;
}

/* Menú Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
    transition: var(--transition);
}

.site-header.scrolled .menu-toggle span {
    background: var(--color-secondary);
}

/* 4. HERO SECTION */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    color: white;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.hero-bg-image {
    background-image: url('../images/hero-grua.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    padding: 0 24px;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 24px;
    animation: fadeInUp 1s ease-out;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.9;
    animation: fadeInUp 1.2s ease-out;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    animation: fadeInUp 1.4s ease-out;
}

@keyframes zoomHero {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* 5. BOTONES */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 32px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-light {
    background: white;
    color: var(--color-secondary);
}

.btn-light:hover {
    background: var(--color-bg-alt);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

.btn-outline-inverse {
    border-color: white;
    color: white;
}

.btn-outline-inverse:hover {
    background: white;
    color: var(--color-primary);
}

/* 6. CARDS & COMPONENTS */
.card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--color-border);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    height: 220px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-image img {
    transform: scale(1.1);
}

.card-body {
    padding: 24px;
}

.card-body h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.card-body p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.card-footer {
    border-top: 1px solid var(--color-border);
    padding: 15px 24px;
}

.card-footer a {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Icon Cards */
.icon-card {
    background: white;
    padding: 30px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.icon-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.icon-card .icon {
    width: 60px;
    height: 60px;
    background: var(--color-bg-alt);
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

/* Brand Cards */
.brand-card {
    display: flex;
    gap: 20px;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.brand-icon {
    background: var(--color-secondary);
    color: white;
    width: 50px;
    height: 50px;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-family: var(--font-heading);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--color-border);
}

/* 7. FOOTER */
.site-footer {
    background: #101518;
    color: #e0e0e0;
    padding: 80px 0 0;
}

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

.footer-brand .logo-text { color: white; }

.footer-brand p {
    margin: 20px 0;
    color: var(--color-text-muted);
}

.footer-grid h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.footer-links li, .footer-contact li, .footer-locations li {
    margin-bottom: 12px;
    color: var(--color-text-muted);
}

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

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 36px;
    height: 36px;
    background: #263238;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
}

.social-links a:hover {
    background: var(--color-primary);
    color: white;
}

.footer-bottom {
    background: #0a0e10;
    padding: 25px 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* 7.5 CONTACT PAGE SPECIFIC */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: flex-start;
}

.contact-info h3 {
    font-size: 1.5rem;
    color: var(--color-secondary);
    margin-bottom: 24px;
}

.contact-info ul {
    padding: 0;
}

.contact-info ul li {
    margin-bottom: 24px;
    padding-left: 0;
    color: var(--color-text-light);
}

.contact-info ul li strong {
    display: block;
    color: var(--color-secondary);
    font-size: 1rem;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-info a:hover {
    color: var(--color-primary);
}

.contact-form-wrapper {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--color-text);
    transition: var(--transition);
    background-color: var(--color-bg-alt);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.1);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.map-embed {
    margin-top: 40px;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* 8. ANIMATIONS & UTILS */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.image-reveal img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.mt-3 { margin-top: 3rem; }
.text-center { text-align: center; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 9. RESPONSIVE */
@media (max-width: 1024px) {
    .grid-4, .grid-5, .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .contact-grid {
        gap: 40px;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .hero h1 { font-size: 2.8rem; }
}

@media (max-width: 768px) {
    :root { --header-height: 70px; }
    
    .grid-2, .grid-3, .contact-grid, .form-row {
        grid-template-columns: 1fr;
    }
    
    .contact-form-wrapper {
        padding: 24px;
    }
    
    .section { padding: 50px 0; }
    .hero h1 { font-size: 2.2rem; }
    
    .page-header {
        padding: calc(var(--header-height) + 40px) 0 40px;
    }
    
    .page-header h1 { font-size: 2.2rem; }
    
    .site-header {
        background: var(--color-secondary) !important; /* Fondo sólido en móvil para evitar solapamiento */
    }
    
    .site-header.scrolled {
        background: var(--color-secondary) !important;
    }

    .site-header.scrolled .logo-text {
        color: white !important;
    }
    
    .site-header.scrolled .menu-toggle span {
        background-color: white !important;
    }
    
    /* Mobile Nav */
    .menu-toggle { display: block; }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: white;
        z-index: 1001;
        padding: 80px 24px;
        transition: transform 0.4s ease;
        transform: translateX(100%);
        box-shadow: -5px 0 25px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    .main-nav.open {
        transform: translateX(0);
    }
    
    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .main-nav li { width: 100%; }
    
    .main-nav a {
        font-size: 1.2rem;
        padding: 15px 0;
        border-bottom: 1px solid var(--color-border);
        width: 100%;
        color: var(--color-text-light);
    }
    
    .mobile-menu-header {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--color-bg-alt);
    }
    
    .mobile-logo-link {
        text-decoration: none;
        color: inherit;
    }
    
    .mobile-logo-text {
        font-family: var(--font-heading);
        font-weight: 700;
        color: var(--color-secondary);
    }
    
    .menu-close {
        background: none;
        border: none;
        color: var(--color-text-light);
    }
    
    /* Submenús móvil */
    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0 0 0 20px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .has-submenu.open .submenu {
        max-height: 500px;
    }
    
    .submenu-toggle {
        display: block;
        position: absolute;
        right: 0;
        top: 15px;
        background: none;
        border: none;
        padding: 5px;
        color: var(--color-text-muted);
    }
    
    .has-submenu.open .submenu-toggle svg {
        transform: rotate(180deg);
    }
}

/* 10. FORM STATUS */
.form-status {
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-top: 20px;
    display: none;
    font-weight: 500;
}

.form-status.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.form-status.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}
