/* =====================================================================
   Dox Sales Booster — Estilos
   ===================================================================== */

/* ── Live Viewing ─────────────────────────────────────────────────── */
.dsb-live-viewing {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    color: #555;
    margin: 8px 0 12px;
}
.dsb-eye-icon {
    font-size: 1.1em;
}
.dsb-viewing-count {
    font-weight: 700;
    color: #e44c4c;
}

/* ── Ventas recientes ────────────────────────────────────────────── */
.dsb-fake-sales {
    font-size: 0.88em;
    color: #555;
    margin: 4px 0 12px;
}
.dsb-sales-count {
    font-weight: 700;
    color: #e44c4c;
}

/* ── Stock bajo (datos reales) ───────────────────────────────────── */
.dsb-low-stock {
    font-size: 0.88em;
    color: #b3261e;
    margin: 4px 0 12px;
}
.dsb-stock-count {
    font-weight: 700;
}

/* ── Barra de envío gratis ───────────────────────────────────────── */
.dsb-shipbar {
    --dsb-shipbar-fill: #4caf50;
    --dsb-shipbar-track: #e9e9f0;
    --dsb-shipbar-text: #333;
    margin: 12px 0;
    text-align: center;
}
.dsb-shipbar-msg {
    font-size: 0.88em;
    color: var(--dsb-shipbar-text);
    margin: 0 0 8px;
    line-height: 1.4;
}
.dsb-shipbar-amount {
    font-weight: 700;
    white-space: nowrap;
}
.dsb-shipbar-track {
    position: relative;
    height: 10px;
    border-radius: 99px;
    background: var(--dsb-shipbar-track);
    overflow: hidden;
}
.dsb-shipbar-fill {
    position: relative;
    height: 100%;
    border-radius: 99px;
    overflow: hidden;
    background-color: var(--dsb-shipbar-fill);
    /* Rayas diagonales sutiles en movimiento: sensación de "en progreso" */
    background-image: linear-gradient(45deg,
        rgba(255, 255, 255, .22) 25%, transparent 25%,
        transparent 50%, rgba(255, 255, 255, .22) 50%,
        rgba(255, 255, 255, .22) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    transition: width .6s cubic-bezier(.22, .61, .36, 1);
    animation: dsb-shipbar-stripes 1s linear infinite;
}
/* Brillo que recorre la parte llena cada pocos segundos */
.dsb-shipbar-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: dsb-shipbar-shimmer 2.6s ease-in-out infinite;
}
@keyframes dsb-shipbar-stripes {
    from { background-position: 20px 0; }
    to   { background-position: 0 0; }
}
@keyframes dsb-shipbar-shimmer {
    0%        { transform: translateX(-100%); }
    55%, 100% { transform: translateX(100%); }
}
/* Al completar: se detiene el movimiento y la barra da un pequeño "pop" */
.dsb-shipbar-done .dsb-shipbar-fill {
    animation: none;
    background-image: none;
}
.dsb-shipbar-done .dsb-shipbar-fill::after { content: none; animation: none; }
.dsb-shipbar-done .dsb-shipbar-track {
    animation: dsb-shipbar-pop .5s ease;
}
@keyframes dsb-shipbar-pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.04); }
    100% { transform: scale(1); }
}
/* Accesibilidad: sin movimiento si el visitante lo tiene reducido */
@media (prefers-reduced-motion: reduce) {
    .dsb-shipbar-fill,
    .dsb-shipbar-fill::after,
    .dsb-shipbar-done .dsb-shipbar-track {
        animation: none !important;
        transition: none !important;
    }
}
/* Un respiro extra cuando va dentro del mini carrito, pegada a los botones */
.widget_shopping_cart_content .dsb-shipbar {
    margin: 14px 0;
}

/* ── Popup de compra reciente ─────────────────────────────────────── */
#dsb-popup {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
    max-width: 400px;
    width: calc(100vw - 40px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 7px 0 rgba(0,0,0,.1);
    overflow: hidden;
    pointer-events: auto;
}
#dsb-popup.dsb-pos-left  { left: 20px; }
#dsb-popup.dsb-pos-right { right: 20px; }

/* Animaciones de entrada */
#dsb-popup.animation-slide_up {
    animation-name: dsbSlideUp;
}
#dsb-popup.animation-slide_right {
    animation-name: dsbSlideFromLeft;
}
/* En posición derecha, "deslizar lateral" entra desde el borde derecho */
#dsb-popup.dsb-pos-right.animation-slide_right {
    animation-name: dsbSlideFromRight;
}
#dsb-popup.dsb-animate {
    animation-duration: .4s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(.22,.61,.36,1);
}

@keyframes dsbSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes dsbSlideFromLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes dsbSlideFromRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes dsbFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(12px); }
}
#dsb-popup.dsb-animate-out {
    animation-name: dsbFadeOut;
    animation-duration: .38s;
    animation-fill-mode: forwards;
    animation-timing-function: ease-in;
}

/* Accesibilidad: sin animaciones si el usuario las tiene reducidas */
@media (prefers-reduced-motion: reduce) {
    #dsb-popup.dsb-animate,
    #dsb-popup.dsb-animate-out {
        animation: none !important;
    }
}

/* Inner layout */
.dsb-popup-inner {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 38px 20px 20px;
}
.dsb-popup-img-link {
    flex-shrink: 0;
    line-height: 0;
}
.dsb-popup-img {
    width: 75px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}
.dsb-popup-body {
    flex: 1;
    min-width: 0;
}
.dsb-popup-title {
    display: block;
    font-size: 0.95em;
    font-weight: 500;
    line-height: 1.4;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
}
.dsb-popup-title a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.dsb-popup-title a:hover {
    text-decoration: none;
}
.dsb-popup-price {
    display: block;
    font-size: 0.88em;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 2px;
    color: inherit;
}
.dsb-popup-meta {
    display: block;
    font-size: 0.82em;
    color: #777;
    line-height: 1.4;
    margin: 0 0 6px;
}
.dsb-popup-link {
    display: inline-block;
    font-size: 0.82em;
    font-weight: 500;
    color: inherit;
    text-decoration: none;
    line-height: 1.4;
}
.dsb-popup-link:hover {
    text-decoration: underline;
}

/* Botón cerrar */
.dsb-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8em;
    color: #999;
    line-height: 1;
    padding: 6px;
    pointer-events: auto;
}
.dsb-popup-close:hover {
    color: #333;
}

/* Placeholder de widgets en el editor (función desactivada / sin datos) */
.dsb-widget-disabled {
    border: 1.5px dashed #ccc;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
    color: #888;
    text-align: center;
}

/* Mobile */
@media (max-width: 600px) {
    #dsb-popup.dsb-hide-mobile {
        display: none !important;
    }
    #dsb-popup {
        bottom: 10px;
        max-width: calc(100vw - 20px);
    }
    #dsb-popup.dsb-pos-left  { left: 10px; }
    #dsb-popup.dsb-pos-right { right: 10px; }
}
