/* ===== FONT IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ===== VARIABLES CSS ===== */
:root {
    --color-primary: #C40000;
    --color-black: #000000;
    --color-white: #FFFFFF;
    --color-gray-light: #AAAAAA;
    --color-gray-dark: #1a1a1a;
    
    --font-primary: 'Bebas Neue', cursive;
    --font-secondary: 'Montserrat', sans-serif;
    
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --shadow: 0 4px 15px rgba(196, 0, 0, 0.2);
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--color-black);
    color: var(--color-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== ACCESIBILIDAD ===== */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ===== HEADER ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--color-black);
    border-bottom: 2px solid var(--color-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
}

/* Logo Section - Solo favicon */
.logo-section {
    display: flex;
    align-items: center;
}

.logo-link {
    display: inline-block;
    transition: var(--transition);
    text-decoration: none;
}

.logo-link:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

.favicon-header {
    height: 64px;
    width: 300px;
    object-fit: contain;
    display: block;
    max-width: none;
}

/* Navegación Desktop */
.nav-desktop {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--color-white);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

/* Menú Hamburguesa */
.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--color-white);
    margin: 3px 0;
    transition: var(--transition);
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Navegación Móvil */
.nav-mobile {
    display: none;
    flex-direction: column;
    background-color: var(--color-gray-dark);
    padding: 1rem 2rem;
    border-top: 1px solid var(--color-primary);
}

.nav-mobile.active {
    display: flex;
}

.nav-link-mobile {
    color: var(--color-white);
    text-decoration: none;
    padding: 0.8rem 0;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.nav-link-mobile:hover {
    color: var(--color-primary);
    padding-left: 1rem;
}

/* ===== MAIN CONTENT ===== */
.main {
    padding-top: 0;
}

/* ===== SECCIÓN HERO ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    
    /* Background inicial con video */
    background: linear-gradient(135deg, #c02922, #010000);
    background-blend-mode: multiply;
}

/* Video de fondo */
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: 0;
    transition: opacity 1s ease-out;
}

.hero-video.loaded {
    opacity: 1;
}

.hero-video.fade-out {
    opacity: 0;
}

/* Background de imagen (inicialmente oculto) */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/background.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    opacity: 0;
    transition: opacity 1s ease-in;
}

.hero-section.show-image::before {
    opacity: 1;
}

.hero-content {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Logos responsive */
.hero-logo {
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.hero-logo-desktop {
    width: clamp(250px, 35vw, 450px);
    display: block;
}

.hero-logo-mobile {
    display: none;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--color-white);
    font-weight: 300;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Progress Bar */
.progress-container {
    width: 100%;
    max-width: 400px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), #ff4444);
    border-radius: 2px;
    width: 0%;
    transition: width 8s linear;
    box-shadow: 0 0 10px rgba(196, 0, 0, 0.5);
}

.progress-bar.active {
    width: 100%;
}

/* ===== SECCIÓN SERVICIOS ===== */
.services-section {
    padding: 4rem 2rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(26, 26, 26, 0.9));
}

.services-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Service Card Wrapper */
.service-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Cards de Servicios */
.service-card {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 1.35rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: var(--transition);
    box-shadow: var(--shadow);
    min-height: 126px;
    position: relative;
    overflow: visible;
}

.service-card:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 25px rgba(196, 0, 0, 0.4);
    background-color: #d60000;
}

.service-text {
    flex: 1;
    padding-right: 153px;
    z-index: 2;
    position: relative;
}

.service-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 2.3vw, 1.17rem);
    margin-bottom: 0.45rem;
    line-height: 1.3;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-white);
}

.service-description {
    font-size: clamp(0.77rem, 1.8vw, 0.86rem);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-image {
    width: 162px;
    height: 108px;
    object-fit: cover;
    border-radius: 7px;
    flex-shrink: 0;
    position: absolute;
    right: -9px;
    top: -9px;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Botón Ver Detalles */
.service-details-btn {
    background: rgba(196, 0, 0, 0.1);
    border: 1px solid rgba(196, 0, 0, 0.3);
    color: var(--color-white);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-left: auto;
    width: fit-content;
}

.service-details-btn:hover {
    background: rgba(196, 0, 0, 0.2);
    border-color: var(--color-primary);
}

.expand-icon {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.service-details-btn[aria-expanded="true"] .expand-icon {
    transform: rotate(45deg);
}

/* Contenido Expandible */
.service-details {
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(196, 0, 0, 0.3);
    border-radius: var(--border-radius);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.3s ease;
}

.service-details[aria-hidden="false"] {
    max-height: 800px;
    padding: 1.5rem;
}

.service-details h4 {
    color: var(--color-primary);
    font-family: var(--font-primary);
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 400;
}

.service-details p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--color-gray-light);
}

.service-details ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.service-details li {
    margin-bottom: 0.5rem;
    color: var(--color-gray-light);
}

.service-cta {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: var(--transition);
}

.service-cta:hover {
    background-color: #d60000;
    transform: translateY(-2px);
}

/* Grid responsive para servicios */
@media (max-width: 1024px) {
    .services-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .services-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* ===== SECCIÓN FAQ ===== */
.faq-section {
    padding: 4rem 2rem;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.9), rgba(0, 0, 0, 0.9));
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-title {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--color-white);
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 2px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(196, 0, 0, 0.3);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    color: var(--color-white);
    padding: 1.5rem;
    text-align: left;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: rgba(196, 0, 0, 0.1);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
    color: var(--color-primary);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
}

