/* --- 1. Variables y Reset --- */
:root {
    --color-fondo: #050507;
    --color-texto-principal: #F0F2F5;
    --color-texto-secundario: #A0A0B0;
    --color-acento: #6C63FF;
    --color-acento-glow: rgba(108, 99, 255, 0.4);
    --color-borde: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --font-sans: 'Poppins', sans-serif;
    --transition-smooth: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* --- CORRECCIÓN CRÍTICA PARA MÓVIL --- */
html,
body {
    width: 100%;
    max-width: 100vw;
    /* El ancho máximo es el ancho de la ventana */
    overflow-x: hidden;
    /* Corta todo lo que se salga por la derecha */
    position: relative;
    font-family: var(--font-sans);
    background-color: var(--color-fondo);
    color: var(--color-texto-principal);
    line-height: 1.7;
}

/* --- Intro Overlay --- */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.intro-logo img {
    width: 250px;
    max-width: 60vw;
    height: auto;
    opacity: 0;
    transform: scale(0.8);
    animation: introLogoAnim 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes introLogoAnim {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.intro-hidden {
    transform: translateY(-100%);
}

/* --- Tipografía --- */
h1,
h2,
h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-texto-principal);
    text-align: center;
}

h1 {
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1.1;
    margin-bottom: 20px;
    width: 100%;
}

h2 {
    font-size: clamp(2rem, 3vw, 3rem);
    margin-bottom: 40px;
    width: 100%;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

p {
    color: var(--color-texto-secundario);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.accent-text {
    color: var(--color-acento);
    text-shadow: 0 0 20px var(--color-acento-glow);
}

/* --- Header --- */
.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: var(--transition-smooth);
}

.header-logo {
    height: auto;
    width: 180px;
    max-width: 30vw;
    min-width: 120px;
    display: block;
}

.btn-primary {
    display: inline-block;
    padding: 16px 40px;
    background: var(--color-texto-principal);
    color: var(--color-fondo);
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
}

.btn-primary:hover {
    background: transparent;
    color: var(--color-texto-principal);
    border-color: var(--color-texto-principal);
    transform: scale(1.05);
}

.btn-outline {
    color: var(--color-texto-principal);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    transition: var(--transition-smooth);
}

.btn-outline:hover {
    border-color: var(--color-texto-principal);
    background: rgba(255, 255, 255, 0.05);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    /* Asegura ancho completo */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    /* Vital: corta partículas que se salgan */
    padding: 0 5%;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.6;
}

.moon-interactive-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75vmin;
    height: 75vmin;
    max-width: min(900px, 95vw, 95vh);
    max-height: min(900px, 95vw, 95vh);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(20, 20, 25, 1) 0%, #000 70%);
    box-shadow: inset -1.25rem -1.25rem 6.25rem rgba(255, 255, 255, 0.05), 0 0 8.125rem rgba(108, 99, 255, 0.55);
    z-index: 2;
    opacity: 0.8;
    animation: floatMoon 10s ease-in-out infinite;
}

@keyframes floatMoon {

    0%,
    100% {
        transform: translate(-50%, -50%) translateY(0);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-1.25rem);
    }
}

/* --- Redes Sociales en Hero --- */
.hero-social-container {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    opacity: 0;
    animation: fadeInUp 1s ease 0.5s forwards;
}

