/* Limitamos la altura del editor y activamos el scroll interno */
.ql-container {
    height: 350px !important; /* Altura máxima fija */
    overflow-y: auto;        /* Activa el scroll vertical */
    background-color: inherit;
}

/* Opcional: Estilizar la barra de herramientas para que no se mueva */
.ql-toolbar {
    background-color: inherit;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
    
.ql-container {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.overlay-wrapper img {
    transition: transform 0.3s ease;
}
.overlay:hover img {
    transform: scale(1.05);
}

.product-cover {
    height: 300px !important;
    object-fit: cover;
    object-position: center;
}
.ck-editor-container {
    /* Altura fija o máxima */
    height: 400px !important; 
    display: flex;
    flex-direction: column;
    }

/* El área editable es la que debe tener el scroll */
.ck-content {
    height: 100% !important;
    overflow-y: auto !important;
    padding: 1.5rem !important; /* El padding se lo damos al contenido */
}

/* Estética de la barra de herramientas fija */
.ck-toolbar {
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
    border-bottom: 1px solid #e1e3ea !important;
}

/* Bordes 100% redondeados */
.search-container .bg-white, 
.search-container input {
    border-radius: 50px !important;
}

.kb-search-container .bg-white, 
.kb-search-container input {
    border-radius: 50px !important;
}


/* Modo Oscuro */
[data-bs-theme="dark"] .search-container .bg-white {
    background-color: #1e1e2d !important;
    border: 1px solid #323248;
}
[data-bs-theme="dark"] .search-results-box {
    background-color: #1e1e2d !important;
    border: 1px solid #323248;
}

.separator.separator-dashed {
    border-bottom: 1px dashed var(--bs-gray-300);
}

.hero-content {
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 3;
}

.hero-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 0 0 50% 50% / 0 0 10% 10%;
    z-index: 1;
    max-height: 550px;
}

/* 2. El contenedor del buscador DEBE ser el rey del z-index */
.search-container {
    position: relative;
    z-index: 99999 !important; 
}

/* 1. EL BUSCADOR (PILL) - Diseño original restaurado */
.search-container .bg-white {
    border-radius: 50px !important;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

/* 2. LA UNIÓN (Cuando está activo) */
.search-container.active .bg-white {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom: 1px solid var(--bs-gray-200);
    box-shadow: none !important;
}

.kb-search-container {
    position: relative;
}

/* 1. EL BUSCADOR (PILL) - Diseño original restaurado */
.kb-search-container .bg-white {
    border-radius: 50px !important;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

/* 2. LA UNIÓN (Cuando está activo) */
.kb-search-container.active .bg-white {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom: 1px solid var(--bs-gray-200);
    box-shadow: none !important;
}

/* 3. EL PREVIEW (Fiel a tu captura) */
.search-results-box {
    display: none;
    position: absolute;
    width: 100%;
    top: 100%;
    left: 0;
    background-color: var(--bs-body-bg);
    border-bottom-left-radius: 25px !important;
    border-bottom-right-radius: 25px !important;
    border: 1px solid var(--bs-gray-200);
    border-top: 0 !important;
    margin-top: 0 !important;
    
    /* EL ARREGLO PARA QUE NO SE CORTE: */
    z-index: 10000000 !important; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    
    /* SCROLL */
    max-height: 400px;
    overflow-y: auto;
}

/* 4. MODO OSCURO (Restaurado) */
[data-bs-theme="dark"] .search-container .bg-white,
[data-bs-theme="dark"] .search-results-box {
    background-color: #15181c !important;
    border: 1px solid #323248;
    color: white;
}

/* 4. IMPORTANTE: Si el hero-overlay te está tapando, bájale el z-index */
.hero-overlay {
    z-index: 2 !important;
}

/* Personalización del scroll para Chrome/Safari */
.search-results-box::-webkit-scrollbar {
    width: 6px;
}
.search-results-box::-webkit-scrollbar-thumb {
    background-color: var(--bs-primary);
    border-radius: 10px;
}

#kt_header_search {
    overflow: visible !important;
}

.widgets-area {
    margin-bottom: 2rem;
}

.widget {
    background: inherit;
    border-radius: 0.375rem;
    margin-bottom: 25px;
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: inherit;
    padding-bottom: 0.5rem;
}

.widget-content {
    line-height: 1.6;
}

.widget-image-link {
    display: block;
    transition: opacity 0.3s;
}

.widget-image-link:hover {
    opacity: 0.9;
}

.recent-products-list .product-item {
    padding: 0;

}

.recent-products-list .product-item:last-child {
    border-bottom: none;
}

.product-image img {
    max-width: 100%;
    height: auto;
}

.modal-md-custom {
    max-width: min(90vw, 700px);
}

.header-enw {
    --bs-card-spacer-y: 1rem;
    --bs-card-spacer-x: 1rem;
    --bs-card-title-spacer-y: 0.5rem;
    --bs-card-title-color: var(--bs-gray-900);
    --bs-card-border-width: 1px;
    --bs-card-border-radius: 0.625rem;
    --bs-card-box-shadow: 0px 3px 4px 0px rgba(0, 0, 0, 0.03);
    --bs-card-inner-border-radius: calc(0.625rem - 1px);
    --bs-card-cap-padding-y: 0.5rem;
    --bs-card-cap-padding-x: 1rem;
    --bs-card-cap-bg: transparent;
    --bs-card-bg: var(--bs-body-bg);
    --bs-card-img-overlay-padding: 1rem;
    --bs-card-group-margin: 0.75rem;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: var(--bs-card-height);
    color: var(--bs-body-color);
    word-wrap: break-word;
    background-color: var(--bs-card-bg);
    background-clip: border-box;
    border: var(--bs-card-border-width) solid var(--bs-card-border-color);
    border-radius: var(--bs-card-border-radius);
    box-shadow: var(--bs-card-box-shadow);
}


.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}
/* Forzar que el footer de la card esté siempre al fondo */
.product-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}
.product-img-container {
    height: 180px; /* Tamaño reducido para un grid más elegante */
    overflow: hidden;
    position: relative;
}
.product-img-container div {
    transition: transform 0.5s ease;
}
.product-card:hover .product-img-container div {
    transform: scale(1.1);
}

