/* ========================================
   OFF-CANVAS MENU - ESTILOS MEJORADOS
   ======================================== */

/* Botón para abrir el menú */
.btn-menu-offcanvas {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: fixed;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.btn-menu-offcanvas:hover {
    opacity: 0.8;
    transform: translateY(-50%) scale(1.1);
}

.btn-menu-offcanvas span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Estilos del off-canvas */
.offcanvas {
    width: 180px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    opacity: 85%;
}

.offcanvas-header {
    border-bottom: 2px solid #e9ecef;
    padding: 1.5rem;
}

.offcanvas-title {
    font-weight: 700;
    font-size: 1.5rem;
    color: #333;
}

.offcanvas-body {
    padding: 0;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
}

/* Navegación de categorías */
.categoria-nav {
    display: flex;
    flex-direction: column;
}

.categoria-link {
    display: block;
    padding: 1rem 1.5rem;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-bottom: 1px solid #dee2e6;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.categoria-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #ff6b6b 0%, #ff8787 100%);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.categoria-link:hover {
    background-color: #fff3e0;
    color: #ff6b6b;
    padding-left: 2rem;
}

.categoria-link:hover::before {
    transform: scaleY(1);
}

.categoria-link:last-child {
    border-bottom: none;
}

/* Efecto activo cuando se está viendo la categoría */
.categoria-link.active {
    background-color: #fff3e0;
    color: #ff6b6b;
    padding-left: 2rem;
}

.categoria-link.active::before {
    transform: scaleY(1);
}

/* Scroll suave para toda la página */
html {
    scroll-behavior: smooth;
}

/* 
 * Alternativa a scroll-margin-top para navegadores antiguos
 * Se maneja con JavaScript en la función scrollToElement
 */
[id^="categoria-"] {
    /* Fallback para navegadores modernos */
    scroll-margin-top: 100px;
}

/* Responsivo - Ajustes para pantallas pequeñas */
@media (max-width: 576px) {
    .btn-menu-offcanvas span {
        display: none;
    }

    .offcanvas {
        width: 80% !important;
    }

    .categoria-link {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }

    .categoria-link:hover {
        padding-left: 1.75rem;
    }

    .categoria-link.active {
        padding-left: 1.75rem;
    }
}

/* Responsivo - Pantallas medianas */
@media (max-width: 768px) {
    .btn-menu-offcanvas {
        left: 0;
        top: 3rem;
        color: #283C5E;
        background-color: #E2C328;
        border-radius: 0 1rem 1rem 0;
        padding-right: 0.9rem;
    }
}