/* ═══════════════════════════════════════════════════════════════
   Waggly Price Comparison — Frontend Styles v3.0
   ═══════════════════════════════════════════════════════════════ */

/* ── Wrapper ── */
.wspc-wrapper {
    margin: 30px 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    font-family: inherit;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ── Header bar ── */
.wspc-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    padding: 14px 20px;
}
.wspc-header h2 {
    color: #fff;
    font-size: 1.1em;
    margin: 0;
    font-weight: 600;
}
.wspc-icon { margin-right: 6px; }

/* ── Table ── */
.wspc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}
.wspc-table thead th {
    background: #f8fafc;
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}
.wspc-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.wspc-table tbody tr:hover {
    background: #f8fafc;
}
.wspc-table tbody tr:last-child {
    border-bottom: none;
}
.wspc-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

/* Cheapest row */
.wspc-row-cheapest {
    background: #f0fdf4 !important;
    border-left: 3px solid #22c55e;
}
.wspc-row-cheapest:hover {
    background: #e8fbe8 !important;
}

/* ── Retailer cell ── */
.wspc-td-retailer {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
}
.wspc-r-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.wspc-r-name {
    font-weight: 600;
    color: #1e293b;
}

/* ── Badges ── */
.wspc-badge-best {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #22c55e;
    color: #fff;
    margin-left: 6px;
    vertical-align: middle;
}
.wspc-badge-discount {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 700;
    background: #ef4444;
    color: #fff;
    margin-left: 4px;
}

/* ── Price cell ── */
.wspc-price {
    font-size: 1.15em;
    font-weight: 700;
    color: #1e293b;
}
.wspc-price-best {
    color: #16a34a;
}
.wspc-rrp {
    font-size: 0.85em;
    color: #94a3b8;
    margin-left: 4px;
}
.wspc-more {
    font-size: 0.8em;
    color: #ef4444;
    margin-left: 6px;
}

/* ── Stock cell ── */
.wspc-stock-in {
    color: #16a34a;
    font-weight: 500;
    font-size: 0.9em;
}
.wspc-stock-out {
    color: #ef4444;
    font-weight: 500;
    font-size: 0.9em;
}

/* ── Buy button ── */
.wspc-btn-buy {
    display: inline-block;
    padding: 8px 20px;
    background: #1e3a5f;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.15s;
    white-space: nowrap;
}
.wspc-btn-buy:hover {
    background: #15294a;
    color: #fff !important;
}
.wspc-btn-best {
    background: #16a34a;
}
.wspc-btn-best:hover {
    background: #15803d;
}

/* ── Footer ── */
.wspc-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
.wspc-meta {
    font-size: 0.8em;
    color: #64748b;
    margin: 0 0 2px 0;
}
.wspc-disclaimer {
    font-size: 0.75em;
    color: #94a3b8;
    margin: 0;
    font-style: italic;
}

/* ── Sidebar price override ── */
.wspc-sidebar-price {
    font-size: 1.2em;
    font-weight: 700;
    color: #1e293b;
}
.wspc-archive-price {
    font-weight: 600;
}

/* ── Chart ── */
.wspc-chart-wrapper {
    padding: 16px 20px 20px;
    border-top: 1px solid #e2e8f0;
}
.wspc-chart-wrapper h3 {
    font-size: 1em;
    margin: 0 0 12px 0;
    color: #1e293b;
}
.wspc-chart-wrapper canvas {
    max-height: 250px;
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .wspc-table thead {
        display: none;
    }
    .wspc-table,
    .wspc-table tbody,
    .wspc-table tr,
    .wspc-table td {
        display: block;
        width: 100%;
    }
    .wspc-table tr {
        padding: 12px 14px;
        border-bottom: 1px solid #f1f5f9;
    }
    .wspc-td-retailer {
        margin-bottom: 6px;
    }
    .wspc-td-price {
        margin-bottom: 6px;
    }
    .wspc-td-stock {
        margin-bottom: 8px;
        font-size: 0.85em;
    }
    .wspc-td-action {
        display: block;
    }
    .wspc-btn-buy {
        display: block;
        text-align: center;
        padding: 10px;
    }
}
