/* ==========================================================================
   SISTEMA DE FAVORITOS · NIUVO BEBÉS
   Estilos para botones, badge contador, modal drawer y notificaciones toast
   ========================================================================== */

/* 1. Botones de corazón activos */
.tarjeta-favorito,
[data-nvcat-corazon],
.detprod-boton-favorito {
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s, color 0.2s, box-shadow 0.2s !important;
    cursor: pointer;
}

.tarjeta-favorito:hover,
[data-nvcat-corazon]:hover,
.detprod-boton-favorito:hover {
    transform: scale(1.15) !important;
}

.tarjeta-favorito:active,
[data-nvcat-corazon]:active,
.detprod-boton-favorito:active {
    transform: scale(0.9) !important;
}

/* Corazón activo / marcado */
.tarjeta-favorito.es-favorito svg,
[data-nvcat-corazon].nvcat-corazon-activo svg,
[data-nvcat-corazon].es-favorito svg,
.detprod-boton-favorito[aria-pressed="true"] svg {
    fill: #ff3366 !important;
    stroke: #ff3366 !important;
    color: #ff3366 !important;
    filter: drop-shadow(0 2px 6px rgba(255, 51, 102, 0.4));
    animation: nvb-latido 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tarjeta-favorito.es-favorito,
[data-nvcat-corazon].nvcat-corazon-activo,
[data-nvcat-corazon].es-favorito {
    background-color: #fff0f3 !important;
    border-color: #ffccd5 !important;
}

@keyframes nvb-latido {
    0% { transform: scale(1); }
    35% { transform: scale(1.35); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* 2. Badge de favoritos en el header */
.nvb-contador--favoritos {
    background: linear-gradient(135deg, #ff4d6d, #e11d48) !important;
    color: #ffffff !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    min-width: 19px !important;
    height: 19px !important;
    line-height: 19px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 5px !important;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.4) !important;
    animation: nvb-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes nvb-pop {
    0% { transform: scale(0.4); opacity: 0; }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* 3. Modal Drawer de Favoritos */
.fav-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fav-drawer-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.fav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 440px;
    height: 100%;
    background: #ffffff;
    z-index: 99999;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.fav-drawer.is-open {
    transform: translateX(0);
}

/* Cabecera del Drawer */
.fav-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.fav-drawer__title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fav-drawer__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    font-family: inherit;
}

.fav-drawer__count {
    background: #ffe4e6;
    color: #e11d48;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
}

.fav-drawer__close {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
}

.fav-drawer__close:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
    transform: rotate(90deg);
}

/* Cuerpo con Lista de Favoritos */
.fav-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Item de Favorito */
.fav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
}

.fav-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
    background: #ffffff;
}

.fav-item__img-link {
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fav-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s;
}

.fav-item:hover .fav-item__img {
    transform: scale(1.08);
}

.fav-item__info {
    flex: 1;
    min-width: 0;
}

.fav-item__marca {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.fav-item__nombre {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 6px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-item__nombre a {
    color: inherit;
    text-decoration: none;
}

.fav-item__nombre a:hover {
    color: #00a8e8;
}

.fav-item__precio {
    font-size: 1rem;
    font-weight: 700;
    color: #0284c7;
    margin-bottom: 8px;
}

.fav-item__acciones {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fav-btn-agregar {
    background: linear-gradient(135deg, #00a8e8, #0077b6);
    color: #ffffff;
    border: none;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, transform 0.15s;
}

.fav-btn-agregar:hover {
    background: linear-gradient(135deg, #0093cc, #02669e);
    transform: scale(1.03);
}

.fav-btn-eliminar {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.fav-btn-eliminar:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
}

/* Estado Vacío */
.fav-empty {
    text-align: center;
    padding: 60px 20px;
    margin: auto 0;
}

.fav-empty__icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #fff1f2;
    color: #fb7185;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.fav-empty__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
}

.fav-empty__text {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 24px;
    line-height: 1.5;
}

.fav-empty__btn {
    display: inline-block;
    background: #00a8e8;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.fav-empty__btn:hover {
    background: #0093cc;
    transform: translateY(-2px);
}

/* Pie del Drawer */
.fav-drawer__footer {
    padding: 18px 24px;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fav-btn-vaciar {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.fav-btn-vaciar:hover {
    color: #ef4444;
}

/* 4. Notificación Flotante Toast */
.fav-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    background: #1e293b;
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.fav-toast.is-active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.fav-toast-icon {
    font-size: 1.1rem;
}
