/* ============================================
   RESET Y CONFIGURACIÓN BASE
   ============================================ */

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

/* ============================================
   VARIABLES CSS
   ============================================ */

:root {
    --color-bg: #faf8f5;
    --color-primary: #b49b78;
    --color-text: #5a4a3a;
}

/* ============================================
   BACKGROUND PRINCIPAL DEL BODY
   ============================================ */

body {
    /* Color base sólido como respaldo */
    background-color: #d4c4b0;
    
    /* Gradiente lineal principal con ángulo 160deg */
    background-image: linear-gradient(
        160deg,
        #faf8f5 0%,      /* Muy claro - inicio */
        #f5f0ea 25%,     /* Claro - primera parada */
        #efe8e0 50%,     /* Medio-claro - segunda parada */
        #e8dfd4 75%,     /* Medio - tercera parada */
        #d4c4b0 100%     /* Base - final */
    );
    
    /* Fijar el background para efecto parallax */
    background-attachment: fixed;
    
    /* Cubrir toda la pantalla */
    background-size: cover;
    
    /* Centrar el background */
    background-position: center;
    
    /* Asegurar altura mínima */
    min-height: 100vh;
}

/* ============================================
   ELEMENTOS DECORATIVOS SUTILES
   ============================================ */

/* Línea decorativa diagonal */
body::before {
    content: '';
    position: fixed;
    top: 20%;
    left: -50px;
    width: 150%;
    height: 2px;
    
    /* Gradiente horizontal con transparencia */
    background: linear-gradient(
        to right,
        transparent,
        rgba(180, 155, 120, 0.4) 20%,
        rgba(180, 155, 120, 0.5) 50%,
        rgba(180, 155, 120, 0.4) 80%,
        transparent
    );
    
    /* Rotación sutil de -5deg */
    transform: rotate(-5deg);
    
    /* Colocar detrás del contenido */
    z-index: 0;
    pointer-events: none;
}

