:root {
    --neon-blue: #00f2ff;
    --neon-purple: #bc13fe;
    --neon-green: #25d366;
    --glass-border: rgba(255, 255, 255, 0.2);
    --glow-blue: 0 0 20px rgba(0, 242, 255, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; color: white; background: #000; overflow-x: hidden; }

.main-background { 
    position: fixed; width: 100%; height: 100%; 
    background: url('Imagenes/fondo.jpg') center/cover; 
    z-index: -1; filter: brightness(0.4); 
}

.container-master { width: 100%; padding-bottom: 40px; display: flex; flex-direction: column; align-items: center; }

/* --- ESTILO GENERAL HEADER (PC) --- */
.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.back-btn-glass {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 242, 255, 0.4); 
    border-radius: 50%; 
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.back-btn-glass span {
    color: #00f2ff;
    font-size: 3rem;
    font-weight: 300;
    line-height: 1;
    display: block;
    margin-top: -8px;
    margin-right: 2px;
    text-shadow: 0 0 12px rgba(0, 242, 255, 0.7);
}

.back-btn-glass:hover {
    background: rgba(0, 242, 255, 0.1);
    transform: scale(1.1);
    border-color: #00f2ff;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
}

/* --- LOGO CRISTAL --- */
.main-header {
    width: 100%;
    padding: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    padding: 10px 30px;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: 0.4s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo:hover {
    border-color: var(--neon-blue);
    box-shadow: var(--glow-blue);
    transform: translateY(-2px);
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(0, 242, 255, 0.4)); 
    transition: all 0.3s ease;
}

.flex-servicios { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 30px; 
    justify-content: flex-start;
    align-items: flex-start; 
    padding: 0 30px;
    max-width: 1300px;
    margin: 0 auto;
}

.serv-card.glass-main {
    /* El 1 permite que se encojan si hay presión, el 0 evita que crezcan solas, 280px es su base */
    flex: 1 0 280px; 
    max-width: 280px;
    height: 580px;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
}

/* Cuando una tarjeta se activa */
.serv-card.active {
    flex: 0 0 580px; /* Tamaño expandido */
    max-width: 580px;
    z-index: 10;
}

/* Efecto para las que NO están activas: 
   Obligamos a que se encojan un poco para que la suma total 
   siempre sea menor al ancho del contenedor. */
.flex-servicios { 
    display: flex; flex-wrap: wrap; gap: 30px; justify-content: center; /* Centrado para que no bailen al cerrar */
    padding: 0 30px; max-width: 1400px; margin: 0 auto;
}

/* --- TARJETAS ESTRUCTURA PC --- */
.serv-card.glass-main {
    flex: 0 0 280px; /* Tamaño base sólido */
    width: 280px; height: 580px;
    background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); border-radius: 25px;
    padding: 15px; display: flex; overflow: hidden; cursor: pointer;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.serv-card.active {
    flex: 0 0 580px; 
    width: 580px; 
    border-color: var(--neon-blue);
    box-shadow: var(--glow-blue);
    z-index: 10;
}

/* NUEVA LÓGICA: Solo afecta a las de su misma fila (vía JS class) */
.serv-card.sibling-active {
    flex: 0 1 200px; /* Se encogen pero no tanto para no romper la imagen */
    width: 200px;
    opacity: 0.3;
    filter: blur(5px) grayscale(80%);
    pointer-events: none;
    transform: scale(0.95);
}

/* --- BLOQUE IZQUIERDO --- */
.card-visible-part {
    width: 250px; min-width: 170px; /* min-width permite encogerse sin romperse */
    height: 100%; display: flex; flex-direction: column; justify-content: space-between;
    transition: width 0.6s ease;
}

.sub-card-img {
    width: 100%; height: 430px; border-radius: 15px; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.sub-card-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }

.name-glass {
    padding: 12px; background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border); border-radius: 12px;
    color: var(--neon-blue); font-weight: 800; text-align: center;
    font-size: 0.85rem; text-transform: uppercase; margin-bottom: 5px;
}

/* --- BLOQUE DE INFO (DERECHA) --- */
.card-info-side { 
    flex: 1; opacity: 0; padding-left: 20px; display: none; height: 100%; 
}
.serv-card.active .card-info-side { display: flex; flex-direction: column; opacity: 1; }

.glass-info { 
    width: 100%; height: 100%; 
    display: flex; flex-direction: column; 
    justify-content: space-between; 
}

.info-content-scroll {
    height: 430px; background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); border-radius: 20px; padding: 20px; transition: 0.4s;
}
.info-content-scroll:hover { background: rgba(255, 255, 255, 0.08); box-shadow: var(--glow-blue); }