/* Animación de rebote */
@keyframes cart-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}
.cart-animate {
    animation: cart-bounce 0.5s ease-in-out;
}

/* Badge persistente */
.cart-badge {
    position: absolute !important;
    top: -6px !important;
    right: -5px !important;
    display: none;
    margin-left: -8px;
}

@keyframes bounce-cart {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}
.animate-bounce { animation: bounce-cart 0.5s ease-in-out; }


/* Modo Oscuro */
[data-bs-theme="light"] .ma-login {
    background-color: #ffffff  !important;
}

[data-bs-theme="light"] .bg-light {
    background-color: #f1efef8f !important
}

[data-bs-theme="light"] .kb-search {
    background-color: #f1efefb5 !important
}

[data-bs-theme="dark"] .ma-login .bg-light {
    background-color: #1f2128  !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #16171c !important
}

@media (max-width: 991.98px) {
    .app-header-mobile-drawer {
        background-color: #ffffff !important;
        padding: 1rem;
    }
    .app-header-mobile-drawer .menu-link {
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
    }
    .app-header-mobile-drawer .menu-link.active {
        background-color: var(--bs-light-primary);
    }

    [data-bs-theme="dark"] .app-header-mobile-drawer {
        background-color: #1e1e2d !important;
    }

    .hero-content {
        min-height: 300px;

    }
    .hero-clip {
        max-height: 400px;
    }

    .mt-10vh{
        margin-top: 10vh;
    }

    .mt-13vh{
        margin-top: 7vh !important;
    }

    .mt-15vh{
        margin-top: 10vh !important;
    }

    .mt-20vh{
        margin-top: 15vh !important;
    }
}

.mt-10vh{
    margin-top: 10vh !important;
}

.mt-13vh{
    margin-top: 13vh;
}

.mt-15vh{
    margin-top: 15vh;
}

.mt-20vh{
    margin-top: 20vh;
}


/* 1. ELIMINA EL SCROLL LATERAL DEFINITIVAMENTE */
html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
    position: relative;
}

/* 2. CORRECCIÓN AOS (Para que el contenido aparezca y sea interactivo) */
[data-aos] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

/* Solo aplicamos la animación si la librería está lista */
.aos-init[data-aos] {
    opacity: 0;
}
.aos-animate[data-aos] {
    opacity: 1;
    transform: translateZ(0);
}

#kt_app_header {
    background-color: #ffffff !important;
    background-color: var(--bs-app-header-minimize-bg-color);
    box-shadow: var(--bs-app-header-minimize-box-shadow);
    border-bottom: var(--bs-app-header-minimize-border-bottom);
}

[data-bs-theme="dark"] #kt_app_header {
    background-color: #1e1e2d !important;
    background-color: var(--bs-app-header-minimize-bg-color);
    box-shadow: var(--bs-app-header-minimize-box-shadow);
    border-bottom: var(--bs-app-header-minimize-border-bottom);
}

