/* --- VARIABLES Y CONFIGURACIÓN BASE --- */
:root {
    --primary-red: #c62828;
    --white: #ffffff;
    --text-dark: #333;
    --bg-light: #fcfcfc;
    --font-main: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- ANIMACIONES DE CARGA RÁPIDAS (KEYFRAMES) --- */
@keyframes expandContainer {
    from {
        transform: scaleX(0);
        opacity: 0;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- HEADER & NAVBAR --- */
.header {
    background-color: var(--primary-red);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.brand { 
    color: var(--white); 
    font-weight: 700; 
    font-size: 1.5rem; 
    text-decoration: none; 
}

.nav-links { 
    display: flex; 
    list-style: none; 
    gap: 30px; 
}

.nav-links a { 
    color: var(--white); 
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: rgba(255,255,255,0.8);
}

/* --- SECCIÓN INTRO (CONTACTO) --- */
.contacto-intro {
    text-align: left;
    margin-top: 150px;
}

.title-bg-stretch {
    background-color: var(--primary-red);
    margin-left: 20%; 
    width: 80%;      
    padding: 20px 40px;
    margin-bottom: 40px;
    
    transform-origin: right; 
    opacity: 0;
    animation: expandContainer 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.main-title {
    color: var(--white);
    font-size: 3.5rem;
    font-weight: 400;
    text-transform: none;
    
    opacity: 0;
    animation: fadeInText 0.4s ease-out forwards;
    animation-delay: 0.35s;
}

.text-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 50px;
    
    opacity: 0;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 0.5s;
}

.description {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 40px;
}

.btn-contactame {
    display: inline-block;
    background-color: var(--primary-red);
    color: var(--white);
    padding: 15px 60px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-contactame:hover {
    transform: scale(1.05);
}

/* --- SECCIÓN REDES SOCIALES --- */
.redes-section {
    margin-top: 80px;
    padding-bottom: 100px;
    
    opacity: 0;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 0.6s;
}

/* --- TÍTULO REDES SOCIALES CENTRADO --- */
.sub-title-wrapper {
    width: 100%;
    display: flex;
    justify-content: center; 
    margin-bottom: 50px;
}

.sub-title-box {
    background-color: var(--primary-red);
    color: var(--white);
    display: inline-block;
    padding: 10px 40px;
    font-weight: 600;
    text-align: center;
}

/* --- GRID DE REDES --- */
.redes-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); 
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.red-card {
    grid-column: span 2; 
    background: white;
    border: 1px solid #ddd;
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
}

.red-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}

/* Centrar la tarjeta de Drive manteniendo el tamaño cuadrado exacto de las demás */
.card-centered {
    grid-column: 2 / span 4;       /* Se posiciona en el espacio central del grid */
    justify-self: center;          /* Evita que se estire y la mantiene en su tamaño original */
    width: 100%;                   
    max-width: calc(48.833% - 10px); /* Forzamos exactamente el mismo ancho que las tarjetas de 2 columnas */
}

/* --- CONTENEDOR DE ICONOS Y SVGS --- */
.icon-box {
    background-color: var(--primary-red);
    height: 180px; 
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px; 
    overflow: hidden; 
}

.icon-box svg {
    width: 100%;
    height: 100%;
    max-width: 80px;  
    max-height: 80px; 
    object-fit: contain; 
    display: block;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.red-card:hover .icon-box svg {
    transform: scale(1.08);
}

.card-footer {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #444;
    font-weight: 500;
}

.arrow { 
    font-size: 1.2rem; 
}

/* --- BOTONES FLOTANTES DE CONTACTO --- */
.contacto-flotante {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 12px;
    font-family: 'Montserrat', sans-serif;
}

.contacto-item {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 10px;
}

.contacto-boton {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border: none;
    border-radius: 50%;
    background: #D92332;
    color: white;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px #0003;
    transition: transform .25s, background .25s;
}

.contacto-boton svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.contacto-boton::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -7px;
    border-radius: 50%;
    background: #D9233266;
    animation: contacto-destello 1.8s ease-out infinite;
    pointer-events: none;
}

.contacto-boton::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -7px;
    border: 2px solid #D9233299;
    border-radius: 50%;
    animation: contacto-onda 1.8s ease-out infinite .6s;
    pointer-events: none;
}

@keyframes contacto-destello {
    0%, 100% {
        opacity: .25;
        transform: scale(.92);
    }
    50% {
        opacity: .85;
        transform: scale(1.12);
    }
}

@keyframes contacto-onda {
    0% {
        opacity: .8;
        transform: scale(.85);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

.contacto-boton:hover {
    background: #B91828;
    transform: scale(1.08);
}

.contacto-panel {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 0;
    max-width: calc(100vw - 120px);
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    background: white;
    color: #222;
    border-radius: 12px;
    box-shadow: 0 4px 20px #0002;
    transition: width .3s, padding .3s, opacity .2s,
                transform .3s, visibility .3s;
}

.contacto-item:hover .contacto-panel,
.contacto-item:focus-within .contacto-panel {
    width: 220px;
    padding: 12px 16px;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.contacto-panel-titulo {
    font-size: 12px;
    font-weight: 700;
    color: #D92332;
}

.contacto-panel-dato {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contacto-panel-ayuda {
    font-size: 10px;
    color: #777;
    transition: color 0.2s ease;
}

.contacto-item:nth-child(2) .contacto-boton {
    cursor: copy;
}

/* --- RESPONSIVE ADAPTADO --- */
@media (max-width: 768px) {
    .title-bg-stretch {
        margin-left: 10%;
        width: 90%;
        padding: 15px 25px;
        transform-origin: right;
    }
    .main-title { font-size: 1.8rem; }
    .text-content { padding: 0 20px; }
    .redes-grid { display: flex; flex-direction: column; align-items: center; }
    .red-card { width: 100%; max-width: 300px; grid-column: auto !important; }
    
    .red-card:hover { transform: none; box-shadow: none; } 
    .red-card:hover .icon-box svg { transform: none; }
}

@media (max-width: 480px) {
    .contacto-flotante {
        right: 16px;
        bottom: 16px;
        gap: 10px;
    }

    .contacto-boton {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
    }

    .contacto-boton svg {
        width: 24px;
        height: 24px;
    }

    .contacto-item:hover .contacto-panel,
    .contacto-item:focus-within .contacto-panel {
        width: min(190px, calc(100vw - 110px));
        padding: 10px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contacto-boton::before,
    .contacto-boton::after {
        animation: none;
    }

    .contacto-boton,
    .contacto-panel {
        transition: none;
    }
}