html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    overflow-x: hidden;
}

body {
    font-family: "Roboto", sans-serif;
    background: #ffffff;
    color: #071A2F;
    font-size: 16px;
    line-height: 1.6;
}

.container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}

h1 {
    font-size: 3em;
    color: #fff;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

h2 {
    font-size: 2.5em;
    color: #0e2744;
    margin-bottom: 15px;
}

h3 {
    font-size: 1.6em;
    color: #0e2744;
}

p {
    font-size: 1.1em;
    line-height: 1.6;
}

.titulo-principal {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-weight: 500;
    color: #FAF9F6;
    font-size: clamp(40px, 6vw, 80px);
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.titulo-grande {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-weight: 600;
    color: #FAF9F6;
    font-size: clamp(70px, 10vw, 130px);
    line-height: 1.1;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.55);
    text-align: center;
    margin: 20px 0;
}

.titulo-grande span {
    display: block;
}

.texto-descriptivo {
    font-family: "Playfair Display", serif;
    color: #EDEDED;
    font-weight: 300;
    font-size: clamp(18px, 3vw, 32px);
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.info-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    background-color: #0e2744;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.info-btn:hover {
    background-color: #153a63;
    transform: translateY(-1px);
}

.toggle-info,
.extra-info {
    display: none;
}

header {
    background: linear-gradient(90deg, rgba(2, 0, 36, 1) 0%, rgba(78, 75, 150, 1) 35%, rgba(23, 8, 191, 1) 100%);
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    text-align: center;
    font-size: 0.96em;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 50px;
    width: auto;
}

.logo-text {
    font-size: 1.5em;
    color: #ffffff;
    letter-spacing: 1px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.45);
}

.logo-text:hover {
    text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.55);
    transform: translateY(-1px);
}

header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
}

header a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

header a:hover {
    color: #d7dfff;
}

#Inicio,
#Nosotros,
#Servicios {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#Inicio {
    background-image: url("tu casa, tu familia .png");
    min-height: 100vh;
    color: #ffffff;
    display: flex;
    align-items: center;
    position: relative;
    isolation: isolate;
}

#Inicio::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 15, 28, 0.35) 0%, rgba(7, 26, 47, 0.5) 100%);
    z-index: -1;
}

#Inicio .container {
    max-width: 980px;
    padding: 40px 0;
}

#Nosotros {
    background: linear-gradient(180deg, #ffffff 0%, #f4f2fa 100%);
    color: #071A2F;
    padding: 70px 0;
}

#Nosotros h2,
#Contacto h2 {
    text-align: center;
    text-shadow: 0 8px 18px rgba(7, 26, 47, 0.12);
}

.nosotros-card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 35px;
    margin: 5px auto 0;
    padding: 10px 0;
    width: 100%;
    max-width: 720px;
}

.about-card {
    background: rgba(48, 140, 245, 0.2);
    box-shadow: 0 6px 14px rgba(14, 39, 68, 0.25);
    border-radius: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: min(100%, 620px);
    height: 560px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    margin: 0 auto;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 22px rgba(14, 39, 68, 0.28);
}

.about-card-flip {
    perspective: 1400px;
    align-self: stretch;
}

.about-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s ease;
    transform-style: preserve-3d;
}

.about-card-flip.is-flipped .about-card-inner {
    transform: rotateY(180deg);
}

.about-card-front,
.about-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}

.about-card-back {
    transform: rotateY(180deg);
}

.about-card-info {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px;
    color: #071A2F;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
    position: relative;
}

.about-card-info h3 {
    color: #071A2F;
    font-size: 1.4rem;
    margin-bottom: 14px;
    text-align: center;
}

.about-card-info p {
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: justify;
    margin-bottom: 10px;
}

.about-card-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
}

.about-card-scroll::-webkit-scrollbar {
    width: 6px;
}

.about-card-scroll::-webkit-scrollbar-thumb {
    background: rgba(14, 39, 68, 0.4);
    border-radius: 10px;
}

.about-btn {
    position: sticky;
    bottom: 0;
    margin-top: 18px;
    padding: 14px 20px;
    background: #071A2F;
    color: #FAF9F6;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(7, 26, 47, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.about-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(7, 26, 47, 0.6);
}

#Servicios {
    background: linear-gradient(90deg, #0a0a2a 0%, #4e4b96 50%, #1708bf 100%);
    color: #ffffff;
    flex-direction: column;
    padding: 60px 20px;
    width: 100%;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 30px 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    width: 364px;
    height: 490px;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 95%;
    transition: transform 0.8s ease-in-out;
    transform-style: preserve-3d;
}

.service-card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.card-front {
    background-color: #ffffff;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-front .info-btn {
    width: calc(100% - 24px);
    margin: 0 12px 12px;
    border-radius: 10px;
    padding: 12px 18px;
    box-shadow: 0 6px 14px rgba(7, 26, 47, 0.22);
}

