/*
 * --------------------------------------------------------------------------
 * ESTILOS ENCAPSULADOS: COMPONENTE btn_carrito
 * --------------------------------------------------------------------------
 */

.btn-carrito-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #f8f9fa;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-carrito-wrapper:hover {
    background-color: #fff1f1;
    transform: scale(1.05);
}

.btn-carrito-icono {
    font-size: 22px;
    color: #000000;
    transition: color 0.2s ease;
}

.btn-carrito-wrapper:hover .btn-carrito-icono {
    color: #FF0000;
}

/* Badge de cantidad */
.btn-carrito-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #FF0000;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #FFFFFF;
    line-height: 1;
}

/* =========================================
   Contenedor y Menú Desplegable (Hover)
   ========================================= */

.cart-dropdown-container {
    position: relative;
    display: inline-block;
}

/* Solo se activará el hover sobre todo el contenedor */
.cart-dropdown-container:hover .cart-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-dropdown-menu {
    position: absolute;
    top: 100%;
    right: -10px; /* Alineación ligera a la derecha para centrarse visualmente con el icono */
    margin-top: 15px; /* Espacio separador superior */
    width: 280px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); /* Sombra suave como el menú de perfil */
    border: 1px solid #eaeaea;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px); /* Efecto de entrada desde abajo */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
    padding: 0;
    overflow: hidden;
}

/* Flecha decorativa superior (triangulito apuntando al icono) */
.cart-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 25px;
    width: 12px;
    height: 12px;
    background-color: #fff;
    transform: rotate(45deg);
    border-top: 1px solid #eaeaea;
    border-left: 1px solid #eaeaea;
}

.cart-dropdown-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    position: relative;
    z-index: 2; /* Para quedar por encima de la flecha si se cruza */
}

.cart-dropdown-title {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 0.95rem;
}

.cart-dropdown-count {
    font-size: 0.75rem;
    color: #666;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.cart-dropdown-body {
    padding: 15px 20px;
    max-height: 250px;
    overflow-y: auto;
    background-color: #ffffff;
}

.cart-dropdown-footer {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}
