/*
 * stock-urgency.css
 * Shared styles for "low stock" and "very low stock" urgency badges.
 * Used across product cards and the product detail page.
 */

/* ── Card-level stock strip (sits just above the Shop Now button) ── */
.su-strip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.3;
}

/* Very low (≤ 5) — red + pulse */
.su-strip.su-critical {
    color: #dc2626;
}

.su-strip.su-critical .su-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #dc2626;
    flex-shrink: 0;
    animation: suPulse 1.4s ease-in-out infinite;
}

@keyframes suPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
    50%       { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
}

/* Low (6-15) — amber, no animation */
.su-strip.su-low {
    color: #b45309;
}

.su-strip.su-low .su-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
    flex-shrink: 0;
}

/* ── Product detail page inline urgency (larger) ── */
.su-detail {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    margin-top: 4px;
}

.su-detail.su-critical {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    animation: suDetailShake 3s ease-in-out infinite;
}

@keyframes suDetailShake {
    0%, 90%, 100% { transform: translateX(0); }
    92%           { transform: translateX(-3px); }
    94%           { transform: translateX(3px); }
    96%           { transform: translateX(-2px); }
    98%           { transform: translateX(2px); }
}

.su-detail.su-low {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.su-detail .su-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.su-detail.su-critical .su-dot {
    background: #dc2626;
    animation: suPulse 1.4s ease-in-out infinite;
}

.su-detail.su-low .su-dot {
    background: #f59e0b;
}

/* ── Progress bar (product detail page) ── */
.su-bar-wrap {
    margin-top: 8px;
}

.su-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: #64748b;
    margin-bottom: 5px;
    font-weight: 600;
}

.su-bar {
    height: 5px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.su-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s ease;
}

.su-bar-fill.su-fill-critical {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.su-bar-fill.su-fill-low {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.su-bar-fill.su-fill-ok {
    background: linear-gradient(90deg, #34d399, #059669);
}
