@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;900&display=swap');

:root {
    --primary-red: #E63946;
    --primary-black: #1D3557;
    --neutral-white: #F1FAEE;
    --dark-grey: #1a1a1a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--dark-grey);
    color: var(--neutral-white);
    overflow-x: hidden;
    width: 100%; /* Línea clave para estabilizar el layout */
}

/* --- HEADER Y NAVEGACIÓN --- */
.navbar { position: fixed; top: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 20px 5%; background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent); z-index: 1000; }
.brand-title a { font-size: 1.5rem; font-weight: 700; color: var(--neutral-white); text-decoration: none; text-transform: uppercase; }
.navbar-links ul { list-style: none; display: flex; gap: 25px; }
.navbar-links a { color: var(--neutral-white); text-decoration: none; font-weight: 700; position: relative; padding-bottom: 5px; }
.navbar-links a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0; background-color: var(--primary-red); transition: width 0.3s ease; }
.navbar-links a:hover::after { width: 100%; }

/* --- SLIDER PRINCIPAL (VERSIÓN CORREGIDA) --- */
.slider-container { position: relative; width: 100%; height: 100vh; overflow: hidden; }
.video-slider { width: 100%; height: 100%; }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.5s ease-in-out; visibility: hidden; }
.slide.active { opacity: 1; visibility: visible; }
.slider-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; z-index: 10; padding: 20px; }
.slider-overlay h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 900; line-height: 1.2; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 2px; text-shadow: 2px 2px 8px rgba(0,0,0,0.8); }
.slider-overlay p { font-size: clamp(1.2rem, 3vw, 1.5rem); margin-bottom: 40px; }
.slider-nav { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; gap: 15px; z-index: 20; }
.nav-btn { width: 12px; height: 12px; background: rgba(255, 255, 255, 0.5); border-radius: 50%; cursor: pointer; transition: background 0.3s ease; }
.nav-btn.active { background: var(--primary-red); }

/* --- BOTÓN CTA --- */
.cta-button { background-color: var(--primary-red); color: var(--neutral-white); padding: 15px 30px; text-decoration: none; font-weight: 700; border-radius: 5px; transition: background-color 0.3s ease, transform 0.3s ease; }
.cta-button:hover { background-color: #c42d38; transform: translateY(-3px); }

/* --- ANIMACIÓN DE FADE-IN --- */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* --- SECCIONES DE CONTENIDO --- */
.content-section { display: flex; align-items: center; gap: 60px; background-color: #000; padding: 120px 10%; }
.content-section .text-content, .content-section .image-content { flex: 1; }
.content-section .image-content img { width: 100%; height: auto; border-radius: 5px; display: block; }
.content-section h2 { font-size: 3rem; color: var(--primary-red); margin-bottom: 20px; }
.content-section p { font-size: 1.1rem; line-height: 1.8; margin-bottom: 1.2em; }
.content-section p:last-child { margin-bottom: 0; }

.proceso-section { background-color: #111; padding: 100px 10%; text-align: center; }
.proceso-intro { max-width: 800px; margin: 0 auto 60px auto; }
.proceso-intro h2 { font-size: 3rem; color: var(--primary-red); margin-bottom: 20px; }
.proceso-intro p { font-size: 1.2rem; line-height: 1.7; color: var(--neutral-white); }
.proceso-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; text-align: left; }
.step { background-color: #1a1a1a; padding: 35px; border-radius: 5px; border-top: 3px solid var(--primary-red); }
.step h3 { font-size: 1.8rem; margin-bottom: 15px; color: var(--neutral-white); }
.step p { font-size: 1rem; line-height: 1.8; }

.portfolio-section { background-color: var(--dark-grey); text-align: center; padding: 100px 10%; }
.portfolio-section h2 { font-size: 3rem; margin-bottom: 50px; color: var(--neutral-white); }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 25px; }
.portfolio-item { position: relative; overflow: hidden; border-radius: 5px; display: block; }
.portfolio-item img { width: 100%; display: block; transition: transform 0.4s ease; }
.portfolio-item:hover img { transform: scale(1.05); }
.item-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); display: flex; align-items: flex-end; padding: 20px; color: var(--neutral-white); }
.item-overlay h3 { font-size: 1.5rem; }

