/**
 * Modern Shop Theme — product button utilities
 * ------------------------------------------------------------------
 * Extra button variants used on product cards / detail pages /
 * cart rows. Kept separate so plugin authors can load just the
 * button system without pulling the whole stylesheet.
 * ------------------------------------------------------------------
 */

/* Primary pill button (large, full-width on mobile) */
.btn-product-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--primary-gradient);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    border: none;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: var(--transition);
    flex: 1;
    min-width: 140px;
}
.btn-product-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(255, 46, 99, 0.35);
}
.btn-product-primary:active { transform: translateY(0); }
.btn-product-primary:disabled,
.btn-product-primary.is-loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Secondary outline button */
.btn-product-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--input-bg);
    color: var(--text-strong);
    padding: 12px 22px;
    border-radius: 30px;
    border: 1px solid var(--input-border);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-product-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Compact icon-only add button (cart row, wishlist) */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-strong);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1rem;
}
.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-icon.btn-icon-wishlist.is-active {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

/* Loading spinner shown in .btn-product-primary while adding */
.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
    display: inline-block;
}
@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* "Added!" success flash */
.added-flash {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #10B981;
    color: #fff;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    opacity: 0;
    transform: translateY(-6px);
    transition: var(--transition);
    pointer-events: none;
    z-index: 3;
}
.added-flash.show {
    opacity: 1;
    transform: translateY(0);
}

/* Quantity stepper used on cart rows */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    overflow: hidden;
}
.qty-stepper button {
    width: 32px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-strong);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}
.qty-stepper button:hover { background: rgba(255, 46, 99, 0.08); color: var(--primary); }
.qty-stepper input {
    width: 44px;
    height: 36px;
    border: none;
    background: transparent;
    text-align: center;
    color: var(--text-strong);
    font: inherit;
    font-weight: 700;
}

/* Make sure product card buttons in grid don't overflow */
.product-card .btn-add-cart { flex-shrink: 0; }
.product-card .btn-product-primary { width: 100%; }

/* Dark mode adjustments for product buttons */
body.dark-mode .btn-product-secondary,
body.dark-mode .btn-icon {
    background: var(--input-bg);
    color: var(--text-white);
    border-color: var(--card-border);
}
body.dark-mode .qty-stepper input { color: var(--text-white); }
