* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --purpura: #40008c;
    --violeta: #6300cf;
    --magenta: #ef1b4e;
    --naranja: #ff7a37;
    --verde: #c4f582;
    --negro: #000;
    --blanco: #fff;
    --titulos: "urbana", sans-serif;
    --parrafos: "futura-100", sans-serif;
}

body {
    background-image: url(../img/ilustraciones/resources_fondo_purpura.svg);
    background-size: 120%;
    background-repeat: repeat-y;
    background-position: center;
}

.barranav {
    background-color: var(--violeta);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    transition: background-color 0.3s ease;

    & img {
        width: 110px;
        height: auto;
        margin: 0;
    }

    & a {
        margin: 0;
    }

    & button {
        background: var(--purpura);
        color: var(--blanco);
        font-family: var(--titulos);
        font-weight: 700;
        font-size: 32px;
        padding: 3px 25px;
        border-radius: 25px;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        transition: background-color 0.3s ease, transform 0.2s ease;

        &:hover {
            transform: scale(1.03);
        }

        &.open {
            background-color: var(--magenta);
        }

        & img {
            width: 20px;
            margin-left: 8px;
            padding-top: 2px;
        }
    }
}

/* ==========================================
   ESTILOS MENÚ LATERAL DESPLEGABLE (DRAWER)
   ========================================== */

header {
    position: fixed;
    top: 0;
    z-index: 1002;
    width: 100%;
}

header.menu-open .barranav {
    background-color: var(--purpura);
}

/* Telón / Fondo oscuro semi-transparente */
.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.menu-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* Menú lateral - Se abre de izquierda a derecha (translateX(-100%) a translateX(0)) */
.menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 390px;
    height: 100vh;
    height: 100dvh;
    background-color: var(--purpura);
    z-index: 1001;
    padding: 85px 25px 40px 25px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
}

.menu-drawer.open {
    transform: translateX(0);
}

/* Lista del menú */
.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.menu-item {
    font-family: var(--titulos);
    font-size: 32px;
    font-weight: 700;
    color: var(--blanco);
    text-transform: uppercase;
    padding: 14px 0;
}

.menu-item a {
    color: var(--blanco);
    text-decoration: none;
    display: block;
    transition: color 0.2s ease, transform 0.2s ease;
}

.menu-item a:hover {
    color: var(--verde);
    transform: translateX(4px);
}

/* Líneas divisorias del menú */
.menu-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.3);
    width: 100%;
    margin: 4px 0;
}

/* Wrapper de Áreas Creativas con Botón desplegable */
.menu-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.btn-dropdown {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--magenta);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}

