@import url('fonts/fonts.css');

:root{
    --background-color: #EBDAFF;
    --text-color-purple: #ab67fa;
    --background-color-rgb: 245,240,255;
    --background-color-green: #C1FC6E;
}

html{
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(255, 255, 255);
    border-radius: 15px;
}

body{
    padding-top: 6rem;
    width:100%;
}

h1,h2,h3{
    font-family: 'BebasNeu', sans-serif !important;
}

/*HEADER*/
header{
    --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);	
    font-family: 'Montserrat', sans-serif;
    position: fixed;
    background-color: #fff;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
}

.navBrand-icon{
    margin-right: 0rem !important;
}

header .container-fluid {
    gap: 0rem !important;
}

.logo-header{
    width: auto;
    height: 40px;
}

.header-top{
    background: #474747;
    color:white;
    padding: 0.5rem 1rem;
    text-align: center;
    font-family: 'Caviar Dreams', sans-serif;
}

/* Efectos hover para los enlaces de navegación */
.nav-link {
    font-weight: 500;
    padding: 0.5rem 0.5rem !important;
    margin: 0 0.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: #474747 !important;
    background-color: rgba(182, 130, 153, 0.08);
}

.nav-link.active {
    font-size:1.1em;
    color: #B68299 !important;
    position: relative;
}

.nav-link.active::after {
    content: "";
    display: block;
    position: absolute;
    left: 0; 
    right: 0; 
    bottom: -4px;
    height: 3px;
    background: #B68299;
    border-radius: 2px;
    width: 100%;
}

header form{
    position: relative;
    right: 80px;
}

header #search-bar-container {
    width: 300px;
    max-width: 90%;
    transition: all 0.3s ease;
}

a{
    text-decoration: none;
    color: #000;
    transition: color 0.2s, transform 0.2s;
}

#cont-icon-search{
    cursor:pointer;
}

/* Estilos para los badges del carrito y favoritos */
#cart-count, #favoritos-contador-header {
    position: absolute !important;
    top: -8px !important;
    left:16px !important;
    right: -5px !important;
    font-size: 0.7rem !important;
    min-width: 22px !important;
    height: 22px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transform: none !important;
}

/* Asegurar que el contenedor padre tenga position relative */
#nav-cest, #nav-fav {
    position: relative !important;
}

.nav-tienda{
    font-size:1.1em;
}

/* =========================== NUEVO SUBMENÚ MEJORADO =========================== */

/* Flecha del submenú */
.submenu-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.3s ease;
    margin-left: 0.5rem;
    display: inline-block;
}

/* Contenedor de item con submenú */
.nav-item.has-submenu {
    position: relative;
}

/* Rotación de flecha en hover */
.nav-item.has-submenu:hover .submenu-arrow {
    transform: rotate(180deg);
}

/* Submenú principal */
.submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 280px;
    max-width: 400px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 8px;
}

/* Mostrar submenú en hover */
.nav-item.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Header del submenú */
.submenu-header {
    background: linear-gradient(135deg, #B68299 0%, #A67589 100%);
    color: white;
    padding: 1rem 1.25rem;
    text-align: center;
}

.submenu-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
}

/* Contenido del submenú */
.submenu-content {
    padding: 0.75rem 0;
}

/* Items del submenú */
.submenu-item {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #555 !important;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.submenu-item:hover {
    color: #B68299 !important;
    background-color: rgba(182, 130, 153, 0.08);
    border-left-color: #B68299;
    padding-left: 1.5rem;
}

.submenu-item.active {
    color: #B68299 !important;
    background-color: rgba(182, 130, 153, 0.12);
    border-left-color: #B68299;
    font-weight: 600;
}

/* Separador entre items */
.submenu-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
}

/* Mantener hover del enlace padre cuando se está en el submenú */
.nav-item.has-submenu:hover > .nav-link {
    color: #B68299 !important;
    background-color: rgba(182, 130, 153, 0.12) !important;
}

/* Estilos generales para la barra de desplazamiento */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: gray;
}

::-webkit-scrollbar-thumb:hover {
    background: #1F1F1F;
}

/* =========================== RESPONSIVE =========================== */

@media (max-width: 991.98px) {
    /* En móvil, los submenús se comportan como acordeones */
    .submenu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border-radius: 8px;
        margin: 0.5rem 0 0 0;
        background: #f8f9fa;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        padding: 0 1rem;
    }
    
    .nav-item.has-submenu:hover .submenu {
        max-height: 400px;
        padding: 0.75rem 1rem;
    }
    
    .submenu-header {
        background: #e9ecef;
        color: #333;
        padding: 0.75rem 1rem;
        border-radius: 6px;
        margin-bottom: 0.5rem;
    }
    
    .submenu-header h4 {
        font-size: 0.9rem;
        color: #B68299;
    }
    
    .submenu-content {
        padding: 0;
    }
    
    .submenu-item {
        padding: 0.5rem 1rem;
        border-left: none;
        border-radius: 4px;
        margin-bottom: 0.25rem;
    }
    
    .submenu-item:hover {
        padding-left: 1rem;
    }
    
    .submenu-item::after {
        display: none;
    }
}

@media (max-width: 1068px) {
    header .container-fluid{
        margin: 0 !important;
        column-gap: 2rem !important;
    }
    header form{
        position: relative;
        right: 0px;
        align-items: center;
        gap: 0rem !important;
    }
    header .navbar-brand {
        font-size: 1.2rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
        
    .logo-header{
        width: auto;
        height: 20px;
    }
        
    .nav-link {
        margin: 0.25rem 0;
        text-align: center;
    }
}

/* Animación suave para el nuevo submenú */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.nav-item.has-submenu:hover .submenu {
    animation: slideDown 0.3s ease;
}

/* Estados de accesibilidad */
.nav-link:focus,
.submenu-item:focus {
    outline: 2px solid #B68299;
    outline-offset: -2px;
}