:root {
    --violeta-logo: #7d1dbd; /* Violeta similar al borde del logo */
    --celeste-logo: #2995c0; /* Celeste similar al degradado del logo */
    --azul-logo: #2b67d6; /* Un tono de azul/púrpura más oscuro para contrastar con el celeste */
    --blanco-logo: #FFFFFF; /* Blanco del texto en el logo */
    --negro-logo: #1a1a1a; /* Negro más suave para texto principal */
    --dorado-logo: #FFD700; /* Dorado de la borla del birrete */
    --gris-claro: #f8f9fa;
    --gris-medio: #ececec;
    --text-color-dark: #333; /* Color de texto oscuro para legibilidad */
    --text-color-medium: #555; /* Color de texto medio */
    --text-color-light: #666; /* Color de texto claro */
}

/* --- Estilos Generales --- */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.7;
    color: var(--text-color-dark);
    background-color: var(--gris-claro);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--azul-logo);
}

p {
    margin-bottom: 1rem;
    color: var(--text-color-dark);
}

a {
    color: var(--violeta-logo);
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

a:hover {
    color: var(--azul-logo);
}

/* --- Header y Navegación --- */
.header {
    background-color: #8324d6;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    padding: 0;
}

.logo {
    max-width: 140px;
    height: auto;
}

.main-nav .li-menu {
    list-style-type: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    font-size: 17px;
}

.main-nav .li-menu li a {
    text-decoration: none;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav .li-menu li a:hover {
    color: black;
}

.abrir-menu,
.cerrar-menu {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--blanco-logo);
    text-align: center;
}

.hero-section .carousel-item {
    height: 100vh;
    width: 100vw;
}

.hero-section .carousel-item img {
    object-fit: cover;
    height: 100%;
    width: 100%;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 0;
        height: auto; /* Adjusted for better responsiveness */
    }

    .hero-section .carousel-item {
        height: 40vh; /* Increased height for better visibility on tablets */
        max-height: 400px; /* Max height to prevent overly tall images */
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: auto;
    }

    .hero-section .carousel-item {
        height: 30vh; /* Adjusted for very small screens */
        max-height: 300px; /* Max height for very small screens */
    }
}

/* --- Secciones Generales --- */
.section-padding {
    padding: 80px 15px;
    background-color: var(--blanco-logo);
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease-out;
    box-sizing: border-box;
}

.section-padding:hover {
    transform: translateY(-5px);
}

.section-padding h2 {
    font-size: 2.8em;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    color: var(--azul-logo);
}

.section-padding h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--celeste-logo);
    border-radius: 2px;
}

.section-intro-text {
    text-align: justify;
    max-width: 700px;
    margin: 0 auto 50px auto;
    font-size: 1.15em;
    color: var(--text-color-medium);
}

/* --- Sección de Servicios --- */
.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.servicio-card {
    background-color: var(--blanco-logo);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border: 1px solid var(--celeste-logo);
    transform: translateY(0);
}

.servicio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.servicio-card .icon-wrapper {
    width: 80px;
    height: 80px;
    background-color: var(--celeste-logo);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    transition: background-color 0.3s ease-in-out;
}

.servicio-card:hover .icon-wrapper {
    background-color: var(--violeta-logo);
}

.servicio-card .icon-wrapper img {
    width: auto;
    height: 60px;
    max-width: 60px;
}

.servicio-card h3 {
    color: var(--azul-logo);
    font-size: 1.8em;
    margin-bottom: 15px;
}

.servicio-card p {
    color: var(--text-color-light);
    font-size: 1em;
    text-align: justify;
}