.info-btn-live {
    animation: livePulse 1.4s infinite;
    background: linear-gradient(135deg, #1708bf, #4e4b96);
    box-shadow: 0 0 0 rgba(78, 75, 150, 0.45);
}

.card-front img {
    width: 100%;
    height: 72%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.card-front h2 {
    color: #071A2F;
    font-size: 1.5rem;
    margin: 15px 0 5px 0;
}

.card-front p {
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.card-front-info {
    padding: 12px 18px 8px;
    background: #ffffff;
}

.card-front-info h3 {
    font-family: "Great Vibes", cursive;
    font-size: 2.4em;
    color: #071A2F;
    text-align: center;
    text-shadow: 1px 1px 6px rgba(106, 75, 175, 0.4);
}

.card-back {
    background: #faf5f5;
    transform: rotateY(180deg);
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-back h2,
.card-back h3 {
    color: #071A2F;
    margin-bottom: 10px;
}

.card-back p {
    color: #071A2F;
    font-size: 1rem;
    line-height: 1.4;
}

.close-back {
    display: inline-block;
    color: #071A2F;
    font-weight: bold;
    margin-bottom: 15px;
    text-decoration: none;
    cursor: pointer;
}

.close-back:hover {
    text-decoration: underline;
}

#Contacto {
    background: linear-gradient(180deg, #f9f9ff 0%, #eef4ff 100%);
    padding: 70px 20px;
}

.contact-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1160px;
    margin: 0 auto;
}

.contact-intro {
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
}

.contact-intro p {
    max-width: 620px;
    margin: 0 auto;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 24px;
}

.contact-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 12px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #071A2F, #1f4b8f);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(7, 26, 47, 0.16);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.contact-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(7, 26, 47, 0.22);
}

.contact-cta-secondary {
    background: linear-gradient(135deg, #f2c94c, #ddb037);
    color: #071A2F;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
    
}

.contact-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(14, 39, 68, 0.08);
    border-radius: 18px;
    padding: 22px;
    text-align: left;
    box-shadow: 0 12px 30px rgba(7, 26, 47, 0.08);
    min-height: 230px;
}

.contact-card h3 {
    margin-bottom: 10px;
}

.contact-card p + p {
    margin-top: 8px;
}

.social-links {
    display: grid;
    gap: 12px;
    justify-items: center;
    margin-top: 6px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 210px);
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #edf3ff;
    border: 1px solid rgba(15, 53, 96, 0.12);
    box-shadow: 0 8px 18px rgba(15, 53, 96, 0.08);
}

.social-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 53, 96, 0.14);
}