.contact-section { background-color: #000; text-align: center; padding: 100px 10%; }
.contact-section h2 { font-size: 3rem; color: var(--primary-red); }
.contact-section p { font-size: 1.2rem; margin: 20px 0 40px 0; }

/* --- FOOTER --- */
footer { text-align: center; padding: 30px; background-color: #000; }

/* --- PÁGINA DE BLOG --- */
.blog-header { text-align: center; padding: 150px 10% 80px; background-color: #111; }
.blog-header h1 { font-size: 4rem; color: var(--primary-red); }
.blog-index-container { padding: 0 10% 60px 10%; background-color: #111; }
.blog-index { max-width: 900px; margin: 0 auto; background-color: var(--dark-grey); padding: 30px; border-radius: 5px; border-top: 3px solid var(--primary-red); }
.blog-index h2 { font-size: 1.8rem; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #444; }
.blog-index ul { list-style: none; }
.blog-index ul li { margin-bottom: 10px; }
.blog-index ul a { text-decoration: none; color: var(--neutral-white); font-size: 1.2rem; font-weight: 700; display: block; padding: 10px; border-radius: 4px; transition: background-color 0.3s ease, color 0.3s ease; }
.blog-index ul a:hover { background-color: rgba(230,57,70,0.1); }
.blog-index ul a.active { background-color: var(--primary-red); }
.blog-article { max-width: 900px; margin: 40px auto 0 auto; background-color: #222; border-radius: 5px; overflow: hidden; transition: opacity 0.4s ease; }
.blog-article img { width: 100%; display: block; }
.article-body { padding: 40px; }
.article-body h2 { font-size: 2.5rem; color: var(--primary-red); margin-bottom: 25px; }
.article-body p { font-size: 1.1rem; line-height: 1.9; margin-bottom: 20px; }
.article-body blockquote { font-size: 1.3rem; font-style: italic; border-left: 3px solid var(--primary-red); padding-left: 20px; margin: 30px 0; }
.loading-message, .error-message { padding: 40px; text-align: center; font-size: 1.2rem; font-style: italic; }
.error-message { color: var(--primary-red); }
.blog-article.loading { min-height: 200px; }

/* --- PÁGINAS LEGALES --- */
.legal-page-container { padding: 150px 10% 80px; background-color: #111; }
.legal-content { max-width: 800px; margin: 0 auto; background-color: var(--dark-grey); padding: 40px; border-radius: 5px; }
.legal-content h1 { font-size: 2.8rem; color: var(--primary-red); margin-bottom: 10px; }
.legal-content h3 { font-size: 1.8rem; margin-top: 40px; margin-bottom: 15px; border-bottom: 1px solid #444; padding-bottom: 10px; }
.legal-content p, .legal-content li { font-size: 1rem; line-height: 1.8; margin-bottom: 15px; }
.legal-content a { color: var(--primary-red); }
.legal-content code { background-color: #111; padding: 2px 6px; border-radius: 3px; font-family: monospace; }
.legal-content table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.legal-content th, .legal-content td { border: 1px solid #444; padding: 12px; text-align: left; }
.legal-content th { background-color: #111; }

/* --- POPUP DE COOKIES --- */
.cookie-banner { position: fixed; bottom: 0; left: 0; width: 100%; background-color: #1a1a1a; border-top: 2px solid var(--primary-red); padding: 20px; display: flex; justify-content: center; align-items: center; gap: 20px; z-index: 2000; transform: translateY(100%); transition: transform 0.5s ease-in-out; }
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner p { margin: 0; color: var(--neutral-white); text-align: center; }
.cookie-banner a { color: var(--primary-red); text-decoration: underline; }
.cookie-banner .cta-button { padding: 10px 20px; flex-shrink: 0; }

/* --- RESPONSIVIDAD --- */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 15px; padding: 15px; }
    .navbar-links ul { gap: 15px; }
    .content-section { flex-direction: column; padding: 80px 5%; gap: 40px; }
    .content-section.row-reverse { flex-direction: column-reverse; }
    .proceso-section, .portfolio-section, .contact-section { padding: 80px 5%; }
    .proceso-intro h2, .content-section h2, .portfolio-section h2, .contact-section h2 { font-size: 2.5rem; }
    .cookie-banner { flex-direction: column; padding: 25px; }
    .blog-header h1, .legal-content h1 { font-size: 2.8rem; }
    .article-body, .legal-content { padding: 30px; }
    .article-body h2 { font-size: 2rem; }
}