:root {
    --ova-primary-color: #0cbc50;
    --ova-primary-dark: #006b40;
    --ova-secondary-color: #202020;
    --ova-background-color: #ffffff;
    --ova-sidebar-background: #ffffff;
    --ova-hover-background: #f1f3f5;
    --ova-active-background: #e4e6e8;
    --ova-border-color: #e4e4e4;
    --ova-text-muted: #777777;
    --ova-scrollbar-color: #c9c9c9;
    --ova-scrollbar-track-color: #f5f5f5;
    --ova-header-color: #151515;
    --ova-close-color: #555555;
    --ova-menu-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    --ova-brand-color: #0cbc50;
}

/* ==========================================================
   AISLAMIENTO DEL PLUGIN AMBIENTAL
   ========================================================== */

.ova-categories-container *,
.ova-submenu-container *,
.ova-sidebar *,
.ova-subcategories *,
.ova-third-level * {
    box-sizing: border-box;
}

/* ==========================================================
   CONTENEDOR GENERAL
   ========================================================== */

.ova-categories-container {
    position: relative;
    z-index: 1000;
}

/* ==========================================================
   BOTÓN DEL MENÚ
   ========================================================== */

.ova-menu-trigger,
.ova-categories-btn {
    padding: 0.65rem 1rem;
    background: transparent;
    border: 1px solid var(--ova-border-color);
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ova-secondary-color);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.ova-menu-trigger:hover,
.ova-categories-btn:hover {
    color: var(--ova-primary-color);
    border-color: var(--ova-primary-color);
    background: #f8fbff;
}

/* ==========================================================
   MENÚ DE ESCRITORIO
   ========================================================== */

.ova-sidebar {
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    position: fixed;
    left: -340px;
    top: 0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--ova-sidebar-background);
    border-right: 1px solid var(--ova-border-color);
    box-shadow: var(--ova-menu-shadow);
    transition: left 0.28s ease;
    pointer-events: auto;
}

.ova-sidebar.active {
    left: 0;
}

/* Cabecera */
.ova-sidebar-header {
    flex: 0 0 auto;
    padding: 22px 24px 16px;
    display: flex;
    flex-direction: column;
    background-color: var(--ova-brand-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.ova-top-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ova-sidebar-logo {
    min-width: 0;
    display: flex;
    align-items: center;
    padding-left: 2px;
}

.ova-sidebar-logo a {
    display: inline-block;
    padding: 0;
    color: #ffffff;
    background: transparent;
    text-decoration: none;
    line-height: 1.2;
}

.ova-sidebar-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 180px;
    max-height: 100px;
    object-fit: contain;
}

.ova-sidebar-close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.8rem;
    line-height: 1;
    transition:
        opacity 0.2s ease,
        background-color 0.2s ease;
}

.ova-sidebar-close:hover,
.ova-sidebar-close:focus {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.ova-divider-line {
    width: 100%;
    height: 1px;
    margin: 14px 0 10px;
    background-color: rgba(255, 255, 255, 0.4);
}

.ova-service-link {
    display: flex;
    justify-content: flex-end;
    padding-right: 2px;
}

.ova-service-link a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.ova-service-link a:hover,
.ova-service-link a:focus {
    opacity: 0.8;
    text-decoration: underline;
}

/* Lista lateral */
.ova-sidebar-items-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color:
        var(--ova-scrollbar-color)
        var(--ova-scrollbar-track-color);
}

.ova-sidebar-items-wrapper::-webkit-scrollbar,
.ova-subcategories::-webkit-scrollbar {
    width: 6px;
}

.ova-sidebar-items-wrapper::-webkit-scrollbar-track,
.ova-subcategories::-webkit-scrollbar-track {
    background: var(--ova-scrollbar-track-color);
}

.ova-sidebar-items-wrapper::-webkit-scrollbar-thumb,
.ova-subcategories::-webkit-scrollbar-thumb {
    background: var(--ova-scrollbar-color);
    border-radius: 4px;
}

/* Categorías */
.ova-category-item {
    min-height: 64px;
    padding: 0.85rem 1.2rem 0.85rem 1.45rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--ova-secondary-color);
    background: var(--ova-background-color);
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    pointer-events: auto;
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.ova-category-item:hover,
.ova-category-item.active {
    color: var(--ova-primary-color);
    background: var(--ova-active-background);
}

.ova-category-item a,
.ova-category-link {
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.ova-arrow {
    flex: 0 0 auto;
    color: var(--ova-primary-color);
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    transition: transform 0.2s ease;
}

.ova-category-item.active .ova-arrow {
    transform: translateX(3px);
}

/* ==========================================================
   PANEL DERECHO
   ========================================================== */

.ova-subcategories {
    position: fixed;
    top: 0;
    left: 320px;
    width: min(850px, calc(100vw - 320px));
    height: 100vh;
    padding: 32px 34px 42px;
    display: none;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    align-content: start;
    align-items: start;
    gap: 30px 34px;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--ova-background-color);
    border-left: 1px solid var(--ova-border-color);
    box-shadow: var(--ova-menu-shadow);
    z-index: 999998;
    pointer-events: auto;
}

.ova-subcategories.active {
    display: grid;
}

.ova-mega-title {
    grid-column: 1 / -1;
    padding-bottom: 18px;
    color: var(--ova-header-color);
    border-bottom: 1px solid var(--ova-border-color);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
}

