/* ======================================================= */
/* Reset básico */
/* ======================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables de color y fuente */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #f5f5f5;
    --accent-color: #e63946;
    --font-main: 'Poppins', Arial, sans-serif;
}

/* Fuentes y estilos generales */
body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
    overflow-x: hidden;
    width: 100%;
}

html {
    scroll-behavior: smooth;
}

/* ======================================================= */
/* Encabezado */
/* ======================================================= */
header {
    background-color: #000;
    color: #fff;
    padding: 6px 0;
    position: fixed;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
    top: 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    min-height: 48px;
}

.header-social-links {
    display: flex;
    gap: 1rem;
    margin-left: 2rem;
}

.header-social-links .social-link {
    width: 30px;
    height: 30px;
    background-color: transparent;
    color: #fff;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.header-social-links .social-link:hover {
    color: #e50914;
    transform: translateY(-2px);
    background-color: transparent;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 70px;
    width: auto;
    transition: all 0.3s ease;
}

.logo a:hover .logo-img {
    transform: scale(1.05);
}

.logo span {
    color: #e50914;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
    position: relative;
}

nav ul li a:hover {
    color: #e50914;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: #e50914;
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Mejora contraste y accesibilidad */
a, button, .cta-button {
    transition: background 0.3s, color 0.3s;
}
a:focus, button:focus, .cta-button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Menú desplegable */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #000;
    min-width: 200px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease-in-out;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu li a {
    padding: 12px 16px;
    display: block;
    color: #fff;
    text-decoration: none;
}

.dropdown-menu li a:hover {
    background-color: #e50914;
    color: #fff;
}

.dropdown > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dropdown > a::after {
    content: '▶';
    font-size: 0.7em;
    line-height: 1;
    position: relative;
    top: -5px;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.dropdown:hover > a::after {
    content: '▼';
    transform: translateY(0);
}

/* ======================================================= */
/* Hero section */
/* ======================================================= */
.hero-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

.hero {
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: #000;
    padding: 12rem 0;
}

.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
}

.hero-content {
    max-width: 50%;
    margin-left: 0;
    color: #fff;
    text-align: left;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background-color: #e50914;
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: #c70812;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(229, 9, 20, 0.2);
}

/* ======================================================= */
/* Sección Servicios */
/* ======================================================= */
.services {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 1rem;
}

.section-title h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.section-title h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #e50914;
}

.section-title p {
    font-size: 1.5rem;
    color: #666;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.service-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.service-image {
    height: 200px;
    overflow: hidden;
}

.service-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.service-card:hover .service-image img {
    transform: scale(1.1);
}

.service-content {
    padding: 1.5rem;
}

.service-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 1rem;
}

.service-content h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: #e50914;
}

.service-content p {
    color: #666;
    margin-bottom: 1.5rem;
}

.descripcion-mobile {
    display: none;
}

/* ======================================================= */
/* Sección Portafolio */
/* ======================================================= */
.portfolio {
    background-color: #f1f1f1;
    padding: 6rem 0;
    width: 100%;
}

/* Estilos comunes para todos los items (video arriba, videos medio, grid abajo) */
.portfolio-item {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.portfolio-item:hover img {
    transform: scale(1.08);
}

.portfolio-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(20,20,20,0.6);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay i {
    color: #fff;
    font-size: 3rem;
    opacity: 0.85;
    transition: transform 0.3s;
    transform: scale(1);
}

.portfolio-item:hover .portfolio-overlay i {
    transform: scale(1.15);
}

/* --- 1. Fila Superior (Video Principal) --- */
.portfolio-top-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 30px auto;
  padding: 0 15px;
  max-width: 1200px;
}

.portfolio-top-row .portfolio-item {
  width: 50%;
  height: 320px;
  max-width: 650px;
}

/* --- 2. Fila Intermedia (NUEVOS VIDEOS - ESCALABLE) --- */
.portfolio-recent-row {
    display: flex;
    flex-wrap: wrap; /* Esto permite agregar más videos y que bajen a la siguiente línea */
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto 20px auto;
    padding: 0 15px;
}

.portfolio-recent-row .portfolio-item {
    flex: 1 1 400px; /* Tamaño flexible base */
    max-width: 580px; 
    height: 280px;
    border-radius: 8px; /* Opcional: bordes redondeados para destacar esta sección */
}

/* --- CUADRÍCULA UNIFICADA --- */
.portfolio-grid {
    display: grid;
    /* Esto fuerza exactamente 4 columnas del mismo tamaño */
    grid-template-columns: repeat(4, 1fr); 
    /* Esto hace que las filas se creen solas infinitamente */
    grid-auto-rows: 220px; 
    gap: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* RESPONSIVE: Ajuste para celulares y tablets */
@media (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr); /* En tablet bajamos a 2 por fila */
        grid-auto-rows: 180px;
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: repeat(1, 1fr); /* En celular muy pequeño, 1 por fila */
        grid-auto-rows: 220px;
    }
}

/* ======================================================= */
/* Sección Acerca de */
/* ======================================================= */
.about {
    padding: 6rem 0;
    background-color: #fff;
    width: 100%;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: center;
}

.about-image {
    flex: 1;
    min-width: 300px;
}

.about-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: block;
}