/* --- ESTILOS MEJORADOS PARA MÓVILES (hasta 768px) --- */
@media (max-width: 768px) {
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en tablets */
        gap: 20px;
    }

    .servicio-card {
        padding: 20px;
    }

    .servicio-card .icon-wrapper {
        width: 60px;
        height: 60px;
        margin: 0 auto 15px auto;
    }

    .servicio-card .icon-wrapper img {
        height: 40px;
        max-width: 40px;
    }

    .servicio-card h3 {
        font-size: 1.3em;
        margin-bottom: 10px;
    }

    .servicio-card p {
        font-size: 0.9em;
        text-align: center; /* Centrar el texto en este layout */
    }
}

/* --- ESTILOS PARA MÓVILES MUY PEQUEÑOS (hasta 480px) --- */
@media (max-width: 480px) {
    .servicios-grid {
        grid-template-columns: 1fr; /* Una columna en pantallas muy pequeñas */
        gap: 20px;
    }

    .servicio-card {
        padding: 20px;
    }

    .servicio-card .icon-wrapper {
        width: 60px;
        height: 60px;
    }

    .servicio-card .icon-wrapper img {
        height: 40px;
        max-width: 40px;
    }

    .servicio-card h3 {
        font-size: 1.3em;
    }

    .servicio-card p {
        font-size: 0.9em;
    }
}

/* --- Flipbook ("Nosotros") --- */
.flipbook-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
    padding: 60px 15px;
    background-color: var(--gris-claro);
    box-sizing: border-box;
}

.flipbook-container {
    width: 610px;
    height: 500px;
    position: relative;
    transform-style: preserve-3d;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.page {
    width: 100%;
    height: 100%;
    position: absolute;
    background-color: #fdfdfd;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
    backface-visibility: hidden;
    transform-origin: left center;
    transition: transform 0.8s ease-in-out, z-index 0.0s 0.4s;
    border-radius: 3%;
    text-align: center;
}

.page h1, .page h2 {
    margin-bottom: 10px;
    color: #333;
}

.flipbook-section .page p {
    font-size: 15px;
    text-align: justify;
    line-height: 1.5;
    color: #000000;
}

.cover {
    background-color: #ffffff;
    color: rgb(0, 0, 0);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    z-index: 10;
    justify-content: center;
}

.back-cover {
    background-color: #4a90e2;
    color: rgb(0, 0, 0);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    transform: rotateY(180deg);
    z-index: 1;
    justify-content: center;
}

.image-container {
    width: 60%;
    height: 40%;
    margin: 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 5px;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.controls {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

.controls button {
    padding: 12px 25px;
    font-size: 17px;
    cursor: pointer;
    background-color: #6a5acd;
    color: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
    outline: none;
}

.controls button:hover {
    background-color: #5544b3;
    transform: translateY(-2px);
}

.controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.mensaje {
    text-align: center;
    color: #5b078b;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .flipbook-section {
        padding: 30px 10px;
        min-height: auto;
    }

    .flipbook-container {
        width: 90vw;
        max-width: 400px;
        height: 70vh; /* Adjusted for better proportion on tablets */
        max-height: 550px; /* Limita la altura máxima en tablets */
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    .page {
        padding: 20px;
    }

    .page h1 {
        font-size: 1.8em;
    }

    .page h2 {
        font-size: 1.5em;
    }

    .flipbook-section .page p {
        font-size: 14px;
    }

    .mensaje {
        font-size: 1em;
        margin-top: 10px;
    }

    .image-container {
        width: 80%;
        height: 35%;
        margin: 10px 0;
    }

    .controls {
        display: flex;
        flex-direction: row; /* Keep buttons side-by-side if enough space */
        gap: 15px;
        margin-top: 20px;
    }

    .controls button {
        padding: 10px 20px;
        font-size: 15px;
        width: auto; /* Adjust width naturally */
        max-width: 150px; /* Max width for individual buttons */
    }
}

@media (max-width: 480px) {
    .flipbook-container {
        height: 70vh; /* Keep consistent with 768px but may adjust max-height */
        max-height: 480px; /* Adjusted for smaller mobile screens */
    }

    .page {
        padding: 15px;
    }

    .page h1 {
        font-size: 1.5em;
    }

    .page h2 {
        font-size: 1.3em;
    }

    .flipbook-section .page p {
        font-size: 13px;
    }

    .controls {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .controls button {
        width: 90%; /* Make buttons full width */
        max-width: 220px;
        margin-bottom: 0; /* Removed this specific margin here as gap handles it */
    }
}

/* --- Blog y Galería (Owl Carousel) --- */
.gallery-carousel .owl-carousel .item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.gallery-carousel .owl-carousel .item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.gallery-carousel .owl-carousel .item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
    color: var(--blanco-logo);
    padding: 15px 10px 5px 10px;
    font-size: 1.1em;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.gallery-carousel .owl-carousel .item:hover .carousel-caption {
    opacity: 1;
}

/* --- Testimonios --- */
.testimonios-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Force 2 columns for wider screens */
    gap: 30px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .testimonios-grid {
        grid-template-columns: 1fr; /* Single column on smaller screens */
        gap: 20px;
        width: 90%;
    }
}

.testimonio-card {
    background-color: var(--blanco-logo);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    text-align: center;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border: 1px solid var(--violeta-logo);
}

.testimonio-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

.testimonio-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 4px solid var(--celeste-logo);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.testimonio-card h3 {
    color: var(--azul-logo);
    font-size: 1.5em;
    margin-bottom: 10px;
}

.testimonio-card p {
    font-style: italic;
    color: var(--text-color-medium);
}

/* --- Preguntas Frecuentes (FAQ) --- */
#faqAccordion .card {
    border: 1px solid var(--gris-medio);
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#faqAccordion .card-header {
    background-color: var(--gris-claro);
    padding: 0;
    border-bottom: 1px solid var(--gris-medio);
}

#faqAccordion .btn-link {
    width: 100%;
    text-align: left;
    padding: 15px 20px;
    font-size: 1.1em;
    font-weight: 500;
    color: var(--azul-logo);
    text-decoration: none;
    transition: color 0.3s ease;
    white-space: normal;
    word-wrap: break-word;
}

#faqAccordion .btn-link:hover {
    color: var(--violeta-logo);
}