.price { font-size: 2.2rem; color: var(--neon-purple); font-weight: 800; margin: 15px 0; display: block; }

/* --- BLOQUE WHATSAPP --- */
.wa-glass-container { 
    margin-top: auto; 
    margin-bottom: 5px; 
}

.wa-btn-glass {
    display: block; padding: 12px; border-radius: 12px;
    background: rgba(37, 211, 102, 0.1);
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--neon-green);
    color: var(--neon-green); text-align: center; text-decoration: none;
    font-weight: 800; text-transform: uppercase; font-size: 0.85rem;
    transition: 0.4s;
    box-shadow: 0 0 10px rgba(37, 211, 102, 0.2);
}

.wa-btn-glass:hover {
    background: rgba(37, 211, 102, 0.25);
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.4);
    transform: translateY(-2px);
    color: white;
}

/* --- EFECTO DESVANECER (SIN DESAPARECER) --- */
.flex-servicios:has(.serv-card.active) .serv-card:not(.active) {
    opacity: 0.35; 
    filter: blur(4px) grayscale(60%); 
    pointer-events: none;
    transform: scale(0.96); 
}

/* --- MENÚ REDES --- */
.menu-social-container {
    position: fixed; bottom: 25px; right: 25px;
    display: flex; flex-direction: column; align-items: center;
    gap: 15px; z-index: 10000;
}

.glass-main-btn {
    order: 2; width: 60px; height: 60px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border); color: white;
    cursor: pointer; display: flex; justify-content: center; align-items: center;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-main-btn:hover, .social-options.active + .glass-main-btn {
    border-color: var(--neon-blue);
    box-shadow: var(--glow-blue);
    transform: scale(1.1);
}

.social-options {
    order: 1; display: flex; flex-direction: column; gap: 12px;
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: 0.4s ease;
}

.social-options.active { opacity: 1; visibility: visible; transform: translateY(0); }

