/**
 * WC Buy Now Button — front-end stylesheet
 * Plugin: wc-buy-now-button
 * Inline styles (colours, sizes) are applied via PHP; this sheet handles
 * structure, transitions, and utility classes only.
 */

/* =========================================================
   Button base
   ========================================================= */
.wcbn-buy-now-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    transition: background-color 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
    box-sizing: border-box;
    position: relative;
    white-space: nowrap;
    margin-top: 8px;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
    border-style: solid;
}

.wcbn-buy-now-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.wcbn-buy-now-btn:active {
    transform: translateY(0);
}

.wcbn-buy-now-btn:focus {
    outline: 3px solid rgba(44, 111, 173, 0.4);
    outline-offset: 2px;
}

/* =========================================================
   Loading / disabled state
   ========================================================= */
.wcbn-buy-now-btn.wcbn-loading {
    opacity: 0.75;
    cursor: not-allowed;
    pointer-events: none;
}

.wcbn-buy-now-btn.wcbn-loading .wcbn-btn-text {
    opacity: 0.7;
}

/* =========================================================
   Spinner
   ========================================================= */
.wcbn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wcbn-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes wcbn-spin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   Archive / loop wrapper
   ========================================================= */
.wcbn-loop-button {
    display: block;
    margin-top: 6px;
    text-align: center;
}

.wcbn-loop-button .wcbn-buy-now-btn {
    width: 100%;
    justify-content: center;
}

/* =========================================================
   Single product page
   ========================================================= */
.wcbn-single-product {
    margin-left: 8px;
}

/* =========================================================
   Error notice (injected by JS)
   ========================================================= */
.wcbn-error-notice {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #f87171;
    border-radius: 4px;
    color: #b91c1c;
    font-size: 0.9em;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 600px) {
    .wcbn-single-product {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
}
