/* Header MVP structural scaffold. */

.vegustando-skip-link {
    position: absolute;
    top: -9999px;
    left: 1rem;
    z-index: 1000;
    padding: 0.75rem 1rem;
    background: #ffffff;
    color: #111111;
    text-decoration: none;
    border: 1px solid #111111;
}

.vegustando-skip-link:focus {
    top: 1rem;
}

.vegustando-site-header .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.vegustando-site-header .screen-reader-text:focus,
.vegustando-site-header .screen-reader-text:active {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.vegustando-site-header {
    position: relative;
    z-index: 400;
    border-bottom: 1px solid rgba(17, 17, 17, 0.12);
    background: #f6f3ea;
}

.vegustando-header-main {
    position: sticky;
    top: 0;
    z-index: 410;
    width: 100%;
    background: #f6f3ea;
}

body.admin-bar .vegustando-header-main {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .vegustando-header-main {
        top: 46px;
    }
}

.vegustando-header-main__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.vegustando-header-branding {
    flex: 0 0 auto;
}

.vegustando-header-branding__logo {
    line-height: 0;
}

.vegustando-header-branding__staging-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.vegustando-header-branding__staging-image {
    display: block;
    width: auto;
    height: clamp(54px, 7vw, 86px);
    max-width: min(460px, 76vw);
    object-fit: contain;
}

.vegustando-header-branding__name {
    color: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.vegustando-header-branding__logo img {
    display: none;
}

.vegustando-header-navigation {
    flex: 1 1 auto;
    min-width: 0;
}

.vegustando-header-navigation__menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.vegustando-header-navigation__menu a {
    color: inherit;
    text-decoration: none;
}

@media (min-width: 1024px) {
    .vegustando-header-main__inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        grid-template-rows: 54px;
        align-items: center;
        min-height: 54px;
        padding-top: 0;
        padding-bottom: 0;
        gap: 1rem;
    }

    .vegustando-header-navigation,
    .vegustando-header-branding,
    .vegustando-header-actions {
        display: flex;
        align-items: center;
        height: 54px;
    }

    .vegustando-header-navigation {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        min-width: 0;
        position: relative;
    }

    .vegustando-header-navigation__menu {
        justify-content: flex-start;
        gap: 1.25rem;
    }

    .vegustando-header-navigation__menu > .menu-item {
        position: relative;
        order: 10;
    }

    .vegustando-header-navigation__menu > .vegustando-alimentacion-link {
        order: 1;
    }

    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root {
        order: 2;
        position: static;
    }

    .vegustando-header-branding {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        justify-content: center;
        height: 54px;
        text-align: center;
    }

    .vegustando-header-branding__staging-link,
    .vegustando-header-branding__logo,
    .vegustando-header-branding__name {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        line-height: 1;
    }

    .vegustando-header-branding__staging-link {
        height: 100%;
        max-height: 100%;
    }

    .vegustando-header-branding__staging-image {
        width: auto;
        height: 88%;
        max-height: 100%;
        max-width: min(460px, 32vw);
        object-fit: contain;
    }

    .vegustando-header-branding__logo img {
        display: none;
    }

    .vegustando-header-actions {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        margin-left: 0;
        width: auto;
        max-width: min(18rem, 32vw);
    }

    .vegustando-header-menu-toggle {
        display: none !important;
    }

    .vegustando-header-main--search-open .vegustando-header-actions {
        margin-left: 0;
    }

    .vegustando-header-navigation__menu > .menu-item-has-children > .sub-menu {
        position: absolute;
        top: 100%;
        right: 0;
        z-index: 420;
        min-width: 16rem;
        margin: 0;
        padding: 0.45rem 0;
        list-style: none;
        border: 1px solid #d9d2c3;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 10px 24px rgba(63, 74, 60, 0.12);
        display: none;
    }

    .vegustando-header-navigation__menu > .menu-item-has-children:hover > .sub-menu,
    .vegustando-header-navigation__menu > .menu-item-has-children:focus-within > .sub-menu {
        display: block;
    }

    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root > .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: auto;
        z-index: 420;
        width: min(92vw, 980px);
        max-width: calc(100vw - 2rem);
        min-width: min(68rem, 92vw);
        margin: 0;
        padding: 1rem 1.1rem;
        list-style: none;
        border: 1px solid #d9d2c3;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 10px 24px rgba(63, 74, 60, 0.12);
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.9rem 1.1rem;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.12s ease;
    }

    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root:focus-within > .sub-menu,
    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root.is-open > .sub-menu {
        display: grid;
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root > .sub-menu > .menu-item {
        position: static;
    }

    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root > .sub-menu > .menu-item > a {
        display: block;
        margin-bottom: 0.35rem;
        padding: 0;
        font-size: 0.95rem;
        font-weight: 700;
        line-height: 1.25;
        color: #2f3a2c;
        white-space: normal;
    }

    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root > .sub-menu > .menu-item > .sub-menu {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root > .sub-menu > .menu-item > .sub-menu > .menu-item > a {
        display: block;
        padding: 0.22rem 0;
        line-height: 1.3;
        color: #4b5b46;
    }

    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root > .sub-menu > .menu-item > .sub-menu > .menu-item > a:hover,
    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root > .sub-menu > .menu-item > .sub-menu > .menu-item > a:focus-visible,
    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root > .sub-menu > .menu-item > a:hover,
    .vegustando-header-navigation__menu > .vegustando-recetas-dynamic-root > .sub-menu > .menu-item > a:focus-visible {
        color: #4a7c2a;
    }
}

/* Search toggle */

.vegustando-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 2.25rem;
}

.vegustando-header-main--search-open .vegustando-header-actions {
    margin-left: 0.5rem;
    width: min(18rem, 100%);
}

.vegustando-header-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    border-radius: 4px;
}

