/* BARRA DE PROGRESO ENVÍO GRATIS */
.fspb-container {
    display: block !important;
    visibility: visible !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 10px 12px 8px 12px !important;
    margin: 10px auto !important;
    max-width: 100% !important;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 14%) !important;
    font-family: 'Google Sans Flex';
}

.fspb-message {
    color: #4b5563 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-align: center !important;
    margin-bottom: 19px !important;
    line-height: 1.3 !important;
}

.fspb-progress-wrapper {
    position: relative !important;
    width: 100% !important;
    padding-top: 20px !important;
    padding-bottom: 0 !important;
}

.fspb-progress-bar {
    position: relative !important;
    width: 96% !important;
    height: 16px !important;
    background: #e3e3e3 !important;
    border-radius: 8px !important;
    overflow: visible !important;
    box-shadow: inset 0 1px 2px rgb(0 0 0 / 42%) !important;
    margin-bottom: 0 !important;
}

/* ANIMACIONES PROGRESIVAS - Amarillo a Verde */
.fspb-progress-fill {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    min-width: 0 !important;
    background: linear-gradient(90deg, 
        #fbbf24 0%, 
        #f59e0b 20%, 
        #eab308 40%,
        #84cc16 60%,
        #22c55e 80%,
        #10b981 100%) !important;
    background-size: 300% 100% !important;
    border-radius: 8px !important;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 0 10px rgb(36, 251, 240) !important;
    will-change: background-position, box-shadow !important;
    -webkit-animation: fspb-gradient-move 4s linear infinite, fspb-glow-yellow 2s ease-in-out infinite !important;
    animation: fspb-gradient-move 4s linear infinite, fspb-glow-yellow 2s ease-in-out infinite !important;
    overflow: hidden !important;
}

@-webkit-keyframes fspb-gradient-move {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@keyframes fspb-gradient-move {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@-webkit-keyframes fspb-glow-yellow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(251, 191, 36, 0.5) !important;
    }
    50% { 
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 0 30px rgba(251, 191, 36, 0.4) !important;
    }
}

@keyframes fspb-glow-yellow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(251, 191, 36, 0.5) !important;
    }
    50% { 
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 0 30px rgba(251, 191, 36, 0.4) !important;
    }
}

.fspb-progress-shine {
    position: absolute !important;
    top: 0 !important;
    left: -50% !important;
    width: 50% !important;
    height: 100% !important;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 255, 255, 0) 100%) !important;
    transform: skewX(-25deg) !important;
    will-change: left !important;
    -webkit-animation: fspb-shine 2.5s ease-in-out infinite !important;
    animation: fspb-shine 2.5s ease-in-out infinite !important;
}

@-webkit-keyframes fspb-shine {
    0% { left: -50%; }
    100% { left: 150%; }
}

@keyframes fspb-shine {
    0% { left: -50%; }
    100% { left: 150%; }
}

/* ANIMACIÓN DE BARRAS DIAGONALES EN PROGRESO */
.fspb-in-progress .fspb-progress-fill::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    ) !important;
    background-size: 28px 28px !important;
    border-radius: 8px !important;
    -webkit-animation: fspb-stripes 1s linear infinite !important;
    animation: fspb-stripes 1s linear infinite !important;
}

@-webkit-keyframes fspb-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 28px 0; }
}

@keyframes fspb-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 28px 0; }
}

.fspb-milestones {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 96% !important;
    height: 0 !important;
}

.fspb-milestone {
    position: absolute !important;
    top: -20px !important;
    transform: translateX(-50%) !important;
    z-index: 10 !important;
}

.fspb-milestone-domicilio {
    transform: translateX(-100%) !important;
}

.fspb-milestone-marker {
    width: 2px !important;
    height: 36px !important;
    background: #d1d5db !important;
    margin: 7px auto !important;
    border-radius: 1px !important;
    position: relative !important;
    transition: background 0.3s ease !important;
}

.fspb-milestone-marker::before {
    content: '' !important;
    position: absolute !important;
    bottom: -9px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 8px !important;
    height: 8px !important;
    background: #d1d5db !important;
    border-radius: 50% !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
}

/* MARCADOR DE SUCURSAL VERDE cuando se alcanza el objetivo */
.fspb-container.fspb-sucursal-reached .fspb-milestone.fspb-milestone-sucursal .fspb-milestone-marker,
.fspb-container.fspb-complete .fspb-milestone.fspb-milestone-sucursal .fspb-milestone-marker {
    background: #10b981 !important;
}

.fspb-container.fspb-sucursal-reached .fspb-milestone.fspb-milestone-sucursal .fspb-milestone-marker::before,
.fspb-container.fspb-complete .fspb-milestone.fspb-milestone-sucursal .fspb-milestone-marker::before {
    background: #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6), 0 1px 3px rgba(0, 0, 0, 0.15) !important;
    -webkit-animation: fspb-pulse-green 2s ease-in-out infinite !important;
    animation: fspb-pulse-green 2s ease-in-out infinite !important;
}