.social-label {
    font-size: 0.9rem;
    color: var(--color-texto-secundario);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.hero-social-icons {
    display: flex;
    gap: 20px;
}

.social-hero-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-texto-principal);
    font-size: 1.5rem;
    text-decoration: none;
    backdrop-filter: blur(5px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.social-hero-btn:hover {
    transform: translateY(-5px) scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* Colores de redes */
.social-hero-btn.instagram:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    box-shadow: 0 0 20px rgba(214, 36, 159, 0.6);
    border-color: transparent;
}

.social-hero-btn.tiktok:hover {
    background: #000;
    box-shadow: -3px -3px 0 rgba(0, 242, 234, 0.7), 3px 3px 0 rgba(255, 0, 80, 0.7), 0 0 20px rgba(255, 255, 255, 0.3);
    border-color: #333;
}

.social-hero-btn.linkedin:hover {
    background: #0077b5;
    box-shadow: 0 0 20px rgba(0, 119, 181, 0.6);
    border-color: #0077b5;
}

.social-hero-btn.facebook:hover {
    background: #1877F2;
    box-shadow: 0 0 20px rgba(24, 119, 242, 0.6);
    border-color: #1877F2;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Valores --- */
.valores {
    padding: 150px 5%;
    background: linear-gradient(to bottom, var(--color-fondo), #0b0b0e);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.valor-item {
    background: var(--glass-bg);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--color-borde);
    transition: var(--transition-smooth);
    text-align: left;
}

.valor-item h3 {
    text-align: left;
}

.valor-item:hover {
    transform: translateY(-10px);
    border-color: var(--color-acento);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.icon-large {
    font-size: 2.5rem;
    color: var(--color-acento);
    margin-bottom: 20px;
    display: inline-block;
}

/* --- Contacto (Glass Card) --- */
.contacto-section {
    padding: 0 5% 120px;
    background-color: #0b0b0e;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    /* Importante para contener el overflow del divider si fuera necesario */
    width: 100%;
}

.cosmic-divider {
    width: 100%;
    max-width: 900px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-acento), transparent);
    margin: 80px auto 100px;
    position: relative;
    opacity: 0.6;
}

.cosmic-divider::after {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #0b0b0e;
    padding: 0 15px;
    color: var(--color-acento);
    font-size: 1.4rem;
    text-shadow: 0 0 10px var(--color-acento);
}

.contacto-section::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

.contacto-container {
    width: 100%;
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.contact-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 50px 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.contact-card:hover {
    border-color: rgba(108, 99, 255, 0.3);
    box-shadow: 0 20px 60px rgba(108, 99, 255, 0.15);
}

.card-header {
    text-align: center;
    margin-bottom: 40px;
}

.card-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #a0a0b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.card-header p {
    font-size: 1rem;
    color: var(--color-texto-secundario);
    margin: 0;
}

.input-group {
    position: relative;
    margin-bottom: 30px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 15px 0;
    font-size: 1rem;
    color: #fff;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    outline: none;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.input-group label {
    position: absolute;
    top: 15px;
    left: 0;
    color: var(--color-texto-secundario);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-group input:focus~label,
.input-group input:not(:placeholder-shown)~label,
.input-group textarea:focus~label,
.input-group textarea:not(:placeholder-shown)~label {
    top: -10px;
    font-size: 0.85rem;
    color: var(--color-acento);
    font-weight: 600;
}

.input-group input:focus,
.input-group textarea:focus {
    border-bottom-color: var(--color-acento);
    box-shadow: 0 10px 10px -10px rgba(108, 99, 255, 0.3);
}

.btn-submit {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--color-acento) 0%, #4a43cb 100%);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 10px;
    letter-spacing: 1px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.4);
}

.confirmation-message {
    margin-top: 20px;
    text-align: center;
    color: #4cd964;
    font-weight: 500;
    animation: fadeIn 0.5s ease;
}

/* --- Galería --- */
.galeria-section {
    padding: 150px 5%;
    background: linear-gradient(to bottom, #0b0b0e, var(--color-fondo));
}

.galeria-subtitle {
    text-align: center;
    color: var(--color-texto-secundario);
    margin-bottom: 60px;
    font-size: 1.2rem;
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.galeria-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.galeria-img-wrapper {
    position: relative;
    aspect-ratio: 1;
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition-smooth);
    background: transparent;
    border: 2px solid rgba(108, 99, 255, 0.3);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.galeria-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.galeria-img-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(108, 99, 255, 0.3);
    border-color: #fff;
}

.galeria-img-wrapper:hover img {
    transform: scale(1.05);
}

.galeria-info {
    text-align: center;
}

.galeria-info h4 {
    color: var(--color-texto-principal);
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.galeria-info .price {
    color: var(--color-acento);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0;
}

/* --- Footer --- */
.footer {
    padding: 80px 5% 30px;
    background: linear-gradient(to bottom, var(--color-fondo), #000);
    border-top: 1px solid var(--color-borde);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto 50px;
}

.footer-section h3 {
    color: var(--color-texto-principal);
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-align: left;
}

.footer-section p {
    color: var(--color-texto-secundario);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 10px;
}

.footer-section p i {
    margin-right: 10px;
    color: var(--color-acento);
}

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

.footer-social a {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--color-borde);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-texto-secundario);
    font-size: 1.2rem;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.footer-social a:hover {
    background: var(--color-acento);
    border-color: var(--color-acento);
    color: #fff;
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--color-borde);
    color: var(--color-texto-secundario);
    font-size: 0.9rem;
}

/* --- Lightbox --- */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

.lightbox-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(108, 99, 255, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    color: var(--color-texto-principal);
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.lightbox-close:hover {
    background: var(--color-acento);
    transform: rotate(90deg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .contacto-container {
        padding: 0 20px;
    }

    .moon-interactive-bg {
        width: 90vmin;
        height: 90vmin;
        max-width: min(750px, 95vw, 95vh);
        max-height: min(750px, 95vw, 95vh);
    }

    .galeria-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-section h3 {
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }
}