.vegustando-header-search-toggle__icon--close {
    display: none;
}

.vegustando-header-main--search-open .vegustando-header-search-toggle__icon--search {
    display: none;
}

.vegustando-header-main--search-open .vegustando-header-search-toggle__icon--close {
    display: inline-flex;
}

.vegustando-header-search-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Search panel */

.vegustando-header-search-panel {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.vegustando-header-search-panel[hidden] {
    display: none;
}

.vegustando-header-search-panel__inner {
    width: 100%;
}

.vegustando-header-search-panel .search-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.vegustando-header-search-panel .search-field {
    width: 100%;
    min-width: 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(17, 17, 17, 0.16);
    border-radius: 10px;
    background: #ffffff;
}

.vegustando-header-search-panel .search-field:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.vegustando-header-search-panel .search-submit {
    flex: 0 0 auto;
    padding: 0.7rem 0.95rem;
    border: 1px solid rgba(17, 17, 17, 0.16);
    border-radius: 10px;
    background: #111111;
    color: #ffffff;
    cursor: pointer;
}

/* Menu toggle button */

.vegustando-header-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    border-radius: 4px;
}

.vegustando-header-menu-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Responsive: tablet and mobile */

@media (max-width: 1023px) {
    .vegustando-header-main__inner {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 0.75rem;
    }

    .vegustando-header-menu-toggle {
        grid-column: 1;
        justify-self: start;
    }

    .vegustando-header-branding {
        grid-column: 2;
        justify-self: center;
        text-align: center;
    }

    .vegustando-header-actions {
        grid-column: 3;
        justify-self: end;
        width: auto;
        max-width: min(11.5rem, 42vw);
    }

    .vegustando-header-main--search-open .vegustando-header-actions {
        width: min(11.5rem, 42vw);
        margin-left: 0;
    }

    .vegustando-header-menu-toggle {
        display: flex;
    }

    .vegustando-header-navigation {
        display: none;
    }

    .vegustando-header-search-panel .search-form {
        gap: 0.5rem;
    }

    .vegustando-header-search-panel .search-field {
        padding: 0.55rem 0.7rem;
        font-size: 0.95rem;
    }

    .vegustando-header-search-panel .search-submit {
        display: none;
    }
}

@media (min-width: 1024px) {
    .vegustando-header-search-panel {
        max-width: 14rem;
    }
}

/* Mobile drawer */

.vegustando-header-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    background: #ffffff;
    overflow-y: auto;
    padding: 5rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(17, 17, 17, 0.12);
}

.vegustando-header-drawer[hidden] {
    display: none;
}

body.vegustando-drawer-open {
    overflow: hidden;
}

.vegustando-header-drawer__inner {
    max-width: 480px;
}

.vegustando-header-drawer__menu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.vegustando-header-drawer__menu li {
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.vegustando-header-drawer__menu .menu-item-has-children {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.vegustando-header-drawer__menu .menu-item-has-children > a {
    flex: 1 1 auto;
}

.vegustando-header-drawer__menu a {
    display: block;
    padding: 0.625rem 0;
    color: inherit;
    text-decoration: none;
}

.vegustando-header-drawer__nav--secondary {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(17, 17, 17, 0.12);
}

/* Drawer submenu toggles */

.vegustando-drawer-submenu-toggle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    border-radius: 4px;
}

.vegustando-drawer-submenu-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.vegustando-header-drawer__menu ul {
    flex: 0 0 100%;
    margin: 0;
    padding: 0 0 0 1rem;
    list-style: none;
}

.vegustando-header-drawer__menu ul[hidden] {
    display: none;
}
