/*
Theme Name: Avante
Theme URI: https://github.com/chanovera-dev/avante
Author: Chano Vera
Author URI: https://chano.dev
Description: 
Requires at least: 6.7
Tested up to: 6.9.1
Requires PHP: 8.0
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: avante
Tags:
*/

#main-header {
    z-index: 99;
    height: 63.44px;

    & .block {
        border-bottom: 1px solid var(--wp--preset--color--line);
        background-color: var(--wp--preset--color--tertiary);

        & .content {
            gap: .25rem;

            & .site-brand {
                & .custom-logo {
                    width: auto;
                    height: var(--header-height);
                }
            }

            & .search-mobile__button {
                position: relative;
                border: 1px solid transparent;
                background-color: transparent;
                display: grid;
                place-content: center;
                height: 37px;
                width: 37px;
                transition: border-color .3s ease, background-color .3s ease;

                &:hover {
                    border-color: var(--wp--preset--color--line);
                    cursor: pointer;
                }

                &::before {
                    position: absolute;
                    content: '';
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    background-color: var(--wp--preset--color--secondary);
                    box-shadow: inset 0 0 4px var(--wp--preset--color--contrast-alpha-50);
                    opacity: 0;
                    transition: opacity .3s ease;
                }

                & .icon--wrapper {
                    position: relative;
                    display: grid;
                    width: 16px;
                    height: 16px;

                    &::before {
                        position: absolute;
                        content: '';
                        top: 0;
                        left: 0;
                        width: 50px;
                        max-width: 13px;
                        aspect-ratio: 1 / 1;
                        border: 1px solid var(--wp--preset--color--contrast);
                        border-radius: 50%;
                        z-index: 1;
                        transition: max-width .3s ease;
                    }

                    &::after {
                        position: absolute;
                        content: '';
                        top: 82%;
                        left: 83%;
                        transform: translate(-50%, -50%) rotate(-45deg);
                        width: 2px;
                        height: 50px;
                        max-height: 7.5px;
                        border-radius: 2px;
                        background-color: var(--wp--preset--color--contrast);
                        transition: max-height .3s ease, top .3s ease, left .3s ease, border-radius .3s ease;
                    }

                    & .bar {
                        position: absolute;
                        content: '';
                        top: 50%;
                        left: 50%;
                        transform: translate(-50%, -50%) rotate(45deg);
                        width: 1px;
                        height: 50px;
                        max-height: 0;
                        border-radius: 1px;
                        background-color: var(--wp--preset--color--contrast);
                        transition: max-height .3s ease;
                    }
                }

                &.active {
                    &:hover {
                        border-color: transparent;
                        background-color: var(--wp--preset--color--primary);
                    }

                    &:before {
                        opacity: .4;
                    }

                    & .icon--wrapper {
                        &::before {
                            max-width: 16px;
                        }

                        &::after {
                            top: 50%;
                            left: 50%;
                            width: 1px;
                            max-height: 10px;
                            border-radius: 1px;
                            background-color: var(--wp--preset--color--contrast);
                        }

                        & .bar {
                            max-height: 10px;
                        }
                    }
                }

                &:focus-visible {
                    background-color: var(--wp--preset--color--focus);

                    & .icon--wrapper {
                        &::before {
                            border-color: var(--wp--preset--color--base);
                        }

                        & .bar,
                        &::after {
                            background-color: var(--wp--preset--color--base);
                        }
                    }

                    &:hover {
                        background-color: var(--wp--preset--color--focus);
                    }
                }
            }
        }
    }
}