.contact-card-email {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-card:last-child {
    text-align: center;
}

.contact-card-location {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-address {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    justify-items: center;
}

.contact-address span {
    display: block;
    width: 100%;
    max-width: 240px;
    padding-left: 0;
    border-left: none;
    background: transparent;
    font-weight: 500;
    font-size: 1.1rem;
    line-height: 1.55;
}

.contact-address span:first-child {
    font-weight: 700;
}

.contact-address span:not(:first-child) {
    color: rgba(7, 26, 47, 0.82);
}

.contact-email-box {
    padding: 18px 16px;
    border-radius: 16px;
    background: #f5f8ff;
    border: 1px solid rgba(15, 53, 96, 0.08);
}

.contact-email-text {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
    color: #0f3560;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.contact-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.contact-mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border: none;
    border-radius: 999px;
    background: #0f3560;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.contact-mini-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 53, 96, 0.18);
}

.contact-mini-btn-secondary {
    background: #edf3ff;
    color: #0f3560;
    border: 1px solid rgba(15, 53, 96, 0.15);
}

.contact-note {
    font-size: 0.95rem;
    color: rgba(7, 26, 47, 0.75);
}

.contact-info a {
    color: #0f3560;
    font-weight: bold;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
    transition: color 0.3s ease, text-decoration-thickness 0.3s ease;
}

.contact-info a:hover {
    color: #1708bf;
    text-decoration-thickness: 3px;
}

footer {
    background: #071A2F;
    color: white;
    text-align: center;
    padding: 20px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(7, 26, 47, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #e2e6ea;
    padding: 20px;
    border-radius: 15px;
    width: min(90%, 700px);
    box-shadow: 0 5px 15px rgba(7, 26, 47, 0.3);
    text-align: center;
    animation: aparecer 0.4s ease;
    position: relative;
}

@keyframes aparecer {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    font-family: "Great Vibes", cursive;
    font-size: 3.2em;
    color: #0e2744;
    text-align: center;
    margin-top: -15px;
    margin-bottom: 15px;
    text-shadow: 1px 1px 6px rgba(7, 26, 47, 0.4);
}

.evento {
    display: none;
}

.evento.activo {
    display: block;
}

.evento img {
    width: 99%;
    max-width: 700px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 10px;
}

.close {
    color: rgba(7, 26, 47, 0.7);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #071A2F;
}

.flechas {
    position: absolute;
    top: 55%;
    width: 93%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.flechas button {
    background: rgba(7, 26, 47, 0.6);
    border: none;
    color: white;
    font-size: 24px;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.flechas button:hover {
    background: rgba(7, 26, 47, 0.9);
    transform: scale(1.03);
}

#btnEventos {
    list-style: none;
}

.boton-live {
    display: none;
    margin-top: 20px;
    text-align: center;
}

.boton-live a {
    display: inline-block;
    background: linear-gradient(135deg, #1708bf, #4e4b96);
    color: #FAF9F6;
    font-weight: bold;
    padding: 14px 18px;
    border-radius: 30px;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(7, 26, 47, 0.6);
    letter-spacing: 1px;
    transition: transform 0.3s ease;
}

.boton-live a:hover {
    transform: scale(1.05);
}

.youtube-parpadeo {
    animation: liveBlink 1s infinite;
}

@keyframes liveBlink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

@keyframes livePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(78, 75, 150, 0.45);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 0 0 10px rgba(78, 75, 150, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(78, 75, 150, 0);
    }
}

.mensaje-eventos {
    padding: 30px;
    text-align: center;
    color: #000000;
    font-family: "Great Vibes", cursive;
    font-size: 2.4em;
    line-height: 1.4;
    text-shadow: 1px 1px 6px rgba(7, 26, 47, 0.4);
}

.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1s ease, transform 1s ease;
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    transform: translateX(-60px);
}

.reveal-right {
    transform: translateX(60px);
}

.reveal-left.active,
.reveal-right.active {
    transform: translateX(0);
}

.tarjeta {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.tarjeta:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.18);
}

.cta-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 14px 30px;
    background: linear-gradient(90deg, #f2c94c, #e0b84a);
    color: #1f3c88;
    font-weight: 600;
    border-radius: 30px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.versiculo {
    font-style: italic;
    background: #f5f8ff;
    border-left: 4px solid #f2c94c;
    padding: 20px;
    margin: 40px auto;
    max-width: 800px;
    color: #333;
}

.versiculo span {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    color: #1f3c88;
}

.aviso-servicios {
    position: sticky;
    top: 90px;
    margin: 0 auto 20px;
    width: fit-content;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 13px;
    border-radius: 20px;
    z-index: 50;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.aviso-servicios.activo {
    opacity: 1;
    transform: translateY(0);
}

.aviso-servicios::after {
    content: " ->";
    animation: giroHint 1.5s infinite;
}

@keyframes giroHint {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }
}

section,
.container {
    max-width: 100%;
    box-sizing: border-box;
}

.contact-cta:focus-visible,
.contact-mini-btn:focus-visible,
.contact-info a:focus-visible,
header a:focus-visible,
.info-btn:focus-visible,
.about-btn:focus-visible,
.flechas button:focus-visible,
.close:focus-visible,
.service-card:focus-visible {
    outline: 3px solid #f2c94c;
    outline-offset: 3px;
}

#scrollUp {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: url("logo.png") no-repeat center center;
    background-size: cover;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

@media (min-width: 1200px) {
    #Servicios .card-container {
        gap: 40px;
        max-width: 1200px;
    }
}

@media (max-width: 900px) {
    .contact-info {
        grid-template-columns: 1fr;
    }

    .contact-card,
    .contact-card:last-child {
        text-align: left;
        min-height: auto;
    }

    .contact-card-location,
    .contact-card-email {
        text-align: left;
    }
}

@media (max-width: 768px) {
    #Inicio,
    #Nosotros,
    #Servicios {
        min-height: 100vh;
        background-attachment: scroll;
    }

    #Servicios {
        padding: 40px 10px;
    }

    .header-flex {
        flex-direction: column;
        gap: 15px;
    }

    header nav {
        gap: 16px;
    }

    .nosotros-card-container {
        flex-direction: column;
        align-items: center;
    }

    .about-card {
        width: min(100%, 290px);
        height: 650px;
        padding: 14px;
        border-radius: 16px;
    }

    .about-card-info {
        padding: 14px;
    }

    .about-card-info h3 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .about-card-info p {
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .about-card-scroll {
        padding-right: 4px;
    }

    .about-btn {
        margin-top: 10px;
        padding: 12px 18px;
        font-size: 13px;
    }

    .card-container {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .service-card {
        width: 100%;
        max-width: 364px;
        max-height: 470px;
    }
}

@media (max-width: 600px) {
    .logo-text {
        font-size: 1.3em;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
