/* Estilos para mensajes de stock y reposición */

/* Badges de stock mejorados */
.stock-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.5rem 0;
    white-space: nowrap;
    text-align: center;
}

.stock-badge-disponible {
    background: transparent;
    color: #059669;
    border: none;
}

.stock-badge-muy-poco {
    background: transparent;
    color: #d97706;
    border: none;
    animation: pulseWarning 3s ease-in-out infinite;
}

.stock-badge-ultimo {
    background: transparent;
    color: #dc2626;
    border: none;
    animation: pulseUrgent 4s ease-in-out infinite;
}

.stock-badge-agotado {
    background: transparent;
    color: #6b7280;
    border: none;
}

/* Animaciones de alerta MUY suaves */
@keyframes pulseWarning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.15);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0);
    }
}

@keyframes pulseUrgent {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.12);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0);
        transform: scale(1.01);
    }
}

/* Botón de reposición */
.btn-reposicion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    background: linear-gradient(135deg, #ffb74d 0%, #ff9800 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-reposicion:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.3);
}

.btn-reposicion:active {
    transform: translateY(0);
}

/* Modal de reposición */
#modal-reposicion {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    padding: 1rem;
}

#modal-reposicion.active {
    display: flex;
}

.modal-reposicion-content {
    background: white;
    border-radius: 24px;
    max-width: 440px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scroll personalizado */
.modal-reposicion-content::-webkit-scrollbar {
    width: 8px;
}

.modal-reposicion-content::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 10px;
}

.modal-reposicion-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.modal-reposicion-content::-webkit-scrollbar-thumb:hover {
    background: #a78bfa;
}

.modal-reposicion-header {
    background: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
    padding: 2rem 1.5rem 1.75rem;
    text-align: center;
    color: white;
    border-radius: 24px 24px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
    position: relative;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: bellRing 2s ease-in-out infinite;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
}

.modal-reposicion-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal-reposicion-close svg {
    width: 20px;
    height: 20px;
}

.modal-reposicion-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1) rotate(90deg);
}

.modal-reposicion-close:active {
    transform: scale(0.95);
}

.modal-reposicion-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-reposicion-header p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
    font-weight: 400;
}

.modal-reposicion-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Scroll personalizado para el body */
.modal-reposicion-body::-webkit-scrollbar {
    width: 6px;
}

.modal-reposicion-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-reposicion-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.modal-reposicion-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.producto-info-reposicion {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 14px;
    margin-bottom: 1.5rem;
    border: 2px solid #fbbf24;
}

.producto-info-reposicion img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.producto-info-reposicion-text h3 {
    font-size: 0.975rem;
    color: #1f2937;
    margin-bottom: 0.3rem;
    line-height: 1.3;
    font-weight: 600;
}

.producto-info-reposicion-text p {
    font-size: 1.15rem;
    color: #ea580c;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 1;
}

.input-with-icon input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #f9fafb;
}

.input-with-icon input:focus {
    outline: none;
    border-color: #ec4899;
    background: white;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.input-with-icon input::placeholder {
    color: #9ca3af;
}

.form-reposicion {
    display: flex;
    flex-direction: column;
    gap: 0rem;
}

/* Inputs de cantidad y mensaje sin icono */
#reposicion-cantidad,
#reposicion-mensaje {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #f9fafb;
    font-family: inherit;
}

#reposicion-cantidad:focus,
#reposicion-mensaje:focus {
    outline: none;
    border-color: #ec4899;
    background: white;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

#reposicion-cantidad::placeholder,
#reposicion-mensaje::placeholder {
    color: #9ca3af;
}

/* Textarea con mejor altura */
#reposicion-mensaje {
    min-height: 80px;
    max-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.form-reposicion-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-reposicion-enviar {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3);
    margin-top: 1.5rem;
}

.btn-icon {
    font-size: 1.2rem;
    animation: bellRing 2s ease-in-out infinite;
}

.btn-reposicion-enviar:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.4);
}

.btn-reposicion-enviar:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.btn-reposicion-cancelar {
    flex: 0 0 auto;
    padding: 0.9rem 1.2rem;
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reposicion-cancelar:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Info adicional */
.info-privacidad {
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 1.25rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid #e5e7eb;
}

.privacy-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #10b981;
}

/* Actualizar tarjetas de producto */
.producto-card .producto-stock {
    margin: 0.5rem 0;
}

.producto-card .producto-stock.bajo {
    animation: none;
}

/* Responsive */
@media (max-width: 500px) {
    .modal-reposicion-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-reposicion-header p {
        font-size: 0.95rem;
    }
    
    .modal-reposicion-body {
        padding: 1.5rem;
    }
    
    .producto-info-reposicion {
        flex-direction: column;
        text-align: center;
    }
    
    .form-reposicion-actions {
        flex-direction: column-reverse;
    }
    
    .btn-reposicion-cancelar {
        padding: 1rem;
    }
}