#main-footer {
    background-color: var(--wp--preset--color--footer-background);
    color: var(--wp--preset--color--base);

    & ul {
        padding-left: 0;
        list-style: none;

        & li {
            & a {
                transition: color .3s ease;

                &::before {
                    transition: background-color .3s ease;
                }

                &:hover {
                    color: var(--wp--preset--color--primary);

                    &::before {
                        background-color: var(--wp--preset--color--primary);
                    }
                }

                &:focus-visible {
                    outline: none;
                    color: var(--wp--preset--color--focus);
                }
            }
        }
    }

    & .title-section {
        font-weight: 700;
        margin-bottom: 1rem;
    }

    & .block.middle-footer {
        & .content {
            padding: 4rem 0;
            display: flex;
            align-items: start;
            justify-content: space-between;
            flex-wrap: wrap;

            & .about {
                max-width: 400px;

                &>*:not(:last-child) {
                    margin-bottom: 1rem;
                }

                & .footer-logo {
                    max-height: 5rem;
                    width: auto;
                    display: block;
                }

                & .site-bio {
                    font-size: var(--wp--preset--font-size--small);
                }
            }

            & .other-links {
                display: flex;
                flex-wrap: wrap;
                gap: 3rem;
            }
        }
    }

    & .block.end-footer {
        & .content {
            text-align: center;
            padding: 1rem 0;
            border-top: 1px dashed #ffffff21;
        }
    }
}

@media (width < 600px) {
    #main-header {
        & .block {
            & .content {
                & .avante-custom-searchform {
                    & .section {
                        max-width: 269px !important;
                        margin-right: auto !important;
                        margin-left: .625rem !important;
                    }
                }
            }
        }
    }
}

