/* /assets/css/sofi-dock.v3.css */
/* Sofi v3 · UNBREAKABLE STYLE */

:root {
    --sofi-primary: #ff4ecd;
    --sofi-secondary: #6c5ce7;
    --sofi-bg: #050509;
    --sofi-text: #ffffff;
    --sofi-radius: 24px;
    --sofi-shadow: 0 22px 60px rgba(0, 0, 0, 0.7);
}

/* BASE CONTAINER - ID wins over class */
#sofi-dock {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    z-index: 2000000 !important;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

#sofi-dock>* {
    pointer-events: auto !important;
}

/* RE-DISPLACEMENT FOR MOBILE (FORCE PARITY) */
@media (max-width: 900px) {

    /* Use ID to ensure it clears PHP blocks */
    #sofi-dock.sofi-dock,
    #sofi-dock.sofi-dock--site,
    #sofi-dock.sofi-dock--quince {
        right: 10px !important;
        bottom: 125px !important;
        /* Definitivamente arriba del menú neón */
        left: auto !important;
    }

    #sofi-dock.sofi-dock--admin {
        bottom: 20px !important;
    }

    /* Panel Adjustments */
    .sofi-panel {
        width: 340px !important;
        max-height: 55vh !important;
        bottom: 74px !important;
        right: -5px !important;
    }
}

/* ============== BURBUJA ============== */
.sofi-bubble {
    border: none;
    padding: 0;
    width: 62px;
    height: 62px;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--sofi-primary), var(--sofi-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.sofi-bubble-avatar {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid #fff;
}

.sofi-bubble-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============== PANEL UI ============== */
.sofi-panel {
    position: absolute;
    right: 0;
    bottom: 82px;
    width: 360px;
    max-height: 480px;
    border-radius: 24px;
    background: rgba(13, 13, 21, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(15px) scale(0.95);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sofi-dock.sofi-open .sofi-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.sofi-panel-header {
    background: linear-gradient(90deg, var(--sofi-primary), var(--sofi-secondary));
    padding: 12px 16px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sofi-panel-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sofi-panel-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid #fff;
}

.sofi-panel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sofi-panel-titles {
    display: flex;
    flex-direction: column;
}

.sofi-panel-title {
    font-size: 14px;
    font-weight: 700;
}

.sofi-panel-subtitle {
    font-size: 10px;
    opacity: 0.8;
}

.sofi-panel-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

/* Scrollable area */
.sofi-panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 8px;
    overflow: hidden;
}

.sofi-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

/* MENSAJES DISTINTOS */
.sofi-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    font-size: 13px;
    line-height: 1.4;
}

.sofi-message--sofi {
    align-self: flex-start;
}

.sofi-message--sofi .sofi-message-bubble {
    background: rgba(255, 255, 255, 0.08);
    border-top-left-radius: 4px;
    border-left: 2px solid var(--sofi-primary);
    /* Borde rosa distintivo */
    color: #ffbdf7 !important;
    /* Light Pink Text for Sofi */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.sofi-message--user {
    align-self: flex-end;
}

.sofi-message--user .sofi-message-bubble {
    background: linear-gradient(135deg, var(--sofi-primary), var(--sofi-secondary));
    border-bottom-right-radius: 4px;
    color: #fff;
    font-weight: 500;
}

.sofi-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
}

/* Input area - Auto Grow ready */
.sofi-input-bar {
    display: flex;
    align-items: flex-end;
    padding: 10px;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sofi-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13.5px;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    padding: 4px 0;
}

.sofi-send-btn {
    background: var(--sofi-primary);
    border: none;
    border-radius: 12px;
    color: #fff;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.sofi-panel-footer {
    text-align: center;
    padding: 6px;
    opacity: 0.4;
    font-size: 9px;
}

/* ============== ACTIONS UI (Fallback) ============== */
.sofi-actions-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.sofi-action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 78, 205, 0.4);
    color: #ffd6f4;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sofi-action-btn:hover {
    background: var(--sofi-primary);
    border-color: var(--sofi-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 78, 205, 0.5);
}