/* Asegurar fondo en modo sticky (al hacer scroll) */
.app-header-minimize #kt_app_header {
    background-color: #ffffff !important;
    box-shadow: 0 10px 30px 0 rgba(0,0,0,0.1) !important;
}

[data-bs-theme="dark"] .app-header-minimize .menu-handle #kt_app_header {
    background-color: #1e1e2d !important;
}
[data-bs-theme="dark"] .menu-handle {
    background-color: #1e1e2d !important;
}

/* 4. AJUSTE MENÚ USUARIO */
#kt_header_user_menu_toggle .menu-sub-dropdown {
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1200 !important;
}

/* 5. RESPONSIVE LOGO Y PADDING */
@media (max-width: 991.98px) {
    .app-container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

.settings-nav .nav-link { padding: 1rem 1.5rem; display: flex; align-items: center; color: #5e6278; border-radius: 0.5rem; margin-bottom: 0.5rem; transition: all 0.3s ease; }
.settings-nav .nav-link i { color: #a1a5b7; margin-right: 10px; font-size: 1.25rem; }
 .ck-editor-container { min-height: 300px; border: 1px solid var(--bs-root-card-border-color) !important; background-color: var(--bs-app-bg-color) }
.tab-content > .tab-pane:not(.active) { display: none !important; }
    
/* Contenedor del menú */
#menu-sortable-container { 
    min-height: 100px; 
    padding: 15px; 
    border: 2px dashed var(--bs-root-card-border-color);
    border-radius: 8px;
    background-color: var(--bs-app-bg-color);
}

/* Zonas de caída para submenús */
.menu-dropzone { 
    padding-left: 30px; /* Indentación para submenús */
    margin: 5px 0;
    transition: all 0.2s ease;
       border-radius: 4px;
    position: relative;
}

/* Indicador visual para zonas de anidamiento activas */
.menu-dropzone.sortable-active {
    background-color: rgba(0, 159, 247, 0.05);
    border: 1px dashed #009ef7;
}

/* Estilo del item - mejorado para arrastre */
.menu-item-instance { 
    margin-bottom: 8px; 
       position: relative;
    transition: all 0.3s ease;
}

.menu-handle { 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    padding: 12px 15px; 
    background-color: #fff; 
    border: 1px solid var(--bs-root-card-border-color); 
    border-radius: 4px; 
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    cursor: move;
    transition: all 0.2s ease;
}

.menu-handle:hover { 
    background: #f6f7f7; 
    border-color: var(--bs-root-card-border-color); 
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,.08);
}

/* Indicador visual para elementos que pueden tener hijos */
.menu-handle:after {
    content: '';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid #a1a5b7;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    opacity: 0.6;
}

 /* Indicadores visuales al arrastrar */
.sortable-ghost { 
    opacity: 0.6; 
    background: #f0f7ff !important; 
    border: 2px dashed #009ef7 !important;
    box-shadow: 0 0 10px rgba(0, 159, 247, 0.2);
}

.sortable-chosen { 
    background: #fcfcfc;
    transform: rotate(2deg);
}

.sortable-drag {
    opacity: 0.8;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Nivel de anidamiento visual */
.menu-dropzone[data-level="2"] { padding-left: 50px; }
.menu-dropzone[data-level="3"] { padding-left: 70px; }
.menu-dropzone[data-level="4"] { padding-left: 90px; }


.full-width-breakout {
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
}

@media (max-width: 991px) {
    #cookie-banner {
        width: 95% !important;
        bottom: 10px !important;
        padding: 1rem !important;
    }
}

#cookie-banner {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}
[data-bs-theme="dark"] #cookie-banner {
    background: rgba(30, 30, 45, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Ajuste para el botón flotante re-abridor */
#btn-reopen-cookies {
    background: rgba(30, 30, 45, 0.8) !important;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.select2-container--bootstrap5 .select2-dropdown {
    margin-top: -5px !important;
    border-top: none !important;
}
    
.select2-container {
    z-index: 1060 !important;
}

.ck-editor__editable_inline {
    min-height: 300px !important;
    max-height: 500px !important; /* Altura máxima antes de hacer scroll */
    overflow-y: auto !important;
}

    /* Opcional: Estilizar el contenedor para que se vea como un bloque sólido */
.ck-editor-container {
    border: 1px solid inherit;
    border-radius: 0 0 0.5rem 0.5rem;
}

#editor_kb {
    min-height: 250px !important;
    max-height: 300px !important; /* Altura máxima antes de hacer scroll */
    overflow-y: auto !important;
    background-color: inherit !important;
}

    /* Ajustar la barra de herramientas para que no sea tan ancha */
.ck-toolbar {
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

    /* Asegurar que el modal no se pegue a los bordes de la pantalla */
.modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

    /* Contenedor padre para permitir el sticky */
    .app-container.kb-container {
        align-items: flex-start !important;
    }

    @media (min-width: 992px) {
        .kb-sticky-column {
            position: -webkit-sticky;
            position: sticky;
            top: 110px;
            z-index: 100;
            height: fit-content;
            border-radius: 1rem;
            padding: 1.5rem;
            
            /* Efecto Blur Global */
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            transition: background-color 0.3s ease, border-color 0.3s ease;
        }

        /* --- CONFIGURACIÓN MODO CLARO --- */
        [data-bs-theme="light"] .kb-sticky-column {
            background: rgba(255, 255, 255, 0.7);
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        /* --- CONFIGURACIÓN MODO OSCURO (DARK) --- */
        [data-bs-theme="dark"] .kb-sticky-column {
            background: rgba(30, 30, 45, 0.6); /* Fondo oscuro semi-transparente */
        }
    }

    /* Ajuste de colores de texto y enlaces en el sticky */
    .kb-sticky-column .menu-link {
        border-radius: 0.5rem;
    }

    [data-bs-theme="dark"] .kb-sticky-column .menu-section {
        color: var(--bs-gray-500) !important;
    }

    [data-bs-theme="dark"] .kb-sticky-column .menu-title {
        color: var(--bs-gray-700);
    }

    [data-bs-theme="dark"] .kb-sticky-column .menu-link:hover .menu-title,
    [data-bs-theme="dark"] .kb-sticky-column .menu-link.active .menu-title {
        color: var(--bs-primary) !important;
    }

    /* Estilo para los iconos en modo dark */
    [data-bs-theme="dark"] .kb-sticky-column .menu-icon i {
        color: var(--bs-primary);
        opacity: 0.8;
    }


.kb-scroll-btn {
    position: fixed !important;
    right: 25px !important;
    bottom: 25px !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: var(--bs-body-bg) !important;
    display: none; /* Se activa con JS */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999999 !important; /* Capa máxima absoluta */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
}

.kb-scroll-btn i {
    font-size: 1.5rem !important;
    color: var(--bs-primary) !important;
    position: absolute !important;
    z-index: 2;
}

/* El círculo de progreso */
.kb-progress-svg {
    transform: rotate(-90deg);
}
.kb-progress-background {
    fill: none;
    stroke: var(--bs-gray-200);
    stroke-width: 6;
}
.kb-progress-bar {
    fill: none;
    stroke: var(--bs-primary);
    stroke-width: 6;
    stroke-dasharray: 283; /* Valor fijo para r=45 */
    stroke-dashoffset: 283; /* Empieza vacío */
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

/* Forzar visualización en Dark Mode */
[data-bs-theme="dark"] .kb-scroll-btn {
    background: #1e1e2d !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
}

@media (min-width: 1200px) {
    #profile_sidebar.offcanvas-xl {
        visibility: visible !important;
        transform: none !important;
        position: relative !important;
        z-index: 1 !important;
        display: block !important;
        background: none !important;
        border: none !important;
    }
}

/* Ajuste para el fondo del Offcanvas en móvil */
.offcanvas-backdrop.show {
       opacity: 0.5 !important;
}

@media (max-width: 991px) {
        /* Estilos para centrar el Offcanvas móvil con altura fija */
        #kb_mobile_sidebar {
            height: 400px !important;
            top: 50% !important;
            transform: translateY(-50%) translateX(100%);
            border-radius: 1.5rem 0 0 1.5rem;
            margin-right: 10px;
            box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        }

        #kb_mobile_sidebar.show {
            transform: translateY(-50%) translateX(0);
            background: rgba(255, 255, 255, 0.8) !important;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(12px);
        }

        [data-bs-theme="dark"] #kb_mobile_sidebar.show {
            background: rgba(30, 30, 45, 0.8) !important;
        }
        
        .offcanvas-backdrop {
            height: 100vh !important;
        }

        /* Estilos para el indicador de scroll */
        #scroll_indicator {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%); /* Solo centrado horizontal fijo */
            z-index: 1051;
            transition: opacity 0.5s ease, visibility 0.5s ease;
            opacity: 1;
            visibility: visible;
        }

        #scroll_indicator.hidden {
            opacity: 0;
            visibility: hidden;
        }

        /* Animación de rebote separada para no romper el centrado */
        .pulse-animation i {
            animation: bounce-arrow 2s infinite;
            display: block;
        }

        @keyframes bounce-arrow {
            0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
            40% { transform: translateY(10px); }
            60% { transform: translateY(5px); }
        }
        
    }