.about-content {
    flex: 1;
    min-width: 300px;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.about-content h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background-color: #e50914;
}

.about-content p {
    margin-bottom: 1.5rem;
    color: #555;
}

/* ======================================================= */
/* Sección Contacto */
/* ======================================================= */
.contact {
    background-color: #f8f8f8;
    padding: 6rem 0;
    width: 100%;
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #e50914;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.submit-button {
    display: inline-block;
    background-color: #e50914;
    color: #fff;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    background-color: #c70812;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(229, 9, 20, 0.2);
}

/* ======================================================= */
/* Footer */
/* ======================================================= */
footer {
    background-color: #111;
    color: #fff;
    padding: 4rem 0 2rem;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
}

.footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.footer-column h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: #e50914;
}

.footer-column p {
    color: #ccc;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #e50914;
}

.footer-column address a {
    color: #ccc; 
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column address a:hover {
    color: #e50914;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.copyright {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 0;
    text-align: center;
    border-top: 1px solid #333;
    margin-top: 3rem;
    color: #777;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title, .services-grid, .portfolio-item, .about-content, .contact-form {
    animation: fadeIn 1s ease-out;
}

/* WhatsApp flotante */
.whatsapp-float {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: white;
    border-radius: 50px;
    text-align: center;
    font-size: 24px;
    box-shadow: 2px 2px 3px rgba(0,0,0,0.25);
    z-index: 100;
}

.tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    right: 80px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    transition: all 0.3s ease;
}

.whatsapp-float:hover .tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent #333;
}

.whatsapp-float a {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    transition: transform 0.3s ease;
}

.whatsapp-float:hover a {
    transform: translateY(-5px);
}

/* Lightbox overlay */
.portfolio-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.portfolio-lightbox-content {
    position: relative;
    background: transparent;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#portfolio-lightbox-video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    display: block;
    background: #000;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.portfolio-lightbox-close {
    position: absolute;
    top: -40px;
    right: -10px;
    background: #222;
    color: #fff;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}
.portfolio-lightbox-close:hover {
    background: #e63946;
}

.video-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    background: #000;
    position: relative;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
}

/* =================================== */
/* Responsive design */
/* =================================== */
@media (max-width: 992px) {
    .hero-content h1 { font-size: 2.8rem; }
    .about-container { flex-direction: column; }
    .about-image, .about-content { width: 100%; }
    
    /* MODIFICACIÓN PORTAFOLIO TABLET */
    /* El grid ahora se adapta automáticamente sin forzar solo 2 filas */
    .portfolio-grid { 
        grid-template-columns: repeat(2, 1fr); 
        grid-auto-rows: 160px; /* Tamaño de fila en tablet */
        max-width: 100%; 
    }
    .portfolio-top-row .portfolio-item { width: 65%; height: 280px; }
}

@media (max-width: 768px) {
    .header-container { padding: 0 1rem; }
    .menu-toggle { display: block; color: #fff; }
    .logo-img { height: 55px; }
    .header-social-links { gap: 0.6rem; margin-left: 0; }
    .header-social-links .social-link { width: 24px; height: 24px; font-size: 1rem; }
    nav { position: fixed; top: 0; left: 0; width: 100%; background-color: #000; padding: 1rem 0; transform: translateY(-100vh); transition: transform 0.3s ease-in-out; margin-top: 80px; }
    nav.active { transform: translateY(0); }
    nav ul { flex-direction: column; align-items: center; }
    nav ul li { margin: 1rem 0; }
    .menu-toggle.active i { transform: rotate(90deg); }
    .hero { padding-top: 120px; padding-bottom: 5rem; }
    .hero-content { max-width: 100%; text-align: center; }
    .hero-content h1 { font-size: 2.5rem; }
    .hero-content p { font-size: 1rem; }
    nav.active + .header-social-links { display: none; }
    .dropdown-menu { position: static; background-color: rgba(0,0,0,0.1); display: none; }
    .dropdown.active .dropdown-menu { display: block; }
    .services-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    .service-content { padding: 1rem; }
    .service-content h3 { font-size: 1.0rem; hyphens: auto; -webkit-hyphens: auto; word-wrap: break-word; }
    .service-content p { font-size: 0.85rem; line-height: 1.5; }
    .descripcion-desktop { display: none; }
    .descripcion-mobile { display: block; }

    /* MODIFICACIÓN PORTAFOLIO MÓVIL */
    .about-image { max-height: 250px; }
    .portfolio-top-row { margin-bottom: 20px; }
    .portfolio-top-row .portfolio-item { width: 95%; height: 220px; }

    /* Ajuste para que los nuevos videos intermedios se pongan uno debajo de otro */
    .portfolio-recent-row .portfolio-item {
        flex: 1 1 100%; /* Ocupan todo el ancho en móvil */
        height: 220px;
    }
    
    /* LIGHTBOX EN MÓVIL */
    #portfolio-lightbox-video { width: 98vw; max-width: 98vw; max-height: 50vh; }
    .portfolio-lightbox-content { max-width: 98vw; }
    .portfolio-lightbox-close { top: 10px; right: 10px; font-size: 2rem; width: 40px; height: 40px; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 2rem; }
    .hero-content p { font-size: 1rem; }
    .section-title h2 { font-size: 2rem; }
    .contact-form { padding: 1.5rem; }
}