/**
 * Barra comercial persistente: búsqueda y acceso inequívoco al carrito.
 */

.lmr-store-tools-wrap {
    position: sticky;
    z-index: 900;
    top: 0;
    border-bottom: 1px solid var(--lmr-accessible-border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 3px 14px rgba(26, 60, 42, 0.06);
}

.lmr-store-tools {
    display: grid;
    grid-template-columns: minmax(18rem, 38rem) auto;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100% - 40px, 1240px);
    min-height: 72px;
    margin-inline: auto;
    padding-block: 0.6rem;
}

.lmr-store-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    margin: 0;
}

.lmr-store-search input[type="search"] {
    width: 100%;
    min-width: 0;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    margin: 0;
    border: 2px solid #65766c;
    border-radius: 8px;
    background: #fff;
    color: var(--lmr-color-text, #2c2c2c);
    font-size: 1rem;
}

.lmr-store-search button {
    min-width: 92px;
    min-height: 50px;
    margin: 0;
    padding-inline: 1rem;
    border: 2px solid #173e2d;
    border-radius: 8px;
    background: #173e2d;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
}

.lmr-header-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 50px;
    padding: 0.65rem 0.85rem;
    border: 2px solid #173e2d;
    border-radius: 8px;
    background: #fff;
    color: #173e2d !important;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none !important;
}

.lmr-header-cart:hover,
.lmr-header-cart:focus-visible {
    background: #e8efe4;
    color: #173e2d !important;
}

.lmr-header-cart__icon {
    flex: 0 0 24px;
}

.lmr-header-cart__count {
    display: inline-grid;
    min-width: 26px;
    min-height: 26px;
    padding-inline: 0.3rem;
    place-items: center;
    border-radius: 999px;
    background: #173e2d;
    color: #fff;
    font-size: 0.875rem;
}

.lmr-header-cart__subtotal {
    padding-left: 0.6rem;
    border-left: 1px solid #b9c5bd;
    white-space: nowrap;
}

@media (max-width: 782px) {
    .lmr-store-tools {
        width: min(100% - 24px, 1240px);
        min-height: 66px;
        gap: 0.6rem;
    }

    .lmr-store-search {
        gap: 0.35rem;
    }

    .lmr-store-search input[type="search"] {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        padding-inline: 0.75rem;
    }

    .lmr-store-search button,
    .lmr-header-cart {
        min-height: 48px;
    }

    .lmr-store-search button {
        min-width: 78px;
        padding-inline: 0.7rem;
    }

    .lmr-header-cart__subtotal {
        display: none;
    }
}

@media (max-width: 520px) {
    .lmr-store-tools {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .lmr-header-cart {
        width: 50px;
        min-width: 50px;
        padding: 0;
    }

    .lmr-header-cart__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .lmr-header-cart__count {
        position: absolute;
        margin: -30px 0 0 30px;
        min-width: 22px;
        min-height: 22px;
        font-size: 0.75rem;
    }
}

@media (max-width: 390px) {
    .lmr-store-search button {
        min-width: 70px;
        font-size: 0.9375rem;
    }
}

/* Astra mantiene el menú visible cuando la cabecera del tema padre usa un color claro. */
#ast-desktop-header .main-header-menu .menu-link,
#ast-desktop-header .ast-builder-menu-1 .menu-item > .menu-link,
#ast-desktop-header .ast-builder-menu-1 .menu-item > .ast-menu-toggle {
    color: #173e2d !important;
}

#ast-desktop-header .main-header-menu .menu-link:hover,
#ast-desktop-header .main-header-menu .menu-link:focus-visible,
#ast-desktop-header .ast-builder-menu-1 .menu-item.current-menu-item > .menu-link,
#ast-desktop-header .ast-builder-menu-1 .menu-item.current-menu-ancestor > .menu-link {
    color: #2d6a4f !important;
}

/* La cabecera activa de Local usa Elementor Theme Builder, no Astra. */
.elementor-location-header .elementor-nav-menu--main a.elementor-item,
.elementor-location-header .elementor-nav-menu--dropdown a.elementor-sub-item,
.elementor-location-header .elementor-menu-toggle {
    color: #173e2d !important;
}

