/* =========================================
   ShastaRobux stock on the website (inc/stock.php, assets/stock.js)
   Stock badges, restock countdowns and the Robux page's stock panel
   ========================================= */

.srx-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.6rem;
    border: 1px solid;
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.srx-stock::before {
    content: "";
    flex: none;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: currentColor;
}

/* Near-solid backgrounds so the badges stay readable on light product images */
.srx-stock--in {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(12, 38, 24, 0.94);
    color: #4ade80;
}

.srx-stock--low {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(48, 30, 6, 0.94);
    color: #fbbf24;
}

.srx-stock--low::before {
    animation: srx-stock-pulse 1.4s ease-in-out infinite;
}

.srx-stock--out {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(52, 14, 14, 0.94);
    color: #f87171;
}

@keyframes srx-stock-pulse {
    50% {
        opacity: 0.35;
    }
}

/* ---------- Restock countdown ---------- */
.srx-restock {
    font-family: 'Montserrat', sans-serif;
    color: #fff;
}

.srx-restock:not(.has-days) .srx-restock-days {
    display: none;
}

.srx-restock .srx-restock-label {
    margin: 0 0 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
}

.srx-restock-time {
    display: flex;
    gap: 0.5rem;
}

.srx-restock-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3.6rem;
    padding: 0.6rem 0.5rem;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 0.8rem;
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(168, 85, 247, 0.18), transparent 60%),
        rgba(13, 17, 23, 0.85);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.srx-restock-unit b {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.srx-restock-unit small {
    margin-top: 0.3rem;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
}

.srx-restock .srx-restock-done {
    display: none;
    margin: 0.6rem 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #c084fc;
}

.srx-restock.is-done .srx-restock-time {
    opacity: 0.4;
}

.srx-restock.is-done .srx-restock-done {
    display: block;
}

/* Small version for product cards */
.srx-restock--compact {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.6rem;
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 999px;
    background: rgba(17, 12, 30, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    color: #e9d5ff;
}

.srx-restock--compact .srx-restock-label {
    margin: 0;
    font-size: inherit;
    letter-spacing: 0;
    text-transform: none;
    color: #c084fc;
}

.srx-restock--compact .srx-restock-time {
    display: inline;
    font-variant-numeric: tabular-nums;
}

.srx-restock--compact b {
    font-weight: 700;
}

.srx-restock--compact .srx-restock-done {
    margin: 0;
    font-size: inherit;
}

.srx-restock--compact.is-done .srx-restock-time,
.srx-restock--compact.is-done .srx-restock-label {
    display: none;
}

.srx-restock--compact.is-done .srx-restock-done {
    display: inline;
}

/* ---------- Robux page: stock panel ---------- */
.srx-robux-stock {
    --srx-stock-rgb: 34, 197, 94;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.1rem 1.35rem;
    border: 1px solid rgba(var(--srx-stock-rgb), 0.35);
    border-radius: 1rem;
    background:
        radial-gradient(120% 160% at 0% 0%, rgba(var(--srx-stock-rgb), 0.14), transparent 55%),
        rgba(13, 17, 23, 0.8);
    font-family: 'Montserrat', sans-serif;
}

.srx-robux-stock--low {
    --srx-stock-rgb: 245, 158, 11;
}

.srx-robux-stock--out {
    --srx-stock-rgb: 239, 68, 68;
}

.srx-robux-stock-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
}

.srx-robux-stock-amount {
    font-size: 0.95rem;
    font-weight: 600;
    color: #9ca3af;
}

.srx-robux-stock-amount b {
    margin-right: 0.25rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.srx-robux-stock .srx-robux-stock-note {
    margin: 0;
    font-size: 0.85rem;
    color: #d1d5db;
}

#custom-add-to-cart-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    filter: grayscale(0.6);
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .srx-stock--low::before {
        animation: none;
    }
}