#faqAccordion .card-body {
    padding: 20px;
    background-color: var(--blanco-logo);
    color: var(--text-color-dark);
    font-size: 0.95em;
}

@media (max-width: 768px) {
    #faqAccordion .card {
        margin-bottom: 10px;
    }

    #faqAccordion .btn-link {
        padding: 12px 15px;
        font-size: 1em;
    }

    #faqAccordion .card-body {
        padding: 15px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    #faqAccordion .card {
        border-radius: 5px;
    }

    #faqAccordion .btn-link {
        padding: 10px 12px;
        font-size: 0.95em;
    }

    #faqAccordion .card-body {
        padding: 12px;
        font-size: 0.85em;
    }
}

/* --- Contacto --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.contact-info, .contact-form {
    background-color: var(--blanco-logo);
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 40px;
    border: 1px solid var(--celeste-logo);
    transition: all 0.3s ease-in-out;
}

.contact-info:hover, .contact-form:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.contact-info h3, .contact-form h3 {
    color: var(--violeta-logo);
    font-size: 2.5em;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.contact-info h3::after, .contact-form h3::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--azul-logo);
    border-radius: 2px;
}

.contact-info p {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    color: var(--text-color-dark);
    font-size: 1.15em;
    line-height: 1.6;
}

.contact-info p i {
    font-size: 1.6em;
    color: var(--celeste-logo);
    margin-right: 20px;
    width: 35px;
    text-align: center;
    flex-shrink: 0;
}

.social-icons-contact {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
}

.social-icons-contact .social-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--azul-logo);
    color: var(--blanco-logo);
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 120px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.social-icons-contact .social-icon-btn i {
    margin-right: 8px;
    font-size: 1.2em;
}

.social-icons-contact .social-icon-btn:hover {
    background-color: var(--violeta-logo);
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    color: var(--blanco-logo);
}

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

.contact-form label {
    font-weight: 700;
    color: var(--text-color-dark);
    margin-bottom: 10px;
    display: block;
    font-size: 1.05em;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid var(--gris-medio);
    padding: 14px 18px;
    font-size: 1.05em;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--azul-logo);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(43, 103, 214, 0.2);
    outline: none;
}

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

.contact-form button[type="submit"] {
    width: 100%;
    max-width: 400px;
    padding: 15px 30px;
    font-size: 1.15em;
    border-radius: 8px;
    background-color: var(--azul-logo);
    color: var(--blanco-logo);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    margin: 30px auto 0 auto;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.contact-form button[type="submit"]:hover {
    background-color: var(--violeta-logo);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-info, .contact-form {
        padding: 30px 25px;
    }

    .contact-info h3, .contact-form h3 {
        font-size: 2em;
        margin-bottom: 20px;
    }

    .contact-info p {
        font-size: 1em;
        margin-bottom: 15px;
    }

    .contact-info p i {
        font-size: 1.4em;
        margin-right: 15px;
    }

    .social-icons-contact {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-top: 30px;
    }

    .social-icons-contact .social-icon-btn {
        padding: 12px 25px;
        font-size: 1em;
    }

    .contact-form label {
        font-size: 1em;
        margin-bottom: 5px;
    }

    .contact-form input,
    .contact-form textarea {
        padding: 12px 15px;
        font-size: 0.95em;
    }

    .contact-form button[type="submit"] {
        max-width: 100%;
        padding: 14px 25px;
        font-size: 1em;
        margin-top: 25px;
    }
}

/* --- Footer --- */
.footer {
    background-color: rgb(76, 42, 224);
    color: var(--blanco-logo);
    padding: 40px 15px 20px 15px;
    text-align: center;
    border-top: 5px solid var(--violeta-logo);
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-logo h3 {
    color: var(--blanco-logo);
    font-size: 1.8em;
    margin-bottom: 10px;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8em;
    margin: 0;
}

/* --- ESTILOS MEJORADOS PARA MÓVILES (hasta 768px) --- */
@media (max-width: 768px) {
    /* --- Navegación Móvil Rediseñada --- */
    .abrir-menu {
        display: block;
        font-size: 2rem;
        color: #ffffff;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 90%;
        max-width: 320px;
        height: 100%;
        background-color: #3c5dd6;
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
        transition: right 0.4s ease-in-out;
        z-index: 1050;
        display: flex;
        box-sizing: border-box;
    }

    .main-nav.visible {
        right: 0;
    }

    .cerrar-menu {
        display: block;
        margin-bottom: 2rem;
        color: var(--azul-logo);
        font-size: 2.2rem;
        align-self: flex-end;
        line-height: 1;
    }

    .main-nav .li-menu {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.5rem;
    }

    .main-nav .li-menu li {
        width: 100%;
        text-align: left;
        margin-bottom: 0;
    }

    .main-nav .li-menu li a {
        color: white;
        font-size: 1.5rem;
        font-weight: 500;
        display: block;
        padding: 0.8rem 1rem;
        width: 100%;
        border-radius: 8px;
        transition: background-color 0.2s ease, color 0.2s ease;
        font-family: 'Poppins', sans-serif; /* Changed to Poppins for consistency */
    }

    .main-nav .li-menu li a:hover, .main-nav .li-menu li a:focus {
        background-color: var(--gris-claro);
        color: var(--violeta-logo);
    }
}

/* --- ESTILOS PARA MÓVILES MUY PEQUEÑOS (hasta 480px) --- */
@media (max-width: 480px) {
    /* --- Redes Sociales en Contacto --- */
    .social-icons-contact {
        flex-direction: column;
        align-items: stretch;
    }
}