.elementor-location-header .elementor-nav-menu--main a.elementor-item:hover,
.elementor-location-header .elementor-nav-menu--main a.elementor-item:focus-visible,
.elementor-location-header .elementor-nav-menu--main a.elementor-item.elementor-item-active,
.elementor-location-header .elementor-nav-menu--dropdown a.elementor-sub-item:hover,
.elementor-location-header .elementor-nav-menu--dropdown a.elementor-sub-item:focus-visible {
    color: #2d6a4f !important;
}

/* Cabecera nativa del tema: elimina la dependencia visual de Elementor Pro. */
.lmr-site-header {
    position: relative;
    z-index: 950;
    border-bottom: 1px solid var(--lmr-color-line, #e2ddd5);
    background: #fff;
}

.lmr-site-header__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: min(100% - 40px, 1240px);
    min-height: 92px;
    margin-inline: auto;
}

.lmr-site-header__brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    color: #173e2d;
    font-weight: 800;
    text-decoration: none;
}

.lmr-site-header__brand .custom-logo-link,
.lmr-site-header__brand .custom-logo {
    display: block;
}

.lmr-site-header__brand .custom-logo {
    width: auto;
    max-width: 190px;
    max-height: 72px;
}

.lmr-site-header__navigation {
    display: block;
    flex: 1 1 auto;
}

.lmr-primary-menu,
.lmr-primary-menu ul {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lmr-primary-menu > li {
    position: relative;
}

.lmr-primary-menu a {
    display: block;
    min-height: 44px;
    padding: 0.75rem 0.7rem;
    color: #173e2d;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.lmr-primary-menu a:hover,
.lmr-primary-menu a:focus-visible,
.lmr-primary-menu .current-menu-item > a,
.lmr-primary-menu .current-menu-ancestor > a {
    color: #2d6a4f;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.lmr-primary-menu .sub-menu {
    position: absolute;
    z-index: 960;
    top: 100%;
    left: 0;
    display: block;
    min-width: 250px;
    border: 1px solid var(--lmr-color-line, #e2ddd5);
    background: #fff;
    box-shadow: 0 8px 24px rgba(26, 60, 42, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.35rem);
    transition: opacity 140ms ease, transform 140ms ease;
}

.lmr-primary-menu li:hover > .sub-menu,
.lmr-primary-menu li:focus-within > .sub-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.lmr-primary-menu .sub-menu a {
    width: 100%;
    color: #173e2d;
    white-space: normal;
}

.lmr-site-header__toggle {
    display: none;
    min-width: 44px;
    min-height: 44px;
    border: 2px solid #173e2d;
    border-radius: 8px;
    background: #fff;
    color: #173e2d;
    font-size: 1.25rem;
}

@media (max-width: 900px) {
    .lmr-site-header__inner {
        gap: 0.75rem;
    }

    .lmr-primary-menu a {
        padding-inline: 0.45rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 782px) {
    .lmr-site-header__inner {
        position: relative;
        width: min(100% - 24px, 1240px);
        min-height: 72px;
    }

    .lmr-site-header__brand .custom-logo {
        max-width: 150px;
        max-height: 58px;
    }

    .lmr-site-header__toggle {
        display: inline-grid;
        flex: 0 0 auto;
        place-items: center;
        margin-left: auto;
    }

    .lmr-site-header__navigation {
        position: absolute;
        z-index: 960;
        top: 100%;
        right: 0;
        left: 0;
        display: none;
        border: 1px solid var(--lmr-color-line, #e2ddd5);
        background: #fff;
        box-shadow: 0 8px 24px rgba(26, 60, 42, 0.12);
    }

    .lmr-site-header__navigation.is-open {
        display: block;
    }

    .lmr-primary-menu,
    .lmr-primary-menu ul {
        display: block;
    }

    .lmr-primary-menu a {
        border-bottom: 1px solid #eee9e1;
        padding: 0.85rem 1rem;
    }

    .lmr-primary-menu .sub-menu {
        position: static;
        min-width: 0;
        border: 0;
        box-shadow: none;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .lmr-primary-menu .sub-menu a {
        padding-left: 2rem;
        background: #faf6f0;
    }
}