.glass-item {
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(10px);
    display: flex; justify-content: center; align-items: center;
    transition: 0.3s; border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-item[title="WhatsApp"]:hover { border-color: #25d366; box-shadow: 0 0 15px #25d366; }
.glass-item[title="Instagram"]:hover { border-color: #e1306c; box-shadow: 0 0 15px #e1306c; }
.glass-item[title="Correo"]:hover { border-color: #ea4335; box-shadow: 0 0 15px #ea4335; }

.glass-item img { width: 26px; height: 26px; }
.glass-item:hover { transform: scale(1.15); }


/* --- SECCIÓN MÓVIL --- */
@media (max-width: 768px) {
    
    .main-background {
        background-position: center center;
        background-size: cover;
        background-attachment: fixed; /* Mantiene el fondo quieto mientras scrolleas */
        height: 100vh;
        width: 100vw;
        /* Un ligero zoom para asegurar la cobertura sin deformar */
        transform: scale(1.05); 
    }

    /* Alineación de Flecha y Logo */
    .header-mobile-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px; 
        width: 100%;
        max-width: 360px; 
        margin: 0 auto;
    }

    /* Botón de Regreso REDONDO */
    .back-btn-glass {
        width: 60px;
        height: 60px;
        display: flex;
        justify-content: center;
        align-items: center; 
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(0, 242, 255, 0.4); 
        border-radius: 50%; 
        text-decoration: none;
        transition: all 0.3s ease;
        flex-shrink: 0;
        overflow: hidden; 
    }

    .back-btn-glass span {
        color: #00f2ff; 
        font-size: 3rem; 
        font-weight: 300;
        line-height: 1;
        display: block;
        margin-top: -8px; 
        margin-right: 2px; 
        text-shadow: 0 0 12px rgba(0, 242, 255, 0.7);
    }

    .back-btn-glass:active {
        transform: scale(0.9);
        background: rgba(0, 242, 255, 0.1);
    }

    /* Ajustes de Logo y Header en Móvil */
    .main-header { padding: 20px 0; }
    
    .logo { 
        padding: 0; 
        width: 295px; 
        height: 60px; 
        display: flex;
        justify-content: center;
        align-items: center;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--glass-border);
        border-radius: 50px; 
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        margin: 0; 
    }

    .logo-img { 
        height: 45px; 
        width: auto;
        filter: drop-shadow(0 0 12px rgba(0, 242, 255, 0.6));
    }

    /* Contenedor de Servicios en Móvil */
    .flex-servicios {
        flex-direction: column;
        align-items: center; /* Centra las tarjetas una sobre otra */
        gap: 25px;
        padding-bottom: 50px;
        justify-content: flex-start; /* Alineación al inicio del flujo vertical */
    }

    /* TARJETA: Base cerrada */
    .serv-card.glass-main {
        flex: 0 0 auto;
        width: 100% !important;
        max-width: 295px; 
        height: 430px;
        max-height: 430px; 
        display: flex;
        flex-direction: column;
        padding: 12px;
        transition: all 0.7s cubic-bezier(0.19, 1, 0.22, 1);
        overflow: hidden;
        will-change: max-height, transform;
    }

    /* ESTADO ABIERTO */
    .serv-card.active {
        height: auto;
        max-height: 2000px; 
        overflow: visible; 
        padding-bottom: 30px; 
        border-color: var(--neon-blue);
        box-shadow: var(--glow-blue);
    }

    .card-visible-part {
        width: 100%;
        height: 405px !important;
        display: flex;
        flex-direction: column;
        justify-content: space-between; 
        flex-shrink: 0; 
    }

    .sub-card-img {
        height: 350px !important;
        width: 100%;
        border-radius: 15px;
        overflow: hidden;
    }
    
    .sub-card-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* NOMBRE */
    .name-glass {
        width: 100%;
        margin-top: 15px;
        padding: 10px 0;
        display: flex;
        justify-content: center;
        align-items: center;
        background: rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.85rem;
    }

    /* BLOQUE DE INFO */
    .card-info-side {
        padding: 0;
        margin-top: 25px; 
        width: 100%;
        display: none; 
        flex-direction: column;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        transform: translateY(10px);
        transition: max-height 0.7s cubic-bezier(0.19, 1, 0.22, 1), 
                    opacity 0.4s ease, 
                    transform 0.5s ease;
    }

    .serv-card.active .card-info-side {
        display: flex !important;
        max-height: 1200px; 
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        margin-bottom: 10px;
    }

    .info-content-scroll {
        width: 100%;
        height: auto;
        min-height: 200px;
        background: rgba(255, 255, 255, 0.04);
        border-radius: 20px;
        padding: 20px;
        border: 1px solid var(--glass-border);
    }

    /* BOTÓN WHATSAPP */
    .wa-glass-container {
        margin-top: 25px; 
        width: 100%;
        display: flex;
        justify-content: center;
        padding-bottom: 15px;
    }

    .wa-btn-glass {
        width: 100%;
        padding: 14px 0;
        display: flex;
        justify-content: center;
        align-items: center;
        background: rgba(37, 211, 102, 0.18);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(37, 211, 102, 0.4);
        border-radius: 10px;
        color: #fff;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.85rem;
        text-decoration: none;
    }
}