/* ============================================================
   FLOATING STACK
   De abajo a arriba:
   [flecha]  ← sola, separada
   [redes]
   [favoritos]
   [carrito]
   ============================================================ */

/* ── Flecha — sola abajo a la derecha ── */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    width: 52px; height: 52px;
    border-radius: 16px;
    background: linear-gradient(35deg, #0b62bd, var(--pink));
    color: #fff;
    font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(11,98,189,.35);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    border: none;
    cursor: pointer;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}
.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(11,98,189,.45);
}

/* ── Carrito — primer slot del grupo superior ── */
.cart-fab {
    position: fixed;
    bottom: 230px;
    right: 20px;
    z-index: 1100;
    width: 52px; height: 52px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.14);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none;
    transition: transform .2s, box-shadow .2s;
}
.cart-fab:hover { transform: scale(1.07); box-shadow: 0 8px 28px rgba(0,0,0,.2); }
.cart-fab i { font-size: 1.4rem; color: #1A1040; }
.cart-fab__badge {
    position: absolute; top: -6px; right: -6px;
    background: #e53e3e; color: #fff;
    font-size: .65rem; font-weight: 800;
    min-width: 20px; height: 20px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; border: 2px solid #fff;
    transform: scale(0);
    transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.cart-fab__badge.visible { transform: scale(1); }

/* ── Carrito drawer — pegado al fab ── */
.cart-drawer {
    position: fixed;
    bottom: 294px;
    right: 20px;
    z-index: 1099;
    width: 320px;
    max-height: 70vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(.92) translateY(12px);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: transform .25s cubic-bezier(.34,1.4,.64,1), opacity .2s;
}
.cart-drawer.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* ── Wishlist FAB ── */
.wishlist-fab {
    position: fixed;
    bottom: 172px;
    right: 20px;
    z-index: 1050;
    width: 52px; height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff6b6b, #ee0979);
    color: #fff;
    font-size: 1.2rem;
    display: none;
    align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(238,9,121,.3);
    transition: all .2s;
    border: none;
    cursor: pointer;
}
.wishlist-fab:hover { transform: scale(1.07); box-shadow: 0 8px 24px rgba(238,9,121,.45); }
.wishlist-fab.has-items { display: flex; }
.wishlist-fab__count {
    position: absolute; top: -6px; right: -6px;
    background: #fff; color: #ee0979;
    font-size: .65rem; font-weight: 800;
    min-width: 20px; height: 20px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; border: 2px solid #ee0979;
}

/* ── Redes sociales flotantes ── */
.social-fab-wrap {
    position: fixed;
    bottom: 114px;
    right: 20px;
    z-index: 1050;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 8px;
}
/* Redes en el lado izquierdo, misma altura que la flecha */
.social-fab-wrap--left {
    left: 20px;
    right: auto;
    bottom: 20px;
    flex-direction: column-reverse;
}
.social-fab-wrap--left .social-fab-item::before {
    left: calc(100% + 10px);
    right: auto;
}
.social-fab-wrap--left .social-fab-items {
    flex-direction: column;
}
.social-fab-toggle {
    width: 52px; height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none;
    box-shadow: 0 4px 16px rgba(102,126,234,.4);
    transition: all .2s;
}
.social-fab-toggle:hover { transform: scale(1.07); }
.social-fab-toggle .social-toggle-icon { transition: transform .3s; }
.social-fab-wrap.open .social-toggle-icon { transform: rotate(45deg); }

.social-fab-items {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    align-items: center;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height .35s cubic-bezier(.25,.46,.45,.94), opacity .25s;
}
.social-fab-wrap.open .social-fab-items {
    max-height: 420px;
    opacity: 1;
}
.social-fab-item {
    width: 44px; height: 44px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(0,0,0,.2);
    transition: transform .2s, opacity .2s;
    transform: scale(0.8);
    opacity: 0;
    position: relative;
}
.social-fab-wrap.open .social-fab-item {
    transform: scale(1);
    opacity: 1;
}
.social-fab-wrap.open .social-fab-item:nth-child(1) { transition-delay: .04s; }
.social-fab-wrap.open .social-fab-item:nth-child(2) { transition-delay: .08s; }
.social-fab-wrap.open .social-fab-item:nth-child(3) { transition-delay: .12s; }
.social-fab-wrap.open .social-fab-item:nth-child(4) { transition-delay: .16s; }
.social-fab-wrap.open .social-fab-item:nth-child(5) { transition-delay: .20s; }
.social-fab-wrap.open .social-fab-item:nth-child(6) { transition-delay: .24s; }
.social-fab-wrap.open .social-fab-item:nth-child(7) { transition-delay: .28s; }
.social-fab-wrap.open .social-fab-item:nth-child(8) { transition-delay: .32s; }
.social-fab-item:hover { transform: scale(1.15) !important; }

/* Tooltip */
.social-fab-item::before {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 10px);
    background: #1A1040;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}
.social-fab-item:hover::before { opacity: 1; }

/* Toast carrito */
.cart-toast {
    position: fixed;
    bottom: 294px;
    right: 84px;
    z-index: 1200;
    background: #1A1040;
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: .85rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    opacity: 0;
    transform: translateX(12px);
    transition: opacity .2s, transform .2s;
    pointer-events: none;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-toast.show { opacity: 1; transform: translateX(0); }

/* ── Mobile ── */
@media (max-width: 480px) {
    .back-to-top   { bottom: 16px; right: 16px; width: 48px; height: 48px; }
    .cart-fab      { bottom: 210px; right: 16px; width: 48px; height: 48px; }
    .cart-drawer   { right: 12px; left: 12px; width: auto; bottom: 270px; }
    .wishlist-fab  { bottom: 155px; right: 16px; width: 48px; height: 48px; }
    .social-fab-wrap:not(.social-fab-wrap--left) { bottom: 100px; right: 16px; }
    .social-fab-toggle { width: 48px; height: 48px; }
}

/* ============================================================
   WISHLIST DRAWER
   ============================================================ */
.wishlist-drawer {
    position: fixed;
    bottom: 236px;
    right: 20px;
    z-index: 1099;
    width: 320px;
    max-height: 70vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(.92) translateY(12px);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: transform .25s cubic-bezier(.34,1.4,.64,1), opacity .2s;
}
.wishlist-drawer.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}
.wishlist-drawer__list {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: #e0d9f5 transparent;
}
.wishlist-drawer__footer {
    padding: 14px 16px;
    border-top: 1px solid #f0edf9;
    flex-shrink: 0;
    background: #fff;
}
@media (max-width: 480px) {
    .wishlist-drawer { right: 12px; left: 12px; width: auto; bottom: 270px; }
    .social-fab-wrap--left { left: 12px !important; right: auto !important; bottom: 20px !important; }
    .social-fab-wrap--left .social-fab-toggle { width: 44px; height: 44px; font-size: 1rem; }
}