/* MARCADOR DE DOMICILIO VERDE cuando se alcanza el objetivo */
.fspb-container.fspb-complete .fspb-milestone.fspb-milestone-domicilio .fspb-milestone-marker {
    background: #10b981 !important;
}

.fspb-container.fspb-complete .fspb-milestone.fspb-milestone-domicilio .fspb-milestone-marker::before {
    background: #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6), 0 1px 3px rgba(0, 0, 0, 0.15) !important;
    -webkit-animation: fspb-pulse-green 2s ease-in-out infinite !important;
    animation: fspb-pulse-green 2s ease-in-out infinite !important;
}

/* Animación de pulso para los marcadores verdes */
@-webkit-keyframes fspb-pulse-green {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.4), 0 1px 3px rgba(0, 0, 0, 0.15) !important;
    }
    50% { 
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8), 0 0 30px rgba(16, 185, 129, 0.4), 0 1px 3px rgba(0, 0, 0, 0.15) !important;
    }
}

@keyframes fspb-pulse-green {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.4), 0 1px 3px rgba(0, 0, 0, 0.15) !important;
    }
    50% { 
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8), 0 0 30px rgba(16, 185, 129, 0.4), 0 1px 3px rgba(0, 0, 0, 0.15) !important;
    }
}

.fspb-milestone-label {
    position: absolute !important;
    top: 2px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #ffffff;
    border: 1px solid #e5e7eb !important;
    color: #cfcfcf !important;
    padding: 2px 2px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    text-align: center !important;
    line-height: 1.2 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: color 0.3s ease, border-color 0.3s ease !important;
}

/* Etiquetas verdes cuando se alcanzan los objetivos - MÁXIMA ESPECIFICIDAD */
div.fspb-container.fspb-sucursal-reached .fspb-milestones .fspb-milestone.fspb-milestone-sucursal .fspb-milestone-label,
div.fspb-container.fspb-complete .fspb-milestones .fspb-milestone.fspb-milestone-sucursal .fspb-milestone-label {
    color: #ffffff !important;
    border-color: #585858 !important;
    background: #4faf2b
}

div.fspb-container.fspb-complete .fspb-milestones .fspb-milestone.fspb-milestone-domicilio .fspb-milestone-label {
    color: #ffffff !important;
    border-color: #585858 !important;
    background: #4faf2b !important;
}

.fspb-milestone-label strong {
    color: #374151 !important;
    font-weight: 700 !important;
    font-size: 10px !important;
    transition: color 0.3s ease !important;
}

div.fspb-container.fspb-sucursal-reached .fspb-milestones .fspb-milestone.fspb-milestone-sucursal .fspb-milestone-label strong,
div.fspb-container.fspb-complete .fspb-milestones .fspb-milestone.fspb-milestone-sucursal .fspb-milestone-label strong,
div.fspb-container.fspb-complete .fspb-milestones .fspb-milestone.fspb-milestone-domicilio .fspb-milestone-label strong {
    color: #ffffff !important;
    border-color: #585858 !important;
    background: #4faf2b
}

.fspb-progress-text {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 6px !important;
    padding-top: 6px !important;
    border-top: 1px solid #f3f4f6 !important;
    color: #9ca3af !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

.fspb-current {
    color: #464646 !important;
    font-weight: 600 !important;
}

.fspb-total {
    color: #9ca3af !important;
}

/* ESTADOS - Cuando alcanza sucursal (más verde) */
.fspb-sucursal-reached .fspb-progress-fill {
    background: linear-gradient(90deg, 
        #84cc16 0%, 
        #65a30d 20%, 
        #22c55e 40%,
        #16a34a 60%,
        #10b981 80%,
        #059669 100%) !important;
    background-size: 300% 100% !important;
    -webkit-animation: fspb-gradient-move 4s linear infinite, fspb-glow-green 2s ease-in-out infinite !important;
    animation: fspb-gradient-move 4s linear infinite, fspb-glow-green 2s ease-in-out infinite !important;
}

/* Animación de barras para estado sucursal alcanzada */
.fspb-sucursal-reached .fspb-progress-fill::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.15) 10px,
        rgba(255, 255, 255, 0.15) 20px
    ) !important;
    background-size: 28px 28px !important;
    border-radius: 8px !important;
    -webkit-animation: fspb-stripes 1s linear infinite !important;
    animation: fspb-stripes 1s linear infinite !important;
}

@-webkit-keyframes fspb-glow-green {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.5) !important;
    }
    50% { 
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8), 0 0 30px rgba(16, 185, 129, 0.4) !important;
    }
}

@keyframes fspb-glow-green {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.5) !important;
    }
    50% { 
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8), 0 0 30px rgba(16, 185, 129, 0.4) !important;
    }
}

.fspb-sucursal-reached .fspb-current {
    color: #059669 !important;
}

