/**
 * vBuy Product Styles
 *
 * Styles for product management (WCFM), CSV upload, compare sellers,
 * product cards, and consumer product display.
 *
 * @package VBuy
 */

/* ──────────────────────────────────────────
 * Reward Badge — Product Cards (Shop/Category)
 * ────────────────────────────────────────── */

.vbuy-reward-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vbuy-reward-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}

.vbuy-reward-icon {
    font-weight: 800;
    font-size: 11px;
    opacity: 0.85;
}

/* ──────────────────────────────────────────
 * Reward Info — Product Detail Page
 * ────────────────────────────────────────── */

.vbuy-reward-detail {
    margin: 16px 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.vbuy-reward-earn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #34d399;
    margin-bottom: 6px;
}

.vbuy-reward-icon-lg {
    font-weight: 800;
    font-size: 18px;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vbuy-reward-effective {
    font-size: 14px;
    color: #94a3b8;
}

.vbuy-effective-price {
    font-weight: 700;
    color: #e2e8f0;
    margin-left: 4px;
}

.vbuy-reward-teaser {
    margin: 16px 0;
    padding: 14px 18px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    color: #94a3b8;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vbuy-featured-badge {
    margin: 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #fbbf24;
}

/* ──────────────────────────────────────────
 * Compare Sellers
 * ────────────────────────────────────────── */

.vbuy-compare-sellers {
    margin: 32px 0;
    padding: 24px;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.vbuy-compare-sellers h3 {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 700;
    color: #e2e8f0;
}

.vbuy-sellers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.vbuy-seller-card {
    position: relative;
    padding: 20px;
    background: #1a1f2e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vbuy-seller-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.vbuy-seller-featured {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.04));
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2);
}

.vbuy-seller-name {
    margin: 8px 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: #e2e8f0;
}

.vbuy-seller-price,
.vbuy-seller-reward,
.vbuy-seller-net,
.vbuy-seller-rating,
.vbuy-seller-stock {
    margin: 6px 0;
    font-size: 14px;
    color: #94a3b8;
}

.vbuy-price-value {
    font-size: 20px;
    font-weight: 800;
    color: #f0f4f8;
}

.vbuy-price-was {
    text-decoration: line-through;
    color: #64748b;
    font-size: 14px;
}

.vbuy-reward-value {
    font-weight: 700;
    color: #34d399;
}

.vbuy-net-value {
    font-weight: 700;
    color: #e2e8f0;
}

.vbuy-in-stock {
    color: #34d399;
    font-weight: 600;
}

.vbuy-out-of-stock {
    color: #f87171;
    font-weight: 600;
}

/* Badges */
.vbuy-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
    margin-bottom: 4px;
}

.vbuy-badge-featured {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.vbuy-badge-price {
    background: rgba(99, 91, 255, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 91, 255, 0.25);
}

.vbuy-badge-reward {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.vbuy-badge-system {
    background: rgba(99, 91, 255, 0.12);
    color: #c4b5fd;
    border: 1px solid rgba(99, 91, 255, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

/* Buy button */
.vbuy-buy-btn {
    display: block;
    margin-top: 16px;
    padding: 10px 20px;
    text-align: center;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.vbuy-buy-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Compare link on product page */
.vbuy-compare-link {
    margin: 10px 0;
}

.vbuy-compare-link a {
    color: #00d4aa;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.vbuy-compare-link a:hover {
    color: #00b894;
    text-decoration: underline;
}

/* ──────────────────────────────────────────
 * WCFM Product Form — Custom Fields
 * ────────────────────────────────────────── */

.vbuy-barcode-section {
    margin: 16px 0;
    padding: 16px;
    background: #1a1f2e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.vbuy-barcode-status {
    display: inline-block;
    margin-left: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.vbuy-status-loading { color: #94a3b8; }
.vbuy-status-ok      { color: #34d399; }
.vbuy-status-error   { color: #f87171; }

.vbuy-field-notice {
    margin: 8px 0 0;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
    font-size: 12px;
    color: #fbbf24;
}

.vbuy-notice-info {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.vbuy-field-locked {
    background: #111827 !important;
    color: #64748b !important;
    cursor: not-allowed;
}

.vbuy-prepopulate {
    margin-top: 12px;
}

.vbuy-prepop-card {
    padding: 16px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 10px;
    animation: vbuy-slide-in 0.3s ease-out;
}

.vbuy-prepop-card h4 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #34d399;
}

.vbuy-prepop-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    float: right;
    margin-left: 12px;
}

.vbuy-prepop-sellers {
    font-size: 13px;
    color: #34d399;
    font-weight: 600;
}

.vbuy-prepop-info {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 8px;
}

.vbuy-reward-preview {
    margin-top: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
    border-radius: 8px;
    font-weight: 600;
    color: #059669;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vbuy-reward-range {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* ──────────────────────────────────────────
 * CSV Upload
 * ────────────────────────────────────────── */

.vbuy-csv-upload {
    max-width: 700px;
    margin: 24px auto;
}

.vbuy-dropzone {
    padding: 48px 32px;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #1a1f2e;
}

.vbuy-dropzone:hover,
.vbuy-dropzone-active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.06);
}

.vbuy-dropzone-label {
    font-size: 15px;
    color: #94a3b8;
    font-weight: 500;
}

.vbuy-dropzone-error {
    color: #f87171 !important;
}

.vbuy-csv-progress {
    margin: 16px 0;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.vbuy-csv-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.3s ease;
    text-align: center;
    font-size: 0;
    line-height: 8px;
}

.vbuy-csv-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0;
    padding: 16px;
    background: #1a1f2e;
    border-radius: 10px;
}

.vbuy-csv-stat {
    font-weight: 600;
    font-size: 14px;
}

.vbuy-stat-created { color: #34d399; }
.vbuy-stat-skipped { color: #fbbf24; }
.vbuy-stat-errors  { color: #f87171; }

.vbuy-csv-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

.vbuy-csv-detail-table th {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    text-align: left;
    font-weight: 700;
    color: #94a3b8;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.vbuy-csv-detail-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
}

.vbuy-csv-row-created  { background: rgba(16, 185, 129, 0.08); }
.vbuy-csv-row-published { background: rgba(59, 130, 246, 0.08); }
.vbuy-csv-row-skipped  { background: rgba(245, 158, 11, 0.08); }
.vbuy-csv-row-error    { background: rgba(239, 68, 68, 0.08); }

.vbuy-csv-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* ──────────────────────────────────────────
 * Variation Gallery
 * ────────────────────────────────────────── */

.vbuy-variation-gallery {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.vbuy-var-gallery-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease;
}

.vbuy-var-gallery-item img:hover {
    transform: scale(1.05);
}

/* ──────────────────────────────────────────
 * Animations
 * ────────────────────────────────────────── */

@keyframes vbuy-slide-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ──────────────────────────────────────────
 * Responsive
 * ────────────────────────────────────────── */

@media (max-width: 768px) {
    .vbuy-sellers-grid {
        grid-template-columns: 1fr;
    }

    .vbuy-compare-sellers {
        padding: 16px;
        margin: 16px 0;
    }

    .vbuy-csv-summary {
        flex-direction: column;
        gap: 8px;
    }

    .vbuy-csv-upload {
        margin: 16px;
    }

    .vbuy-dropzone {
        padding: 32px 16px;
    }
}