.btn-dropdown img {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.menu-title-wrapper.active .btn-dropdown img {
    transform: rotate(180deg);
}

/* Submenú de Áreas Creativas */
.submenu-container {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    opacity: 1;
}

.submenu-container.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.submenu-list {
    list-style: none;
    padding: 10px 0 10px 10px;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.submenu-list li a {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--blanco);
    font-family: var(--titulos);
    font-size: 24px;
    font-weight: 700;
    padding: 12px 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.submenu-list li a:hover {
    transform: translateX(6px);
    color: var(--verde);
}

/* Badges / Círculos de color */
.badge-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.badge-purple {
    background-color: var(--violeta);
}

.badge-orange {
    background-color: var(--naranja);
}

.badge-magenta {
    background-color: var(--magenta);
}

.badge-green {
    background-color: var(--verde);
}

.badge-beige {
    background-color: #f8f6e8;
}

/* Opción 'Ver todo' */
.ver-todo-li {
    text-align: center;
    padding: 10px 0;
}

.ver-todo-link {
    font-family: var(--titulos) !important;
    font-size: 24px;
    font-weight: 700 !important;
    color: var(--blanco) !important;
    text-align: center;
    justify-content: center !important;
    text-decoration: none;
    display: block !important;
    width: 100%;
}

.ver-todo-link:hover {
    color: var(--verde) !important;
}

/* ==========================================
   ESTILOS CABECERA DE IMÁGENES (BANNER GALERÍA AUTOMÁTICA)
   ========================================== */

.cabeceraimg {
    width: 100%;
    margin-top: 60px;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.cabeceraimg-track {
    display: flex;
    width: 600%;
    height: 100%;
    animation: autoCarrusel 15s infinite ease-in-out;
}

.cabeceraimg-slide {
    width: 16.666667%;
    height: 100%;
    flex-shrink: 0;
}

.cabeceraimg-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

@keyframes autoCarrusel {

    0%,
    16% {
        transform: translateX(0%);
    }

    20%,
    36% {
        transform: translateX(calc(-100% / 6));
    }

    40%,
    56% {
        transform: translateX(calc(-100% / 6 * 2));
    }

    60%,
    76% {
        transform: translateX(calc(-100% / 6 * 3));
    }

    80%,
    96% {
        transform: translateX(calc(-100% / 6 * 4));
    }

    100% {
        transform: translateX(calc(-100% / 6 * 5));
    }
}

/* ==========================================
   ESTILOS SECCIÓN CATEGORÍAS (MOBILE)
   ========================================== */

.categorias-main {
    padding: 20px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.categorias-header {
    text-align: center;
    width: 100%;
}

.categorias-titulo {
    font-family: var(--titulos);
    font-size: 32px;
    font-weight: 700;
    color: var(--purpura);
    margin-top: 30px;
    margin-bottom: 10px;

}

.categorias-subtitulo {
    font-family: var(--parrafos);
    font-size: 16px;
    color: var(--negro);
    max-width: 250px;
    margin: 0 auto;
}

.categorias-grid {
    width: 80%;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.categoria-card {
    display: block;
    text-decoration: none;
    background-color: var(--blanco);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}

.categoria-card:hover,
.categoria-card:active {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

.categoria-card-img {
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
}

.categoria-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
    transition: transform 0.3s ease;
}

.categoria-card-footer {
    background-color: var(--blanco);
    padding: 24px 15px;
    display: flex;
    justify-content: left;
    align-items: center;
    text-align: left;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
}

.categoria-title-highlight {
    font-family: var(--titulos);
    font-size: 24px;
    font-weight: 700;
    color: var(--negro);
    text-transform: uppercase;
    display: inline-block;
    line-height: 1.25;
    text-align: left;
}

/*Footer*/
.principal_footer {
    position: relative;
    margin-bottom: 0;
    height: auto;
    width: 100%;

    & img {
        position: relative;
        bottom: -10px;
    }
}

footer {
    background-color: var(--violeta);
    color: var(--blanco);
    padding: 15px 30px 30px 30px;

    & h2 {
        font-size: 50px;
        font-family: var(--titulos);
        font-weight: 700;
        line-height: 45px;
        max-width: 300px;
        padding-bottom: 15px;
    }

    & p {
        font-size: 16px;
        font-family: var(--parrafos);
        max-width: 250px;
    }

    & a {
        text-decoration: none;
        color: var(--blanco);
        font-size: 16px;
        font-family: var(--parrafos);
        display: inline-block;
        margin: 15px 0;
    }
}

.redes_sociales {
    display: flex;
    justify-content: space-between;
    align-self: center;
    border-top: 1px solid #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: 15px;

    & a {
        margin-bottom: 15px;
    }
}

/* ==========================================
   ANIMACIONES DE CARGA INTERACTIVA EN SCROLL
   ========================================== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.scroll-reveal.is-visible,
.scroll-reveal-left.is-visible,
.scroll-reveal-right.is-visible,
.scroll-reveal-scale.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Stagger delay para elementos hijos en grillas o listas */
.stagger-children>* {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.is-visible>*:nth-child(1) {
    transition-delay: 0.08s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.is-visible>*:nth-child(2) {
    transition-delay: 0.16s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.is-visible>*:nth-child(3) {
    transition-delay: 0.24s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.is-visible>*:nth-child(4) {
    transition-delay: 0.32s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.is-visible>*:nth-child(5) {
    transition-delay: 0.40s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.is-visible>*:nth-child(6) {
    transition-delay: 0.48s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.is-visible>*:nth-child(n+7) {
    transition-delay: 0.55s;
    opacity: 1;
    transform: translateY(0);
}


/*  --- Responsive mobile---*/

@media (min-width: 390px) {}

/*  --- Responsive tablet---*/

@media (min-width: 768px) {
    .cabeceraimg {
        height: 280px;
    }

    .categorias-header {
        padding: 25px;
    }

    .categorias-titulo {
        font-size: 36px;
    }

    .categorias-subtitulo {
        font-size: 18px;
        max-width: 700px;
    }

    .categorias-main {
        max-width: 80%;
        flex-wrap: wrap;
    }

    .categorias-grid {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 28px;
    }

    .categoria-card {
        width: calc(50% - 14px);
    }

    .menu-drawer {
        max-width: 500px;
    }

    .menu-item {
        font-size: 36px;
    }

    .submenu-list li a {
        font-size: 25px;
    }

    footer {
        padding: 15px 50px 30px 50px;

        & .informacion_footer {
            display: flex;
            justify-content: space-between;

            & h2 {
                font-size: 65px;
                max-width: 290px;
                line-height: 60px;
            }

            & p {
                font-size: 18px;
                max-width: 240px;
            }

            & a {
                font-size: 18px;
                margin-bottom: 5px;
            }
        }

    }

    .redes_sociales {
        border-bottom: none;
        margin-top: 15px;
    }

    .final_footer {
        border-top: 1px solid #fff;
        display: flex;
        justify-content: space-between;

        & .elemento1 {
            order: 2;
        }

        & .elemento2 {
            order: 1;
        }

        & p {
            font-size: 16px;
            margin-top: 15px;
        }
    }
}

/*  --- Responsive desktop---*/

@media (min-width: 1200px) {
    .barranav {
        padding: 15px 40px;

        & img {
            width: 130px;
        }

        & button {
            font-size: 44px;
            border-radius: 30px;
            padding: 3px 30px;
        }
    }

    .menu-drawer {
        max-width: 800px;
    }

    .menu-item {
        font-size: 45px;
    }

    .submenu-list li a {
        font-size: 36px;
    }

    a .ver-todo-link {
        font-size: 45px;
    }

    footer {
        padding: 15px 70px 30px 65px;

        & .informacion_footer {
            display: flex;
            justify-content: space-between;

            & h2 {
                font-size: 115px;
                max-width: 510px;
                line-height: 90px;
            }

            & p {
                font-size: 20px;
                max-width: 300px;
                margin-top: 20px;
            }

            & a {
                font-size: 20px;
                padding: 10px 0;

            }
        }

    }

    .redes_sociales {
        border-bottom: none;

    }

    .final_footer {
        border-top: 1px solid #fff;
        display: flex;
        justify-content: space-between;

        & .elemento1 {
            order: 2;
            max-width: 280px;
        }

        & .elemento2 {
            order: 1;
        }

        & p {
            font-size: 20px;
            margin-top: 15px;
        }
    }

    .cabeceraimg {
        height: 320px;
    }

    .categorias-header {
        padding: 20px;
    }

    .categorias-titulo {
        font-size: 48px;
    }

    .categorias-subtitulo {
        font-size: 20px;
        max-width: 700px;
    }

    .categorias-main {
        max-width: 1160px;
    }

    .categorias-grid {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 28px;
    }

    .categoria-card {
        width: calc(33.33% - 19px);
        box-sizing: border-box;
    }

    .categoria-title-highlight {
        font-family: var(--titulos);
        font-size: 32px;
    }
}