/* Variables y Reset */
:root {
    --primary-color: #003399; /* Azul Rey */
    --primary-dark: #002266;
    --secondary-color: #2C2C2C; /* Gris Oscuro */
    --text-color: #333333;
    --light-bg: #f4f4f4;
    --white: #FFFFFF;
    --accent-color: #e74c3c; /* Para botones de acción o alertas */
    --transition: all 0.3s ease;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Prevenir scroll horizontal global */
    width: 100%;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Refuerzo */
    width: 100%;
    position: relative;
}

/* Accesibilidad: enfoque visible y skip-link */
:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

ul {
    list-style: none;
}

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

/* Utilidades */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
}

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

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

.btn-outline {
    background-color: transparent;
    border-color: var(--white);
    color: var(--white);
}

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

.section {
    padding: 80px 0;
}

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

.bg-dark {
    background-color: var(--secondary-color);
    color: var(--white);
}

.section-title {
    margin-bottom: 50px;
}

.section-title span {
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 10px;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 15px;
    position: relative;
}

.section-title.light h2 {
    color: var(--white);
}

.section-title.text-center {
    text-align: center;
}

/* Header */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    height: auto; /* Ajuste automático para el logo grande */
    min-height: 80px;
    padding: 10px 0;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

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

.logo img {
    height: 120px; /* Tamaño doble solicitado (60px * 2) */
    width: auto;
    transition: var(--transition);
}

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

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 1rem;
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.btn-contact {
    background-color: var(--primary-color);
    color: var(--white) !important;
    padding: 8px 20px;
    border-radius: 25px;
}

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

.btn-contact::after {
    display: none;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: var(--transition);
    background-color: var(--secondary-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    width: 100%;
    background-image: url('../img/8.jpg'); /* Imagen del taller */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    margin-top: 0; /* Reset margin if any */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Oscurecer para legibilidad */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 20px;
    color: #ddd;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: 2rem;
    z-index: 2;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);}
    40% {transform: translateX(-50%) translateY(-10px);}
    60% {transform: translateX(-50%) translateY(-5px);}
}

/* Sobre Nosotros */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image img {
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.experience-badge {
    position: absolute;
    bottom: -20px;
    left: -20px;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(0,51,153,0.3);
}

.experience-badge .years {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.experience-badge .text {
    font-size: 0.9rem;
    line-height: 1.2;
}

.commitment-box {
    margin-top: 30px;
    background-color: #f9f9f9;
    padding: 20px;
    border-left: 4px solid var(--primary-color);
    border-radius: 0 5px 5px 0;
}

.commitment-box h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* CTA Shipping */
.cta-shipping {
    background-color: var(--primary-color);
    padding: 40px 0;
    color: var(--white);
}

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

.cta-text h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.shipping-img {
    max-height: 100px;
    border-radius: 5px;
}

/* Servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--white);
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary-color);
}

.icon-box {
    width: 80px;
    height: 80px;
    background-color: #e6ecf5;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 25px;
    color: var(--primary-color);
    font-size: 2rem;
    transition: var(--transition);
}

.service-card:hover .icon-box {
    background-color: var(--primary-color);
    color: var(--white);
}

.service-card h3 {
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.service-card ul {
    text-align: left;
    margin-bottom: 30px;
    color: #555;
}

.service-card ul li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.service-card ul li::before {
    content: '•';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #25D366;
    color: var(--white);
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

/* Galería */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    height: 300px; /* Altura fija para uniformidad */
}

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

.gallery-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: var(--white);
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover .gallery-overlay {
    bottom: 0;
}

.gallery-overlay h4 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.gallery-overlay p {
    font-size: 0.9rem;
    color: #ddd;
}

/* Nueva Sección CTA Especial */
.cta-special {
    position: relative;
    background-image: url('../img/5.jpg'); /* Usando imagen industrial */
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    padding: 100px 0;
    color: var(--white);
    text-align: center;
}

.cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 51, 153, 0.85); /* Overlay azul corporativo */
    z-index: 1;
}

.cta-special-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.cta-special h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 800;
}