/* Círculo decorativo difuminado (superior derecha) */
body::after {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    
    /* Círculo con gradiente radial suave */
    background: radial-gradient(
        circle,
        rgba(180, 155, 120, 0.15) 0%,
        rgba(212, 196, 176, 0.1) 50%,
        transparent 70%
    );
    
    /* Colocar detrás del contenido */
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   PÁGINA DE INICIO - BACKGROUND CON IMAGEN
   ============================================ */

body.home-page {
    /* Desactivar scroll */
    overflow: hidden;
    height: 100vh;
    
    /* Background con imagen hero - sin overlay */
    background-image: url('hero-background.jpg');
    background-color: #d4c4b0; /* Color de respaldo */
    
    /* Fijar el background */
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Ocultar elementos decorativos en la página de inicio */
body.home-page::before,
body.home-page::after {
    display: none;
}

/* ============================================
   NAVEGACIÓN
   ============================================ */

.navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    flex-wrap: wrap;
    gap: 20px;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

/* Navbar con fondo cuando se hace scroll */
.navigation.scrolled {
    background-color: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Logo/Nombre a la izquierda */
.nav-logo {
    color: #4a3d2f;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 2px;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.nav-logo:hover {
    color: #b49b78;
}

/* Contenedor de enlaces a la derecha */
.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: #5a4a3a;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 1px;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    border-bottom-color: #b49b78;
    color: #4a3d2f;
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */

.content {
    position: relative;
    z-index: 1;
    padding: 60px 40px;
    padding-top: 140px; /* Espacio para la navbar fija */
    max-width: 1200px;
    margin: 0 auto;
    color: #5a4a3a;
}

.content h1 {
    font-size: 3rem;
    margin-bottom: 30px;
    font-weight: 300;
    letter-spacing: 2px;
    text-align: center;
    color: #4a3d2f;
}

/* ============================================
   CONTENIDO DE PÁGINAS
   ============================================ */

.page-content {
    text-align: left;
}

.text-section {
    max-width: 800px;
    margin: 0 auto;
}

.text-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* ============================================
   GRID MASONRY PORTFOLIO
   ============================================ */

/* Contenedor principal del grid */
.portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 1.5rem;
    margin-top: 40px;
    width: 100%;
}

/* Columnas individuales - cada una es un contenedor flex */
.portfolio-gallery-column {
    display: flex;
    flex-direction: column;
}

/* Estilos para las imágenes del portfolio */
.portfolio-gallery img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    cursor: pointer;
    background: transparent; /* Sin fondo por defecto */
    display: block;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, outline 0.2s ease; /* Reducido de 0.3s para mejor rendimiento */
    min-height: 200px; /* Altura mínima para evitar layout shifts */
    /* Optimización de rendimiento - GPU acceleration */
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    /* Ocultar texto alternativo y iconos por defecto */
    color: transparent;
    font-size: 0;
}

/* Estado de carga - placeholder visible mientras no tiene src */
.portfolio-gallery img[data-src]:not([src]) {
    background: #2a2a2a; /* Fondo gris solo mientras carga */
    opacity: 0.5;
    /* Ocultar icono y texto del navegador */
    color: transparent;
    font-size: 0;
    text-indent: -9999px;
    /* Asegurar que no aparezca contenido */
    content: '';
    /* Ocultar cualquier icono de imagen rota */
    -webkit-user-drag: none;
}

/* Imágenes que ya tienen src cargado - sin fondo gris */
.portfolio-gallery img[src] {
    background: transparent;
    opacity: 1;
}

/* Imagen cargada - animación solo cuando carga */
.portfolio-gallery img.loaded {
    animation: fadeIn 0.3s ease-in;
}

/* Efecto hover en las imágenes */
.portfolio-gallery img:hover {
    transform: scale(1.02);
    outline: 2px solid rgba(201, 168, 130, 0.3);
    outline-offset: 4px;
}

/* Animación de aparición para las imágenes (solo cuando cargan) */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE GRID PORTFOLIO
   ============================================ */

/* Tablet: 3 columnas */
@media (max-width: 1024px) and (min-width: 641px) {
    .portfolio-gallery {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 1.25rem;
    }
    
    .portfolio-gallery img {
        margin-bottom: 1.25rem;
    }
}

/* Mobile: 2 columnas */
@media (max-width: 640px) {
    .portfolio-gallery {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 1rem;
    }
    
    .portfolio-gallery img {
        margin-bottom: 1rem;
    }
}

/* ============================================
   FORMULARIO DE CONTACTO
   ============================================ */

.contact-section {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    background: rgba(250, 248, 245, 0.4);
    padding: 40px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

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

.form-group-half {
    flex: 1;
    margin-bottom: 0;
}

.optional {
    font-size: 0.85rem;
    font-weight: 300;
    opacity: 0.7;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a3d2f;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(180, 155, 120, 0.3);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    font-size: 1rem;
    color: #4a3d2f;
    font-family: inherit;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #b49b78;
    background: rgba(255, 255, 255, 0.9);
}

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

.submit-btn {
    width: 100%;
    padding: 14px 30px;
    background: #b49b78;
    color: #faf8f5;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.submit-btn:hover {
    background: #9a8565;
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .navigation {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px 15px;
    }

    .nav-logo {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 25px;
        width: 100%;
        justify-content: flex-start;
    }

    .nav-link {
        font-size: 1rem;
    }

    .content {
        padding: 40px 20px;
        padding-top: 120px; /* Espacio ajustado para móvil */
    }

    .content h1 {
        font-size: 2rem;
    }

    .contact-form {
        padding: 30px 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group-half {
        margin-bottom: 25px;
    }
}

/* ============================================
   LIGHTBOX
   ============================================ */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.lightbox-container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    z-index: 10001;
    overflow: hidden;
    cursor: grab;
}

.lightbox-container.dragging {
    cursor: grabbing;
}

.lightbox-img {
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

/* Botones del lightbox */
.lightbox-close,
.lightbox-nav {
    position: absolute;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, opacity 0.2s ease;
    border-radius: 50%;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 3rem;
    line-height: 1;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Responsive - botones más pequeños en móvil */
@media (max-width: 640px) {
    .lightbox-close,
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 2rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}

/* ============================================
   TARJETAS DE CATEGORÍAS DEL PORTFOLIO
   ============================================ */

.portfolio-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 60px auto 0;
    padding: 0 20px;
}

.portfolio-category-card {
    background: linear-gradient(
        135deg,
        rgba(250, 248, 245, 0.9) 0%,
        rgba(245, 240, 234, 0.9) 50%,
        rgba(239, 232, 224, 0.9) 100%
    );
    border: 2px solid rgba(180, 155, 120, 0.3);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    text-decoration: none;
    color: #5a4a3a;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.portfolio-category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(180, 155, 120, 0.6);
    background: linear-gradient(
        135deg,
        rgba(250, 248, 245, 1) 0%,
        rgba(245, 240, 234, 1) 50%,
        rgba(239, 232, 224, 1) 100%
    );
}

.category-card-content h2 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 15px;
    color: #4a3d2f;
}

.category-card-content p {
    font-size: 1.1rem;
    opacity: 0.8;
    margin: 0;
}

/* Placeholder para contenido pendiente */
.portfolio-placeholder {
    max-width: 800px;
    margin: 80px auto 0;
    text-align: center;
    padding: 60px 40px;
    background: rgba(250, 248, 245, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(180, 155, 120, 0.2);
}

.portfolio-placeholder p {
    font-size: 1.3rem;
    color: #5a4a3a;
    opacity: 0.7;
    margin: 0;
}

/* Responsive - tarjetas */
@media (max-width: 768px) {
    .portfolio-categories {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 40px;
    }

    .portfolio-category-card {
        padding: 40px 30px;
        min-height: 250px;
    }

    .category-card-content h2 {
        font-size: 2rem;
        letter-spacing: 3px;
    }

    .category-card-content p {
        font-size: 1rem;
    }

    .portfolio-placeholder {
        margin-top: 60px;
        padding: 40px 20px;
    }

    .portfolio-placeholder p {
        font-size: 1.1rem;
    }
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: rgba(250, 248, 245, 0.6);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(180, 155, 120, 0.2);
    padding: 40px 20px;
    margin-top: 80px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    color: #4a3d2f;
    font-size: 0.9rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    color: #5a4a3a;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.footer-links a:hover {
    border-bottom-color: #b49b78;
    color: #4a3d2f;
}

@media (max-width: 768px) {
    .footer {
        padding: 30px 15px;
        margin-top: 60px;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}

/* ============================================
   PÁGINAS LEGALES
   ============================================ */

.legal-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    background: rgba(250, 248, 245, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    line-height: 1.8;
}

.legal-content h1 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-align: center;
    color: #4a3d2f;
}

.legal-content h2 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #4a3d2f;
    font-weight: 400;
    letter-spacing: 1px;
}

.legal-content h3 {
    font-size: 1.3rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #5a4a3a;
    font-weight: 400;
}

.legal-content p {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #5a4a3a;
    opacity: 0.9;
}

.legal-content ul {
    margin-left: 30px;
    margin-bottom: 20px;
}

.legal-content li {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #5a4a3a;
    opacity: 0.9;
}

.legal-content strong {
    color: #4a3d2f;
    font-weight: 500;
}

.legal-content a {
    color: #b49b78;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.legal-content a:hover {
    border-bottom-color: #b49b78;
    color: #4a3d2f;
}

@media (max-width: 768px) {
    .legal-content {
        padding: 30px 20px;
    }

    .legal-content h1 {
        font-size: 2rem;
    }

    .legal-content h2 {
        font-size: 1.5rem;
    }
}

/* ============================================
   PORTFOLIO VIDEOS - YOUTUBE EMBEDS
   ============================================ */

.portfolio-videos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    margin-top: 50px;
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.video-card {
    width: 100%;
    background: rgba(250, 248, 245, 0.7);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(180, 155, 120, 0.3);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(180, 155, 120, 0.6);
    background: rgba(250, 248, 245, 0.9);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* Aspect ratio 16:9 */
    height: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    border: 3px solid rgba(180, 155, 120, 0.4);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.video-card:hover .video-wrapper {
    border-color: rgba(180, 155, 120, 0.7);
    box-shadow: inset 0 2px 15px rgba(0, 0, 0, 0.15);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 9px;
}

.video-info {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(180, 155, 120, 0.2);
}

.video-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: #4a3d2f;
    margin-bottom: 12px;
    letter-spacing: 1px;
    line-height: 1.4;
}

.video-description {
    font-size: 1rem;
    color: #5a4a3a;
    opacity: 0.85;
    line-height: 1.6;
    margin: 0;
}

/* Responsive para videos */
@media (max-width: 1024px) {
    .portfolio-videos {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding: 0 15px;
    }
    
    .video-card {
        padding: 20px;
    }
    
    .video-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .portfolio-videos {
        gap: 2rem;
        margin-top: 30px;
        padding: 0 10px;
    }
    
    .video-card {
        padding: 15px;
        border-radius: 12px;
    }
    
    .video-wrapper {
        border-radius: 8px;
        border-width: 2px;
    }
    
    .video-info {
        margin-top: 20px;
        padding-top: 15px;
    }
    
    .video-title {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .video-description {
        font-size: 0.95rem;
    }
}