@media (width < 1199px) {
    #main-header {
        z-index: 99;

        & .block {
            & .content {
                position: relative;
                display: flex;
                align-items: center;
                justify-content: space-between;
                height: 62.44px;

                & .main-navigation {
                    position: absolute;
                    top: 100%;
                    right: 0;
                    z-index: 0;
                    height: 0;
                    overflow: hidden;

                    /*nivel principal*/
                    & .menu {
                        position: relative;
                        border: 2px solid #ffffff80;
                        padding-left: 0;
                        padding: .4rem;

                        & li {
                            &>a {
                                font-size: var(--wp--preset--font-size--small);
                                display: flex;
                                align-items: center;
                                padding: 0 .7rem;
                                height: 30px;
                                transition: background-color .3s ease;

                                &:hover {
                                    background-color: var(--wp--preset--color--primary-alpha-50);
                                }
                            }

                            &.menu-item-has-children {
                                & .wrapper-for-title {
                                    display: flex;
                                    align-items: center;
                                    justify-content: space-between;
                                    gap: .5rem;
                                    height: 30px;
                                    padding-left: .7rem;

                                    &>a {
                                        font-size: var(--wp--preset--font-size--small);

                                        &:hover {
                                            color: #000;
                                        }
                                    }

                                    & .button-for-submenu {
                                        display: grid;
                                        place-content: center;
                                        width: 1rem;
                                        height: 1rem;
                                        background-color: transparent;
                                        border-radius: 50%;
                                        border: none;
                                        cursor: pointer;
                                        transition: background-color .3s ease, transform .6s ease;

                                        &:hover {
                                            background-color: var(--wp--preset--color--primary-alpha-50);
                                        }
                                    }
                                }

                                /*submenú de primer nivel abierto*/
                                &.open {
                                    &.menu-item-has-children {
                                        & .wrapper-for-title {
                                            & .button-for-submenu {
                                                transform: rotate(180deg);
                                            }
                                        }

                                        & .sub-menu {
                                            & li {
                                                &>a {
                                                    visibility: visible;
                                                    height: 30px;
                                                    color: initial;
                                                    transition: 0.3s height cubic-bezier(0.4, 0, 0.2, 1),
                                                        0.3s 0.3s color,
                                                        0.3s background-color;
                                                }

                                                &.menu-item-has-children {
                                                    & .wrapper-for-title {
                                                        visibility: visible;
                                                        height: 30px;
                                                        color: initial;
                                                        transition: 0.3s height cubic-bezier(0.4, 0, 0.2, 1),
                                                            0.3s 0.3s color,
                                                            0.6s visibility;

                                                        & .button-for-submenu {
                                                            color: initial;
                                                            visibility: visible;
                                                            transition: 0.3s 0.3s color,
                                                                0.6s visibility,
                                                                background-color .3s ease, transform .6s ease;
                                                            transform: rotate(0deg);
                                                        }
                                                    }

                                                    & .sub-menu {
                                                        & li {
                                                            &>a {
                                                                visibility: hidden;
                                                                height: 0;
                                                                color: transparent;
                                                            }

                                                            &.menu-item-has-children {
                                                                & .wrapper-for-title {
                                                                    visibility: hidden;
                                                                    height: 0;
                                                                    color: transparent;

                                                                    & .button-for-submenu {
                                                                        visibility: hidden;
                                                                        color: transparent;
                                                                        transform: rotate(0deg);
                                                                        transition: background-color .3s ease, transform .6s ease;
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }

                                                    /*submenu de segundo nivel abierto*/
                                                    &.open {
                                                        &.menu-item-has-children {
                                                            & .wrapper-for-title {
                                                                & .button-for-submenu {
                                                                    transform: rotate(180deg);
                                                                }
                                                            }

                                                            & .sub-menu {
                                                                & li {
                                                                    &>a {
                                                                        visibility: visible;
                                                                        height: 30px;
                                                                        color: initial;
                                                                        transition: 0.3s height cubic-bezier(0.4, 0, 0.2, 1),
                                                                            0.3s 0.3s color,
                                                                            0.3s background-color;
                                                                    }

                                                                    &.menu-item-has-children {
                                                                        & .wrapper-for-title {
                                                                            visibility: visible;
                                                                            height: 30px;
                                                                            color: initial;
                                                                            transition: 0.3s height cubic-bezier(0.4, 0, 0.2, 1),
                                                                                0.3s 0.3s color;

                                                                            & .button-for-submenu {
                                                                                color: initial;
                                                                                visibility: visible;
                                                                                transition: 0.3s 0.3s color,
                                                                                    0.6s visibility;
                                                                                transform: rotate(0deg);
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }

                                /*submenú de primer nivel cerrado*/
                                & .sub-menu {
                                    list-style: none;
                                    padding-left: 1.6rem;

                                    & li {
                                        &>a {
                                            visibility: hidden;
                                            height: 0;
                                            color: transparent;
                                            transition: 0.3s 0.3s height,
                                                0.6s visibility,
                                                0.3s color;
                                        }

                                        &.menu-item-has-children {
                                            & .wrapper-for-title {
                                                visibility: hidden;
                                                height: 0;
                                                color: transparent;
                                                transition: 0.3s 0.3s height,
                                                    0.6s visibility,
                                                    0.3s color;
                                            }

                                            & .sub-menu {
                                                & li {
                                                    &>a {
                                                        visibility: hidden;
                                                        height: 0;
                                                        color: transparent;
                                                        transition: 0.3s 0.3s height,
                                                            0.6s visibility,
                                                            0.3s color;
                                                    }

                                                    &.menu-item-has-children {
                                                        & .wrapper-for-title {
                                                            visibility: hidden;
                                                            height: 0;
                                                            color: transparent;
                                                            transition: 0.3s 0.3s height,
                                                                0.6s visibility,
                                                                0.3s color;

                                                            & .button-for-submenu {
                                                                visibility: hidden;
                                                                color: transparent;
                                                                transition: 0.6s visibility,
                                                                    0.3s color;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }

                    &.open {
                        height: fit-content;
                        border: 1px solid #8b8b8b80;
                        box-shadow: rgba(17, 12, 46, 0.3) 0px 24px 50px 0px;

                        & .glass-backdrop {
                            position: absolute;
                            top: 0;
                            left: 0;
                            width: 100%;
                            height: 100%;
                            z-index: 0;
                        }


                    }
                }

                & .menu-mobile__button {
                    background-color: transparent;
                    position: relative;
                    z-index: 3;
                    grid-column: 1 / 2;
                    width: 37px;
                    height: 37px;
                    display: grid;
                    place-content: center;
                    border: 1px solid transparent;
                    transition: border-color .3s ease;

                    & .bar {
                        position: relative;
                        width: 1rem;
                        height: 1px;
                        background-color: var(--wp--preset--color--contrast);
                        transition: transform .3s ease-in-out;

                        &::before,
                        &::after {
                            position: absolute;
                            content: '';
                            left: 0;
                            width: 1rem;
                            height: 1px;
                            background-color: var(--wp--preset--color--contrast);
                        }

                        &::before {
                            top: -0.35rem;
                            transition: transform .3s ease-in-out, top .3s ease-in-out;
                        }

                        &::after {
                            bottom: -0.35rem;
                            transition: opacity .3s ease-in-out, bottom .3s ease-in-out;
                        }
                    }

                    &:focus-visible {
                        background-color: var(--wp--preset--color--focus);

                        & .bar {
                            background-color: var(--wp--preset--color--base);

                            &::before,
                            &::after {
                                background-color: var(--wp--preset--color--base);
                            }
                        }

                        &:hover {
                            background-color: var(--wp--preset--color--focus);
                        }
                    }

                    &.active {
                        & .bar {
                            transform: rotate(45deg);
                        }

                        & .bar:before {
                            top: 0;
                            transform: rotate(90deg);
                        }

                        & .bar:after {
                            bottom: 0;
                            opacity: 0;
                        }
                    }

                    &:hover {
                        background-color: var(--wp--preset--color--primary-alpha-50);
                    }
                }

                .search-mobile__button {
                    background-color: transparent;
                    margin-left: auto;
                    position: relative;
                    z-index: 5;
                    backdrop-filter: blur(2rem);

                    & .icon--wrapper {
                        position: relative;
                        display: grid;
                        width: 16px;
                        height: 16px;

                        &::before {
                            position: absolute;
                            content: '';
                            top: 0;
                            left: 0;
                            width: 50px;
                            max-width: 13px;
                            aspect-ratio: 1 / 1;
                            border: 1px solid var(--wp--preset--color--contrast);
                            border-radius: 50%;
                            z-index: 1;
                            transition: max-width .3s ease;
                        }

                        &::after {
                            position: absolute;
                            content: '';
                            top: 82%;
                            left: 83%;
                            transform: translate(-50%, -50%) rotate(-45deg);
                            width: 2px;
                            height: 50px;
                            max-height: 7.5px;
                            border-radius: 2px;
                            background-color: var(--wp--preset--color--contrast);
                            transition: max-height .3s ease, top .3s ease, left .3s ease, border-radius .3s ease;
                        }

                        & .bar {
                            position: absolute;
                            content: '';
                            top: 50%;
                            left: 50%;
                            transform: translate(-50%, -50%) rotate(45deg);
                            width: 1px;
                            height: 50px;
                            max-height: 0;
                            border-radius: 1px;
                            background-color: var(--wp--preset--color--contrast);
                            transition: max-height .3s ease;
                        }
                    }

                    &.active {
                        & .icon--wrapper {
                            &::before {
                                max-width: 16px;
                            }

                            &::after {
                                top: 50%;
                                left: 50%;
                                width: 1px;
                                max-height: 10px;
                                border-radius: 1px;
                                background-color: var(--wp--preset--color--contrast);
                            }

                            & .bar {
                                max-height: 10px;
                            }
                        }
                    }

                    &:focus-visible {
                        background-color: var(--wp--preset--color--focus);

                        & .icon--wrapper {
                            &::before {
                                border-color: var(--wp--preset--color--base);
                            }

                            & .bar,
                            &::after {
                                background-color: var(--wp--preset--color--base);
                            }
                        }

                        &:hover {
                            background-color: var(--wp--preset--color--focus);
                        }
                    }

                    &:hover {
                        background-color: var(--wp--preset--color--primary-alpha-50);
                    }
                }

                & .avante-custom-searchform {
                    position: absolute;
                    top: 0;
                    left: 0;
                    transform: translate(-.625rem, -130%);
                    width: calc(100% + 1.25rem);
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    z-index: 2;
                    background-color: var(--wp--preset--color--base-alpha-50);
                    backdrop-filter: blur(7px);
                    transition: transform .5s ease-in-out;

                    &.show {
                        transform: translate(-.625rem, 0);
                    }

                    & .section {
                        display: flex;
                        width: 100%;
                        max-width: 500px;

                        & .buttons-container {
                            display: flex;
                            position: relative;

                            & #searchsubmit {
                                position: absolute;
                                top: 3px;
                                left: 0;
                                transform: translateX(calc(-100% - 3px));
                                height: 1.9rem;
                                width: 1.9rem;
                                padding: 0;
                                display: grid;
                                place-content: center;
                                background-color: transparent;
                                border: none;
                                color: inherit;
                                transition: background-color .3s ease;

                                &:hover {
                                    background-color: var(--wp--preset--color--tertiary);
                                }

                                &:focus-visible {
                                    outline: none;
                                    background-color: var(--wp--preset--color--focus);
                                    color: var(--wp--preset--color--base);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

@media (width >=1200px) {
    #main-header {
        & .block {
            & .content {
                display: grid;
                grid-template-columns: 1fr auto 1fr;
                align-items: center;

                & .avante-navigation {
                    max-height: 62.44px;
                    display: flex;
                    align-items: center;

                    & .main-navigation {
                        width: fit-content;
                        max-width: 100%;
                        opacity: 1;
                        visibility: visible;
                        transform: scale(1);
                        transition: opacity .3s ease, transform .3s ease;

                        &.hide {
                            max-width: 0;
                            opacity: 0;
                            visibility: hidden;
                            transform: scale(.8);
                        }

                        &>ul {
                            padding-left: 0;
                            list-style: none;
                            display: flex;
                            align-items: center;

                            & li {
                                position: relative;

                                &.current-menu-item {
                                    &::before {
                                        content: '';
                                        position: absolute;
                                        bottom: 0;
                                        left: 50%;
                                        transform: translateX(-50%);
                                        width: 1rem;
                                        height: 3px;
                                        background-color: var(--wp--preset--color--primary);
                                    }
                                }

                                &:has(.wrapper-for-title) {
                                    & .wrapper-for-title {
                                        display: flex;
                                        align-items: center;
                                        gap: .5rem;
                                        padding: 1rem;
                                        padding-right: .5rem;
                                        transition: background-color .3s ease;

                                        &:hover {
                                            background-color: var(--wp--preset--color--base);

                                            & .button-for-submenu {
                                                transform: rotate(180deg);
                                            }
                                        }

                                        & .button-for-submenu {
                                            width: 1rem;
                                            height: 1rem;
                                            background-color: transparent;
                                            display: grid;
                                            place-content: center;
                                            border: none;
                                            transition: transform .3s ease-in-out;
                                        }


                                    }
                                }

                                &>a {
                                    padding: 1rem;
                                    display: flex;
                                    align-items: center;
                                    transition: background-color .3s ease;

                                    &:hover {
                                        background-color: var(--wp--preset--color--base);
                                    }
                                }


                                /* MENÚ ABIERTO - EFECTO SUAVE */
                                &.menu-item-has-children .sub-menu {
                                    padding: .625rem;
                                    list-style: none;
                                    position: absolute;
                                    top: 63px;
                                    width: max-content;
                                    background-color: var(--wp--preset--color--base);
                                    box-shadow: var(--post-shadow);
                                    z-index: 100;
                                    transition: 0.4s padding, 0.4s background-color, 0.4s box-shadow;

                                    /* ANIMACIÓN DE LOS ÍTEMS DEL SUBMENÚ */
                                    & li {
                                        height: 30px;
                                        padding: 0;
                                        background: transparent;
                                        white-space: nowrap;
                                        transition: 0.4s height cubic-bezier(0.4, 0, 0.2, 1),
                                            0.4s padding cubic-bezier(0.4, 0, 0.2, 1),
                                            0.4s margin cubic-bezier(0.4, 0, 0.2, 1),
                                            0.1s 0.1s color,
                                            0.2s background-color;

                                        &:hover {

                                            /* HOVER DE ÍTEMS */
                                            &>a {
                                                background-color: var(--wp--preset--color--tertiary);
                                            }
                                        }

                                        & :is(a, .button-for-submenu) {
                                            padding: 0 1rem;
                                            height: 30px;
                                            font-size: 14px;
                                            font-weight: 500;
                                            width: 100%;
                                            gap: 1.25rem;
                                            justify-content: space-between;
                                            transition: 0.3s 0.1s color, 0.3s background-color ease;
                                        }

                                        & a {
                                            transition: background-color .3s ease, color .3s ease;
                                        }
                                    }
                                }

                                /* MENÚ CERRADO */
                                &.menu-item-has-children:not(:hover)>.sub-menu {
                                    padding: 0 .625rem;
                                    box-shadow: 0 1px 15px rgba(0, 0, 0, 0);
                                    overflow-y: hidden;
                                    z-index: 99;

                                    /* ESTADO CERRADO DE ÍTEMS INTERIORES */
                                    &>* {
                                        visibility: hidden;
                                        height: 0;
                                        padding-top: 0;
                                        padding-bottom: 0;
                                        margin: 0;
                                        color: transparent;
                                        transition: 0.4s 0.1s height,
                                            0.4s 0.1s padding,
                                            0.4s 0.1s margin,
                                            0.1s color,
                                            0.6s visibility;
                                    }

                                    & li {
                                        & a {
                                            color: transparent;
                                            transition: color .2s ease;
                                        }
                                    }
                                }

                                /* EFECTO VISUAL EN PADRE ACTIVO (solo en navegadores modernos) */
                                &.menu-item-has-children:hover> :is(a, .button-for-submenu),
                                &.menu-item-has-children:has(.sub-menu:hover)>.wrapper-for-title {
                                    background-color: var(--wp--preset--color--base);

                                    & .button-for-submenu {
                                        transform: rotate(180deg);
                                    }
                                }
                            }
                        }
                    }

                    & .avante-custom-searchform {
                        width: 400px;
                        max-width: 0;
                        opacity: 0;
                        visibility: hidden;
                        transform: scale(.8);
                        transition: opacity .3s ease, transform .3s ease;

                        &.show {
                            max-width: 400px;
                            opacity: 1;
                            visibility: visible;
                            transform: scale(1);
                        }

                        & .section {
                            position: relative;
                            display: flex;
                            align-items: center;

                            & .wp-block-search__input {
                                padding-right: 2.3rem;
                            }

                            & .buttons-container {
                                position: absolute;
                                right: .2rem;

                                & #searchsubmit {
                                    display: grid;
                                    width: 2rem;
                                    height: 2rem;
                                    place-content: center;
                                    background-color: transparent;
                                    border: 1px solid transparent;
                                    transition: border-color .3s ease, background-color .3s ease;

                                    &:hover {
                                        background-color: var(--wp--preset--color--secondary);
                                        border-color: var(--wp--preset--color--secondary);
                                    }
                                }

                                & .close-mobile-searchform {
                                    display: none;
                                }
                            }
                        }
                    }
                }

                & .search-mobile__button {
                    margin-left: auto;
                }

                & .menu-mobile__button {
                    display: none;
                }
            }
        }
    }
}