.faq-answer[aria-hidden="false"] {
    max-height: 300px;
    padding: 1.5rem;
}

.faq-answer p {
    color: var(--color-gray-light);
    line-height: 1.6;
    margin: 0;
}

/* ===== SECCIÓN CONTACTO ===== */
.contact-section {
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.9), rgba(0, 0, 0, 0.9));
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

.contact-title {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--color-white);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.contact-text {
    font-size: 1.1rem;
    color: var(--color-gray-light);
    margin-bottom: 2rem;
}

.contact-email {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.contact-email:hover {
    background-color: #d60000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 0, 0, 0.4);
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--color-black);
    color: var(--color-gray-light);
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--color-primary);
}

.footer-text {
    font-size: 0.9rem;
    font-weight: 300;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large Tablets */
@media (max-width: 1024px) {
    .services-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
        max-width: 900px;
    }
    
    .service-card {
        padding: 1.2rem;
        min-height: 115px;
    }
    
    .service-text {
        padding-right: 140px;
    }
    
    .service-image {
        width: 145px;
        height: 97px;
        right: -8px;
        top: -8px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    /* Header */
    .nav-desktop {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .header-container {
        padding: 1rem;
    }
    
    .favicon-header {
        height: 56px;
        width: 263px;
    }
    
    /* Hero - Cambio de logo */
    .hero-section {
        min-height: 80vh;
        padding: 1rem;
        background-attachment: scroll;
    }
    
    .hero-video {
        object-fit: cover;
    }
    
    .hero-section::before {
        background-attachment: scroll;
    }
    
    .hero-logo-desktop {
        display: none;
    }
    
    .hero-logo-mobile {
        display: block;
        width: clamp(180px, 45vw, 320px);
    }
    
    /* Services Grid */
    .services-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .service-card {
        padding: 1.1rem;
        min-height: 110px;
    }
    
    .service-text {
        padding-right: 120px;
    }
    
    .service-image {
        width: 130px;
        height: 92px;
        right: -8px;
        top: -8px;
    }
    
    .service-title {
        font-size: clamp(1rem, 2vw, 1.2rem);
    }
    
    .service-description {
        font-size: 0.8rem;
    }
    
    /* Centrar última card en tablet */
    .service-card-wrapper:last-child {
        max-width: 100%;
        grid-column: 1;
    }
    
    /* Contact */
    .contact-section {
        padding: 3rem 1rem;
    }
    
    /* FAQ */
    .faq-section {
        padding: 3rem 1rem;
    }
    
    .faq-question {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .faq-answer[aria-hidden="false"] {
        padding: 1rem;
    }
}

/* Móviles */
@media (max-width: 480px) {
    .header-container {
        padding: 0.8rem;
    }
    
    .favicon-header {
        height: 48px;
        width: 225px;
    }
    
    .hero-section {
        min-height: 70vh;
        background-attachment: scroll;
    }
    
    .hero-video {
        object-fit: cover;
    }
    
    .hero-section::before {
        background-attachment: scroll;
    }
    
    .hero-logo-mobile {
        width: clamp(140px, 60vw, 280px);
    }
    
    .hero-content {
        gap: 1.5rem;
    }
    
    .services-section {
        padding: 3rem 1rem;
    }
    
    .service-card {
        padding: 0.9rem;
        min-height: auto;
    }
    
    .service-text {
        padding-right: 90px;
    }
    
    .service-image {
        width: 90px;
        height: 72px;
        right: -5px;
        top: -12px;
    }
    
    .service-title {
        font-size: 0.95rem;
    }
    
    .service-description {
        font-size: 0.75rem;
        -webkit-line-clamp: 3;
    }
    
    .contact-email {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .faq-question {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    .service-details-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card {
    animation: fadeInUp 0.6s ease-out;
}

.service-card:nth-child(even) {
    animation-delay: 0.1s;
}

.service-card:nth-child(odd) {
    animation-delay: 0.2s;
}

/* ===== SCROLL SUAVE ===== */
html {
    scroll-padding-top: 80px;
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .hero-section {
        background-attachment: scroll !important;
    }
}

/* ===== FOCUS STATES ===== */
.nav-link:focus,
.nav-link-mobile:focus,
.service-card:focus,
.contact-email:focus,
.hamburger:focus,
.service-details-btn:focus,
.faq-question:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===== LOADING STATES ===== */
.service-image {
    background-color: rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s ease;
}

.service-image:not([src]) {
    opacity: 0.5;
}

/* ===== HERO LOGO ANIMATION ===== */
.hero-logo {
    animation: fadeInUp 1.2s ease-out;
}

.hero-subtitle {
    animation: fadeInUp 1.2s ease-out 0.3s both;
}
