/* Base Design Tokens */
:root {
    --amazon-color: #ff9900;
    --target-color: #cc0000;
    --walmart-color: #0071ce;
    --bg-primary: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

header {
    background: white;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #111827;
}

.filters {
    display: flex;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 1.5rem auto 0 auto;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

select,
input[type="text"] {
    padding: 0.625rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    min-width: 200px;
    outline: none;
    transition: all 0.2s;
    background: white;
}

select:focus,
input[type="text"]:focus {
    border-color: var(--walmart-color);
    box-shadow: 0 0 0 3px rgba(0, 113, 206, 0.1);
}

main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Dashboard / Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 1rem;
}

.platform-col {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
}

.platform-header {
    padding: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    color: white;
}

.bg-amazon {
    background: var(--amazon-color);
}

.bg-target {
    background: var(--target-color);
}

.bg-walmart {
    background: var(--walmart-color);
}

.product-list {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.product-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

.product-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: white;
    border-radius: 8px;
}

/* Approval Screen Styles */
.approval-header-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 2rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.nav-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sku-group {
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.sku-header {
    background: #f8fafc;
    padding: 2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.sku-header-main {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.input-product-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
}

.sku-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
}

.sku-meta-row {
    display: flex;
    gap: 0.75rem;
    margin: 0.625rem 0 1rem 0;
}

.meta-badge {
    padding: 0.375rem 0.75rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.price-badge {
    background: #f0fdf4;
    color: #166534;
}

.sku-stats {
    text-align: right;
}

.total-match-badge {
    background: #0071ce;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    box-shadow: 0 10px 15px -3px rgba(0, 113, 206, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.total-match-badge span {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.platform-sections {
    display: flex;
    flex-direction: column;
}

.platform-section {
    padding: 2.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.amazon-bg-fade {
    background: linear-gradient(to right, #fff7ed, white);
}

.target-bg-fade {
    background: linear-gradient(to right, #fef2f2, white);
}

.walmart-bg-fade {
    background: linear-gradient(to right, #eff6ff, white);
}

.platform-divider {
    margin-bottom: 2rem;
}

.platform-label-pill {
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    color: white;
    font-weight: 800;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.amazon-bg {
    background: var(--amazon-color);
}

.target-bg {
    background: var(--target-color);
}

.walmart-bg {
    background: var(--walmart-color);
}

.match-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Modern Match Card (Vertical/Dashboard Style) */
.modern-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.card-img-container {
    height: 180px;
    background: white;
    padding: 1rem;
    position: relative;
    border-bottom: 1px solid #f1f5f9;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pg-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0071ce;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 900;
}

.card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5rem;
}

.card-meta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.meta-line {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.meta-line span {
    font-weight: 700;
    color: var(--text-primary);
}

.card-footer {
    display: flex;
    justify-content: flex-end;
}

.card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.btn-primary {
    background: var(--walmart-color);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

.loading,
.no-results {
    padding: 6rem;
    text-align: center;
    color: var(--text-secondary);
}

.product-link {
    color: var(--walmart-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.875rem;
}

#keyword-search {
    min-width: 320px;
}