/* ESTADOS MORADO - Completado con animación especial MÁS VISIBLE */
.fspb-complete .fspb-progress-fill {
    background: linear-gradient(90deg, 
        #6d28d9 0%, 
        #7c3aed 20%, 
        #8b5cf6 40%,
        #a78bfa 60%,
        #c4b5fd 80%,
        #ddd6fe 100%) !important;
    background-size: 300% 100% !important;
    -webkit-animation: fspb-gradient-move 3s linear infinite, fspb-glow-purple-intense 2s ease-in-out infinite !important;
    animation: fspb-gradient-move 3s linear infinite, fspb-glow-purple-intense 2s ease-in-out infinite !important;
}

/* Sin barras diagonales cuando está completo */
.fspb-complete .fspb-progress-fill::after {
    display: none !important;
}

@-webkit-keyframes fspb-glow-purple-intense {
    0% { 
        box-shadow: 0 0 0px rgba(124, 58, 237, 0), 0 0 0px rgba(124, 58, 237, 0) !important;
        filter: brightness(0.85) saturate(0.9);
    }
    50% { 
        box-shadow: 0 0 35px rgba(124, 58, 237, 1), 0 0 50px rgba(124, 58, 237, 1), 0 0 70px rgba(124, 58, 237, 1) !important;
        filter: brightness(1.3) saturate(1.2);
    }
    100% { 
        box-shadow: 0 0 0px rgba(124, 58, 237, 0), 0 0 0px rgba(124, 58, 237, 0) !important;
        filter: brightness(0.85) saturate(0.9);
    }
}

@keyframes fspb-glow-purple-intense {
    0% { 
        box-shadow: 0 0 0px rgba(124, 58, 237, 0), 0 0 0px rgba(124, 58, 237, 0) !important;
        filter: brightness(0.85) saturate(0.9);
    }
    50% { 
        box-shadow: 0 0 35px rgba(124, 58, 237, 1), 0 0 50px rgba(124, 58, 237, 1), 0 0 70px rgba(124, 58, 237, 1) !important;
        filter: brightness(1.3) saturate(1.2);
    }
    100% { 
        box-shadow: 0 0 0px rgba(124, 58, 237, 0), 0 0 0px rgba(124, 58, 237, 0) !important;
        filter: brightness(0.85) saturate(0.9);
    }
}

.fspb-complete .fspb-current {
    color: #7c3aed !important;
}

.fspb-complete .fspb-message {
    color: #7c3aed !important;
    font-weight: 600 !important;
}

/* ESTADO DE PRODUCTOS NO VÁLIDOS */
.fspb-disabled {
    opacity: 0.6 !important;
}

.fspb-disabled .fspb-progress-fill {
    background: #d1d5db !important;
    animation: none !important;
    box-shadow: none !important;
}

.fspb-disabled .fspb-progress-fill::after {
    display: none !important;
}

.fspb-disabled .fspb-message {
    color: #ef4444 !important;
    font-weight: 600 !important;
}

.fspb-disabled .fspb-progress-shine {
    display: none !important;
}

/* ESTADO DE CARRITO VACÍO - Misma estética que disabled pero con mensaje informativo */
.fspb-empty {
    opacity: 0.7 !important;
}

.fspb-empty .fspb-progress-fill {
    background: #e5e7eb !important;
    animation: none !important;
    box-shadow: none !important;
}

.fspb-empty .fspb-progress-fill::after {
    display: none !important;
}

.fspb-empty .fspb-message {
    color: #6b7280 !important;
    font-weight: 500 !important;
}

.fspb-empty .fspb-progress-shine {
    display: none !important;
}

/* Marcadores con estilo suave para carrito vacío */
.fspb-empty .fspb-milestone-marker {
    background: #d1d5db !important;
    opacity: 0.5 !important;
}

.fspb-empty .fspb-milestone-marker::before {
    background: #d1d5db !important;
    opacity: 0.5 !important;
}

.fspb-empty .fspb-milestone-label {
    opacity: 0.6 !important;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .fspb-container { padding: 8px 10px 6px 10px !important; }
    .fspb-message { font-size: 12px !important; }
    .fspb-progress-wrapper { padding-top: 18px !important; }
    .fspb-progress-bar { height: 14px !important; }
    .fspb-milestone { top: -18px !important; }
    .fspb-milestone-marker { height: 32px !important; }
    .fspb-milestone-label { font-size: 9px !important; padding: 2px 5px !important; }
    .fspb-milestone-label strong { font-size: 9px !important; }
    .fspb-progress-text { font-size: 11px !important; }
}

@media (max-width: 480px) {
    .fspb-progress-text {
        align-items: flex-start;
    }
}

/* ESTILOS ESPECÍFICOS POR UBICACIÓN */

/* Mini cart */
.widget_shopping_cart .fspb-container {
    margin: 10px 0 15px;
}

/* Checkout - Compatible con Fluid Checkout */
.woocommerce-checkout .fspb-container {
    margin-bottom: 25px;
}

/* Página de producto */
.single-product .fspb-container {
    margin-top: 20px;
}

/* Cart page */
.woocommerce-cart .fspb-container {
    margin-bottom: 20px;
}