/* CAROUSEL DE PROVEEDORES v9.2 */
.sofi-carousel-wrap {
    margin-top: 5px;
    width: calc(100% + 12px);
    margin-left: -6px;
    overflow: hidden;
    position: relative;
}

.sofi-carousel {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 10px 10px 20px 10px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.sofi-carousel::-webkit-scrollbar {
    display: none;
}

.sofi-card {
    flex: 0 0 160px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    scroll-snap-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    position: relative;
}

.sofi-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--sofi-primary);
    background: rgba(255, 78, 205, 0.05);
    box-shadow: 0 15px 40px rgba(255, 78, 205, 0.2);
}

.sofi-card-img {
    height: 110px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sofi-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 9px;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 8px;
    color: #fff;
    text-transform: uppercase;
}

.sofi-card-badge.elite {
    background: linear-gradient(45deg, #ffd700, #ff8c00);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.sofi-card-badge.premium {
    background: var(--sofi-secondary);
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.4);
}

.sofi-card-badge.discount {
    top: auto;
    bottom: 10px;
    right: 10px;
    left: auto;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
    font-size: 8px;
}

.sofi-card-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sofi-card-name {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    flex: 1;
}

.sofi-card-price {
    font-size: 11px;
    color: var(--sofi-primary);
    font-weight: 800;
    white-space: nowrap;
}

.sofi-card-cat {
    font-size: 10px;
    opacity: 0.6;
    text-transform: uppercase;
    font-weight: 600;
    display: block;
}

.sofi-card-city {
    font-size: 10px;
    opacity: 0.8;
    color: #ffd6f4;
    display: block;
}

.sofi-card-btn {
    margin-top: 10px;
    background: rgba(255, 78, 205, 0.1);
    border: 1px solid var(--sofi-primary);
    color: var(--sofi-primary);
    border-radius: 12px;
    padding: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 700;
    text-align: center;
    width: 100%;
}

.sofi-card:hover .sofi-card-btn {
    background: var(--sofi-primary);
    color: #fff;
}

/* CAROUSEL NAVIGATION */
.sofi-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(5, 5, 9, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s;
    font-weight: bold;
}

.sofi-carousel-btn:hover {
    background: var(--sofi-primary);
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 78, 205, 0.6);
}

.sofi-carousel-btn--prev {
    left: -10px;
}

.sofi-carousel-btn--next {
    right: -10px;
}

@keyframes sofi-peek {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(5px);
    }
}

.sofi-carousel-hint {
    font-size: 11px;
    opacity: 0.6;
    text-align: right;
    padding-right: 20px;
    margin-top: -10px;
    margin-bottom: 5px;
    color: var(--sofi-primary);
    animation: sofi-peek 1.5s infinite;
    font-weight: 600;
}

/* ============== MAGIC ACCESS CARDS v10.0 ============== */
.sofi-module-card {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: sofi-card-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 4px solid var(--sofi-primary);
}

@keyframes sofi-card-pop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.sofi-module-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sofi-module-card-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, rgba(255, 78, 205, 0.2), rgba(108, 92, 231, 0.2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sofi-module-card-info {
    flex: 1;
}

.sofi-module-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.sofi-module-card-desc {
    font-size: 11px;
    opacity: 0.7;
    color: #ffd6f4;
}

.sofi-module-card-action {
    background: linear-gradient(90deg, var(--sofi-primary), var(--sofi-secondary));
    border: none;
    border-radius: 12px;
    color: #fff;
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 78, 205, 0.3);
}

.sofi-module-card-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 78, 205, 0.5);
    filter: brightness(1.1);
}

.sofi-module-card-status {
    font-size: 10px;
    text-align: center;
    opacity: 0.5;
    font-style: italic;
}

/* ============== CHIPS & QUICK ACTIONS ============== */
.sofi-chip-bar {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 2px;
    animation: fadeIn 0.3s ease;
}

.sofi-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 78, 205, 0.4);
    color: #ffd6f4;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(5px);
    white-space: nowrap;
}

.sofi-chip:hover {
    background: var(--sofi-primary);
    color: #fff;
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 78, 205, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}