.cta-special p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-animated {
    background-color: var(--white);
    color: var(--primary-color);
    font-size: 1.1rem;
    padding: 15px 40px;
    border-radius: 50px;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    animation: pulse-white 2s infinite;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-animated:hover {
    background-color: var(--accent-color);
    color: var(--white);
    transform: translateY(-3px);
    animation: none;
}

@keyframes pulse-white {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* CTA Webpay */
.cta-webpay {
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.webpay-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.webpay-info {
    flex: 1;
    padding-right: 40px;
}

.webpay-info h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.webpay-info p {
    margin-bottom: 25px;
}

.btn-webpay {
    background-color: #ff4e00; /* Color característico de Webpay/Transbank */
    color: var(--white);
}

.btn-webpay:hover {
    background-color: #cc3e00;
}

.webpay-logo img {
    max-width: 250px;
}

/* Contacto */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

.contact-list i {
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--primary-color); /* El azul resalta sobre el fondo oscuro si cambiamos el icono */
    background-color: var(--white);
}

.contact-list p, .contact-list strong {
    color: #ddd;
}

.contact-list strong {
    color: var(--white);
    display: block;
    margin-bottom: 5px;
}

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

.social-links a {
    width: 45px;
    height: 45px;
    background-color: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.contact-form-container {
    background-color: var(--white);
    padding: 40px;
    border-radius: 10px;
    color: var(--text-color);
}

.contact-form h3 {
    margin-bottom: 25px;
    color: var(--secondary-color);
}

.form-message {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
}

.form-message.success {
    background-color: #e6ffed;
    color: #0f5132;
    border: 1px solid #9ae6b4;
}

.form-message.error {
    background-color: #ffeef0;
    color: #842029;
    border: 1px solid #feb2b2;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.1);
}

.w-100 {
    width: 100%;
}

/* Footer Robusto */
.footer-robust {
    background-color: #111;
    color: #aaa;
    padding: 80px 0 30px;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.footer-logo-text h3 {
    color: var(--white);
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

.footer-col h4 {
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-links li {
    margin-bottom: 12px;
    transition: var(--transition);
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-links i {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.footer-contact-info li {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.footer-contact-info i {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-top: 3px;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.footer-social a {
    width: 35px;
    height: 35px;
    background-color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--white);
    transition: var(--transition);
}

.footer-social a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom-robust {
    border-top: 1px solid #222;
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.payment-icons {
    display: flex;
    gap: 15px;
    font-size: 2rem;
    color: #ccc;
}

/* Botón Flotante WhatsApp */
.btn-whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    font-size: 35px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    animation: whatsapp-pulse 2s infinite;
    transition: all 0.3s ease;
}

.btn-whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
}

@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Animaciones */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Media Queries */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .about-image {
        order: -1;
        margin-bottom: 30px;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .webpay-container {
        flex-direction: column;
        text-align: center;
    }
    
    .webpay-info {
        padding-right: 0;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    /* Ajuste Logo en Móvil (Triple tamaño pero sin espacio extra) */
    .logo img {
        height: auto; /* Altura automática para evitar espacios vacíos */
        max-height: 180px; /* Límite máximo solicitado */
        max-width: 70vw; /* Ancho máximo permitido */
        object-fit: contain;
    }

    /* Asegurar que el contenedor del header no se desborde */
    .header-container {
        padding: 0 15px;
        flex-wrap: wrap;
    }

    /* Ajuste del menú para pegarse al header dinámicamente */
    .nav-menu {
        position: absolute; /* Cambiado de fixed a absolute relativo al header */
        left: 0;
        top: 100%; /* Se posiciona exactamente debajo del header */
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        gap: 0;
        flex-direction: column;
        background-color: var(--white);
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
        /* Ocultar visualmente cuando no está activo pero mantener transición */
        clip-path: inset(0 0 100% 0); 
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-item {
        margin: 16px 0;
    }

    .nav-menu.active {
        clip-path: inset(0 0 0 0); /* Mostrar menú */
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .cta-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .cta-text h3 {
        justify-content: center;
    }
    
    .cta-special h2 {
        font-size: 1.8rem;
    }
    
    .footer-bottom-robust {
        flex-direction: column;
        text-align: center;
    }
}
