/* FetchIt Decision Engine — frontend styles. Mobile-first, matches the
   FetchIt brand: black header/CTA text, green trust/success accents,
   yellow primary CTA buttons. */

:root {
	--sde-brand-black: #14161a;
	--sde-brand-green: #1f8a3b;
	--sde-brand-green-dark: #14602a;
	--sde-brand-yellow: #ffc60a;
	--sde-text: #1c1c1e;
	--sde-muted: #6b7280;
	--sde-border: #e5e7eb;
	--sde-bg-soft: #f7f8f9;
	--sde-danger: #d63638;
	--sde-radius: 10px;
}

.sde-container { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

.sde-btn {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 6px;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	border: none;
}
.sde-btn-cta { background: var(--sde-brand-yellow); color: var(--sde-brand-black); }
.sde-btn-cta:hover { background: #f0b900; color: var(--sde-brand-black); }
.sde-btn-lg { padding: 14px 26px; font-size: 16px; }
.sde-btn-outline { background: transparent; border: 1px solid var(--sde-border); color: var(--sde-text); width: 100%; margin-top: 10px; }
.sde-btn-disabled { background: var(--sde-border); color: var(--sde-muted); cursor: not-allowed; }

.sde-strike { text-decoration: line-through; color: var(--sde-muted); font-size: 13px; margin-left: 6px; }
.sde-save-pct { color: var(--sde-brand-green); font-weight: 600; font-size: 13px; }
.sde-disclaimer { font-size: 12px; color: var(--sde-muted); margin-top: 10px; }
.sde-empty { color: var(--sde-muted); padding: 20px 0; }

/* ---------- Deal score & recommendation badges ---------- */
.sde-deal-score, .sde-deal-score-pill, .sde-recommendation-pill {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
}
.sde-score-good { background: #e5f6ea; color: var(--sde-brand-green-dark); }
.sde-score-fair { background: #fff6df; color: #8a5a00; }
.sde-score-weak { background: #fdeaea; color: var(--sde-danger); }

.sde-recommendation-pill.sde-rec-buy_now { background: var(--sde-brand-green); color: #fff; }
.sde-recommendation-pill.sde-rec-wait_for_better_price { background: #fff6df; color: #8a5a00; }
.sde-recommendation-pill.sde-rec-compare_other_retailers { background: #e8eefc; color: #1d4ed8; }
.sde-recommendation-pill.sde-rec-avoid_this_deal { background: #fdeaea; color: var(--sde-danger); }
.sde-recommendation-pill.sde-rec-out_of_stock { background: var(--sde-border); color: var(--sde-muted); }

.sde-badge-best {
	display: inline-block; background: var(--sde-brand-green); color: #fff;
	font-size: 10px; font-weight: 700; text-transform: uppercase;
	padding: 2px 8px; border-radius: 4px; margin-bottom: 6px;
}

/* ---------- Comparison table ---------- */
.sde-comparison-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--sde-border); border-radius: var(--sde-radius); overflow: hidden; }
.sde-comparison-table thead th {
	background: var(--sde-brand-black); color: #fff; text-align: left;
	font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
	padding: 12px 14px;
}
.sde-comparison-table td { padding: 14px; border-top: 1px solid var(--sde-border); vertical-align: top; font-size: 14px; }
.sde-retailer-row.sde-best-deal { background: #f3fbf5; }
.sde-cell-retailer { min-width: 140px; }
.sde-retailer-logo { max-height: 22px; display: block; margin-bottom: 4px; }
.sde-retailer-name { font-weight: 600; }
.sde-seller-trust { font-size: 12px; color: var(--sde-muted); margin-top: 4px; }
.sde-cell-final strong { font-size: 17px; }
.sde-offer-note { font-size: 11px; color: var(--sde-muted); }
.sde-stock-in_stock { color: var(--sde-brand-green); font-weight: 600; }
.sde-stock-out_of_stock { color: var(--sde-danger); font-weight: 600; }
.sde-stock-limited_stock, .sde-stock-preorder { color: #8a5a00; font-weight: 600; }

/* Responsive: collapse table to stacked cards on small screens */
@media (max-width: 720px) {
	.sde-comparison-table thead { display: none; }
	.sde-comparison-table, .sde-comparison-table tbody, .sde-comparison-table tr, .sde-comparison-table td { display: block; width: 100%; }
	.sde-comparison-table tr { border: 1px solid var(--sde-border); border-radius: var(--sde-radius); margin-bottom: 14px; padding: 6px 0; }
	.sde-comparison-table td { border-top: none; display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; }
	.sde-comparison-table td[data-label]:not([data-label=""])::before { content: attr(data-label); font-weight: 600; color: var(--sde-muted); font-size: 12px; }
	.sde-cell-retailer { display: block !important; }
}

/* ---------- Deal card / category grid ---------- */
.sde-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 24px; }
.sde-filters select, .sde-filters input { padding: 8px 10px; border: 1px solid var(--sde-border); border-radius: 6px; font-size: 13px; }

.sde-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.sde-deal-card { background: #fff; border: 1px solid var(--sde-border); border-radius: var(--sde-radius); overflow: hidden; display: flex; flex-direction: column; }
.sde-card-media { position: relative; display: block; background: var(--sde-bg-soft); aspect-ratio: 1 / 1; }
.sde-card-media img { width: 100%; height: 100%; object-fit: contain; }
.sde-media-placeholder { width: 100%; height: 100%; background: var(--sde-bg-soft); }
.sde-deal-score-badge {
	position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
	background: #fff; border: 2px solid var(--sde-brand-green);
}
.sde-card-body { padding: 12px 14px 16px; flex: 1; display: flex; flex-direction: column; }
.sde-card-title { color: var(--sde-text); font-weight: 600; font-size: 14px; text-decoration: none; margin-bottom: 6px; }
.sde-card-price strong { font-size: 17px; }
.sde-card-meta { font-size: 12px; color: var(--sde-muted); margin: 4px 0; }
.sde-card-recommendation { font-size: 11px; font-weight: 700; margin-top: 4px; }

/* ---------- Single product page ---------- */
.sde-breadcrumb { font-size: 12px; color: var(--sde-muted); margin: 16px 0; }
.sde-breadcrumb a { color: var(--sde-muted); }
.sde-product-hero { display: grid; grid-template-columns: 1fr; gap: 24px; margin-bottom: 32px; }
@media (min-width: 860px) { .sde-product-hero { grid-template-columns: 380px 1fr; } }
.sde-product-media img { width: 100%; border-radius: var(--sde-radius); border: 1px solid var(--sde-border); }
.sde-media-placeholder { width: 100%; aspect-ratio: 1/1; background: var(--sde-bg-soft); border-radius: var(--sde-radius); }
.sde-product-info h1 { font-size: 24px; margin: 0 0 6px; }
.sde-product-subtitle { color: var(--sde-muted); margin-bottom: 14px; }
.sde-price-block { margin-bottom: 12px; }
.sde-best-price { font-size: 30px; font-weight: 700; margin-right: 8px; }
.sde-signal-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sde-last-checked { font-size: 12px; color: var(--sde-muted); margin-bottom: 16px; }

.sde-section { margin: 32px 0; }
.sde-section h2 { font-size: 20px; margin-bottom: 14px; }
.sde-disclaimer-footer { border-top: 1px solid var(--sde-border); padding-top: 14px; margin-top: 40px; }

.sde-price-chart svg { width: 100%; height: 160px; background: #fff; border: 1px solid var(--sde-border); border-radius: var(--sde-radius); }
.sde-price-chart-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--sde-muted); margin-top: 6px; }