.ova-subcategory-group {
    min-width: 0;
    pointer-events: auto;
}

.ova-subcategory-heading {
    margin-bottom: 13px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    color: var(--ova-header-color);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.3;
}

.ova-subcategory-heading a,
.ova-subcategory-heading-link {
    color: inherit;
    text-decoration: none;
}

.ova-subcategory-heading a:hover,
.ova-subcategory-heading-link:hover {
    color: var(--ova-primary-color);
}

.ova-subcategory-links {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.ova-subcategory-link {
    display: block;
    color: var(--ova-text-muted);
    font-size: 0.91rem;
    line-height: 1.35;
    text-decoration: none;
    pointer-events: auto;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.ova-subcategory-link:hover,
.ova-subcategory-link:focus {
    color: var(--ova-primary-color);
    transform: translateX(3px);
}

/* El tercer nivel de escritorio no se utiliza */
.ova-third-level {
    display: none !important;
}

/* ==========================================================
   FONDO DEL MENÚ
   ========================================================== */

.ova-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* ==========================================================
   MENÚ MÓVIL
   ========================================================== */

.ova-submenu-container {
    display: none;
}

@media (max-width: 767px) {
    .ova-categories-container {
        display: none !important;
    }

    .ova-sidebar,
    .ova-subcategories,
    .ova-third-level {
        display: none !important;
    }

    .ova-submenu-container {
        position: fixed;
        inset: 0;
        z-index: 999999;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        display: block;
        visibility: hidden;
        overflow: hidden;
        background: #ffffff;
        transform: translateX(-100%);
        transition:
            transform 0.28s ease,
            visibility 0.28s ease;
    }

    .ova-submenu-container.active {
        visibility: visible;
        transform: translateX(0);
    }

    .ova-menu-level {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        background: #ffffff;
        transition: transform 0.28s ease;
    }

    .ova-menu-header {
        position: sticky;
        top: 0;
        z-index: 10;
        min-height: 60px;
        padding: 0 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #ffffff;
        border-bottom: 1px solid #eeeeee;
    }

    .ova-menu-title {
        flex: 1 1 auto;
        padding: 0 8px;
        overflow: hidden;
        color: var(--ova-header-color);
        font-size: 1.05rem;
        font-weight: 700;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ova-close-btn,
    .ova-back-btn {
        flex: 0 0 auto;
        min-width: 44px;
        min-height: 44px;
        padding: 0 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--ova-close-color);
        background: transparent;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 1rem;
    }

    .ova-close-btn {
        font-size: 1.5rem;
    }

    .ova-close-btn:hover,
    .ova-close-btn:focus,
    .ova-back-btn:hover,
    .ova-back-btn:focus {
        color: var(--ova-primary-color);
        background: #f5f5f5;
        outline: none;
    }

    .ova-menu-content {
        padding: 10px 0;
        background: #ffffff;
    }

    .ova-menu-item {
        min-height: 54px;
        padding: 14px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        color: var(--ova-secondary-color);
        background: #ffffff;
        border-bottom: 1px solid #f2f2f2;
        cursor: pointer;
        font-size: 0.95rem;
        font-weight: 600;
        line-height: 1.3;
        transition:
            color 0.2s ease,
            background-color 0.2s ease;
    }

    .ova-menu-item:hover,
    .ova-menu-item:active {
        color: var(--ova-primary-color);
        background: #f8f9fa;
    }

    .ova-menu-item.ova-has-link {
        padding: 0;
    }

    .ova-menu-item a,
    .ova-mobile-link {
        width: 100%;
        min-height: 54px;
        padding: 14px 20px;
        display: flex;
        align-items: center;
        color: inherit;
        text-decoration: none;
    }

    .ova-menu-item a:hover,
    .ova-menu-item a:focus,
    .ova-mobile-link:hover,
    .ova-mobile-link:focus {
        color: var(--ova-primary-color);
        background: #f8f9fa;
        outline: none;
    }
}

/* ==========================================================
   TABLET
   ========================================================== */

@media (min-width: 768px) and (max-width: 1100px) {
    .ova-sidebar {
        width: 280px;
    }

    .ova-subcategories {
        left: 280px;
        width: calc(100vw - 280px);
        padding: 28px 24px 36px;
        grid-template-columns: repeat(2, minmax(180px, 1fr));
        gap: 26px 24px;
    }
}

/* ==========================================================
   REDUCIR ANIMACIONES
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
    .ova-sidebar,
    .ova-submenu-container,
    .ova-category-item,
    .ova-subcategory-link,
    .ova-arrow {
        transition: none;
    }
}

/* ==========================================================
   MENÚ AMBIENTAL A PANTALLA COMPLETA
   ========================================================== */

.ova-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: -340px;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding-top: 0 !important;
}

.ova-sidebar.active {
    top: 0 !important;
    left: 0;
    height: 100vh !important;
    height: 100dvh !important;
}

.ova-subcategories {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
}

.ova-third-level {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
}


@media (max-width: 767px) {
    .ova-submenu-container {
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .ova-menu-level {
        top: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
    }
}


.ova-sidebar-logo {
    display: flex;
    align-items: center;
    min-height: 54px;
}

.ova-ambiental-logo-link {
    display: inline-flex;
    align-items: center;
    max-width: 200px;
    text-decoration: none;
}

.ova-ambiental-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 190px;
    max-height: 70px;
    object-fit: contain;
}