/* === Design System — Comparador de Preços SP === */
/* Dark premium theme with vibrant accents */

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #181825;
    --bg-card-hover: #1e1e2e;
    --bg-elevated: #232336;
    --bg-input: #1a1a2a;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    --text-primary: #e4e4ef;
    --text-secondary: #8888a4;
    --text-muted: #5a5a72;
    --text-inverse: #0a0a0f;

    --accent: #6c5ce7;
    --accent-hover: #7c6ef7;
    --accent-glow: rgba(108, 92, 231, 0.15);
    --accent-text: #a78bfa;

    --green: #10b981;
    --green-bg: rgba(16, 185, 129, 0.1);
    --green-text: #34d399;

    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --red-text: #f87171;

    --yellow: #f59e0b;
    --yellow-bg: rgba(245, 158, 11, 0.1);
    --yellow-text: #fbbf24;

    --blue: #3b82f6;
    --blue-bg: rgba(59, 130, 246, 0.1);

    --border: #2a2a3e;
    --border-hover: #3a3a52;

    /* Typography */
    --font: 'Inter', -apple-system, system-ui, sans-serif;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* === Header === */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo .accent {
    color: var(--accent);
    font-weight: 800;
}

.logo svg {
    color: var(--accent);
}

.nav-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-tab.active {
    color: var(--accent-text);
    background: var(--accent-glow);
}

.header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: fit-content;
}

/* CEP Widget */
.cep-widget {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.cep-widget:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.cep-widget svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.cep-widget:focus-within svg {
    color: var(--accent);
}

.cep-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    width: 80px;
    letter-spacing: 0.05em;
}

.cep-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.cep-status {
    width: 7px;
    height: 7px;
    min-width: 7px;
    min-height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
    background: transparent;
}

.cep-status.resolved {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.cep-status.loading {
    background: var(--warning, #f59e0b);
    animation: pulse-dot 1s ease-in-out infinite;
}

.cep-status.error {
    background: var(--error, #ef4444);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-icon.spinning svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === Main Content === */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

.back-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions-group {
    display: flex;
    gap: 8px;
}

/* === Buttons === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: none;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card);
    border-color: var(--border-hover);
}

.btn-danger-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: none;
    color: var(--red-text);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger-outline:hover {
    background: var(--red-bg);
    border-color: var(--red);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* === Lists Grid === */
.lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.list-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.list-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--blue));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.list-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.list-card:hover::before {
    opacity: 1;
}

.list-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.list-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.list-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    max-width: 400px;
    margin: 0 auto 20px;
}

/* === Add Item Bar === */
.add-item-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    align-items: center;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    flex: 1;
    transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input-wrapper svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 12px 0;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.search-input-wrapper.large input {
    font-size: 1rem;
    padding: 14px 0;
}

.qty-input {
    width: 60px;
    padding: 12px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.qty-input:focus {
    border-color: var(--accent);
}

/* === Items List === */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.item-row:hover {
    background: var(--bg-card-hover);
}

.item-query {
    flex: 1;
    font-weight: 500;
}

.item-qty {
    color: var(--text-secondary);
    font-size: 0.85rem;
    background: var(--bg-elevated);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.item-delete {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.item-delete:hover {
    color: var(--red-text);
    background: var(--red-bg);
}

/* === Search Bar === */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

/* === Product Grid === */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.2s ease;
}

.product-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.product-card.has-comparison {
    border-color: var(--accent);
    border-width: 1px;
    box-shadow: 0 0 12px var(--accent-glow);
}

.product-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.product-card-img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: rgba(255,255,255,0.03);
    flex-shrink: 0;
}

.product-card-info {
    flex: 1;
    min-width: 0;
}

.product-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-brand {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.product-unit {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--blue);
    background: var(--blue-bg);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Store count badges */
.store-count-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 6px;
    background: var(--accent-glow);
    color: var(--accent-text);
}

.store-single-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 6px;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
}

/* Price comparison rows */
.product-prices {
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.price-row {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: background 0.15s;
}

.price-row:hover {
    background: rgba(255,255,255,0.03);
}

.price-row.cheapest {
    background: var(--green-bg);
}

.price-store-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1.3;
    min-width: 0;
}

.price-store {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

a.price-store:hover {
    text-decoration: underline;
}

.price-store.atacadao { color: #f87171; }
.price-store.mambo { color: #60a5fa; }
.price-store.stmarche { color: #c084fc; }
.price-store.paodeacucar { color: #fbbf24; }
.price-store.oba { color: #34d399; }
.price-store.naturaldaterra { color: #4ade80; }
.price-store.superpaguemenos { color: #fb923c; }
.price-store.samsclub { color: #38bdf8; }
.price-store.hirota { color: #f472b6; }
.price-store.sonda { color: #a78bfa; }
.price-store.extra { color: #60a5fa; }
.price-store.santaluzia { color: #f472b6; }
.price-store.tenda { color: #fb923c; }

.price-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-align: right;
    line-height: 1.25;
    padding-right: 4px;
}

.price-current {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.price-row.cheapest .price-current {
    color: var(--green-text);
}

.price-original-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    line-height: 1;
    margin-top: 1px;
}

.price-original {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted);
    text-decoration: line-through;
}

.price-discount {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--yellow-text);
}

/* Savings badge */
.savings-badge {
    margin-top: 8px;
    padding: 6px 10px;
    background: var(--green-bg);
    color: var(--green-text);
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
    text-align: center;
}

/* === Optimization Results === */
.optimization-results {
    margin-top: 16px;
}

.optimization-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.optimization-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.optimization-header svg {
    color: var(--yellow);
}

.strategies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.strategy-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.strategy-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.strategy-card.best {
    border-color: var(--green);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.strategy-card.best::after {
    content: '★ Recomendado';
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--green-text);
    background: var(--green-bg);
    padding: 3px 8px;
    border-radius: 4px;
}

.strategy-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.strategy-total {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.03em;
}

.strategy-total small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.strategy-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 8px;
}

.strategy-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.strategy-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.4;
}

/* Strategy detail breakdown */
.strategy-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 8px;
}

.store-section {
    margin-bottom: 20px;
}

.store-section:last-child {
    margin-bottom: 0;
}

.store-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.store-section-name {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.9rem;
}

.store-section-subtotal {
    font-weight: 700;
    color: var(--green-text);
}

.breakdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85rem;
}

.breakdown-item-name {
    color: var(--text-secondary);
    flex: 1;
}

.breakdown-item-qty {
    color: var(--text-muted);
    margin: 0 12px;
    font-size: 0.8rem;
}

.breakdown-item-price {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 70px;
    text-align: right;
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.stat-value.accent { color: var(--accent-text); }
.stat-value.green { color: var(--green-text); }
.stat-value.blue { color: #60a5fa; }

/* === Modal === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.modal-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-card input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.modal-card input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 300;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    border-color: rgba(239,68,68,0.3);
    color: var(--red-text);
}

.toast.success {
    border-color: rgba(16,185,129,0.3);
    color: var(--green-text);
}

/* === Loading === */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    gap: 8px;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === Matches Report === */
.matches-summary {
    margin-bottom: 20px;
}

.matches-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.match-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.match-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.match-stat-value.accent { color: var(--accent-text); }
.match-stat-value.green { color: var(--green-text); }
.match-stat-value.blue { color: #60a5fa; }

.match-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.matches-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.match-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s;
}

.match-category.open {
    border-color: var(--accent);
}

.match-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.match-category-header:hover {
    background: rgba(255,255,255,0.02);
}

.match-category-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.match-category-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.match-category-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

.match-category-savings {
    display: flex;
    align-items: center;
    gap: 10px;
}

.savings-text {
    color: var(--green-text);
    font-weight: 700;
    font-size: 0.85rem;
}

.chevron {
    color: var(--text-muted);
    transition: transform 0.2s;
}

.match-category.open .chevron {
    transform: rotate(180deg);
}

.match-category-products {
    border-top: 1px solid var(--border);
    padding: 8px 0;
}

.match-product-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
    transition: background 0.1s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.match-product-row:last-child {
    border-bottom: none;
}

.match-product-row:hover {
    background: rgba(255,255,255,0.02);
}

.match-product-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.match-product-img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(255,255,255,0.03);
    flex-shrink: 0;
}

.match-product-name {
    font-weight: 500;
    font-size: 0.85rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.match-product-brand {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.match-product-prices {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
    width: 100%;
}

.match-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    transition: all 0.15s ease;
}

.match-price:hover {
    background: rgba(255,255,255,0.06);
}

.match-price.best {
    color: var(--green-text);
    background: var(--green-bg);
    border-color: rgba(16, 185, 129, 0.2);
}

.match-price .price-store {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: unset;
}

.match-price .match-price-value {
    font-size: 0.95rem;
    font-weight: 700;
}

.match-saving {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--green-text);
    background: var(--green-bg);
    padding: 3px 8px;
    border-radius: 6px;
    align-self: flex-start;
}

/* === Responsive === */
@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }

    .nav-tabs {
        gap: 2px;
    }

    .nav-tab {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .nav-tab svg {
        display: none;
    }

    .main-content {
        padding: 20px 16px;
    }

    .section-header {
        flex-direction: column;
    }

    .strategies-grid {
        grid-template-columns: 1fr;
    }

    .add-item-bar {
        flex-wrap: wrap;
    }

    .search-input-wrapper {
        width: 100%;
    }

    /* Matches responsive */
    .matches-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .match-product-prices {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .match-category-header {
        padding: 12px;
    }

    .match-category-info {
        flex-wrap: wrap;
        gap: 6px;
    }

    .match-category-savings {
        gap: 6px;
    }

    .savings-text {
        font-size: 0.75rem;
    }

    /* Product cards responsive */
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .product-card-img {
        width: 48px;
        height: 48px;
    }

    /* Stats responsive */
    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 480px) {
    .match-product-prices {
        grid-template-columns: repeat(3, 1fr);
    }

    .match-stat-value {
        font-size: 1.1rem;
    }

    .match-stat-label {
        font-size: 0.65rem;
    }

    .matches-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .match-stat-card {
        padding: 10px;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* === Interactive Checkbox Bought/Completed Items === */
.btn-item-check {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-item-check:hover .checkmark {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.05);
}
.item-row.completed .checkmark {
    background: var(--green);
    border-color: var(--green);
}
.item-row.completed .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.item-row.completed .item-query {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* === Inline Name Editor === */
.inline-edit-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.inline-edit-input {
    font-family: var(--font);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    outline: none;
    width: 100%;
    max-width: 400px;
    transition: all 0.2s ease;
}
.inline-edit-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.btn-edit-title-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: all 0.2s ease;
    padding: 6px;
    border-radius: 50%;
}
.btn-edit-title-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    opacity: 1;
}

/* === Quick Delete Card Button === */
.btn-delete-quick {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--red-text);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}
.list-card:hover .btn-delete-quick {
    opacity: 1;
    transform: translateY(0);
}
.btn-delete-quick:hover {
    background: var(--red);
    color: white;
    border-color: var(--red);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* === Quick Suggestion Search Pills === */
.quick-search-container {
    margin-bottom: 24px;
}
.quick-search-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.quick-search-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.quick-pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.quick-pill:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.quick-pill:active {
    transform: translateY(0);
}

/* === Advanced Collapsible Filter Panel === */
.filter-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.filter-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.filter-group select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    padding: 10px 12px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}
.filter-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.filter-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.filter-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    user-select: none;
    transition: all 0.15s ease;
}
.filter-checkbox-label:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}
.filter-checkbox-label input {
    cursor: pointer;
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
}
.filter-checkbox-label input:checked + .checkbox-store-name {
    color: var(--text-primary);
}
.checkbox-store-name {
    color: var(--text-secondary);
    font-weight: 500;
}
.btn-ghost.active {
    color: var(--accent-text);
    background: var(--accent-glow);
    border-color: var(--accent);
}

/* === Matches Report Filters & Horizontal Badges === */
.matches-filter-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}
.categories-scroll-wrapper {
    position: relative;
    margin-bottom: 20px;
    overflow: hidden;
}
.categories-scroll-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.categories-scroll-container::-webkit-scrollbar {
    height: 4px;
}
.categories-scroll-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
}
.categories-scroll-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}
.categories-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}
.scroll-badge-pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.scroll-badge-pill:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}
.scroll-badge-pill.active {
    background: var(--accent-glow);
    color: var(--accent-text);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.2);
}
.scroll-badge-count {
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255,255,255,0.08);
    padding: 1px 6px;
    border-radius: 10px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.scroll-badge-pill.active .scroll-badge-count {
    background: rgba(108, 92, 231, 0.25);
    color: var(--accent-text);
}

/* === Dashboard details progress bars & scraping log table === */
.dashboard-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
}
@media (max-width: 500px) {
    .dashboard-details-grid {
        grid-template-columns: 1fr;
    }
}
.dashboard-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
}
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}
.panel-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.panel-header svg {
    color: var(--accent-text);
}
.store-distribution-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dist-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dist-label {
    width: 120px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dist-progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dist-progress-track {
    flex: 1;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.dist-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.dist-count {
    width: 45px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}

/* Scrapes Table styling */
.scrapes-table {
    width: 100%;
    border-collapse: collapse;
}
.scrapes-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 8px;
    border-bottom: 1px solid var(--border);
}
.scrapes-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.scrapes-table tr:last-child td {
    border-bottom: none;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 4px;
}
.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.status-badge.success {
    background: var(--green-bg);
    color: var(--green-text);
}
.status-badge.success::before {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}
.status-badge.running {
    background: var(--yellow-bg);
    color: var(--yellow-text);
}
.status-badge.running::before {
    background: var(--yellow);
    animation: pulse-dot 1s ease-in-out infinite;
}
.status-badge.error {
    background: var(--red-bg);
    color: var(--red-text);
}
.status-badge.error::before {
    background: var(--red);
    box-shadow: 0 0 6px var(--red);
}
.scrape-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* === Login Screen === */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    animation: fadeIn 0.5s ease;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 48px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 60px var(--accent-glow);
    text-align: center;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.login-logo svg { color: var(--accent); }

.login-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 32px;
}

.login-form { text-align: left; }

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    margin-top: 8px;
    justify-content: center;
}

.login-error {
    color: var(--red-text);
    font-size: 0.8rem;
    text-align: center;
    margin-top: 12px;
}

/* === Cart FAB (Floating Action Button) === */
.cart-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(108, 92, 231, 0.5);
}

.cart-fab:active {
    transform: scale(0.95);
}

.cart-fab.pulse {
    animation: fabPulse 0.4s ease;
}

@keyframes fabPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.cart-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--red);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* === Cart Drawer === */
.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 290;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    width: 380px;
    max-width: 90vw;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
}

.cart-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.drawer-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.drawer-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.drawer-close:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.drawer-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all 0.15s;
}

.drawer-item:hover {
    border-color: var(--border-hover);
}

.drawer-item-img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(255,255,255,0.03);
    flex-shrink: 0;
}

.drawer-item-info {
    flex: 1;
    min-width: 0;
}

.drawer-item-name {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.drawer-item-store {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--accent-glow);
    color: var(--accent-text);
    margin-top: 2px;
}

.drawer-item-price {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--green-text);
    margin-top: 2px;
}

.drawer-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    flex-shrink: 0;
}

.drawer-item-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}

.drawer-item-remove:hover {
    color: var(--red-text);
    background: var(--red-bg);
}

.drawer-qty-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.drawer-qty-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.drawer-qty-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent-text);
}

.drawer-qty-value {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.drawer-footer {
    border-top: 1px solid var(--border);
    padding: 16px;
    flex-shrink: 0;
    background: var(--bg-card);
}

.drawer-totals { margin-bottom: 12px; }

.drawer-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.drawer-total-row.total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 6px 0;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.drawer-total-row.savings { color: var(--green-text); font-weight: 600; }

.green-text { color: var(--green-text); }

.drawer-actions {
    display: flex;
    gap: 8px;
}

/* Nav Badge */
.nav-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    background: var(--red);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

/* === Cart Page === */
.cart-economy-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.economy-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.economy-card.highlight {
    border-color: var(--accent);
    box-shadow: 0 0 16px var(--accent-glow);
}

.economy-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.economy-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cart-items-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.cart-item-card {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.15s;
    align-items: center;
}

.cart-item-card:hover {
    border-color: var(--border-hover);
}

.cart-item-img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: rgba(255,255,255,0.03);
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

.cart-item-brand {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.cart-item-store-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.cart-item-pricing {
    text-align: right;
    flex-shrink: 0;
}

.cart-item-unit-price {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cart-item-subtotal {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    justify-content: flex-end;
}

.cart-qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.cart-qty-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
}

.cart-qty-value {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.cart-item-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    flex-shrink: 0;
}

.cart-item-remove:hover {
    color: var(--red-text);
    background: var(--red-bg);
}

/* Cart Store Distribution */
.cart-store-dist {
    margin-bottom: 24px;
}

.cart-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Suggestions */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.suggestion-card:hover {
    border-color: var(--green);
    background: rgba(16, 185, 129, 0.05);
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-product {
    font-size: 0.85rem;
    font-weight: 500;
}

.suggestion-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.suggestion-savings {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--green-text);
    white-space: nowrap;
}

.btn-swap {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--green-bg);
    color: var(--green-text);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-swap:hover {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

/* Add to Cart Button */
.btn-add-cart {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 6px;
    color: var(--accent-text);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-add-cart:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.1);
}

.btn-add-cart.in-cart {
    background: var(--green-bg);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--green-text);
    cursor: default;
}

.btn-add-cart.in-cart:hover {
    transform: none;
    background: var(--green-bg);
    color: var(--green-text);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Cart Store Filter */
.cart-store-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* App hidden during login */
.app-hidden {
    display: none !important;
}

/* Responsive for drawer */
@media (max-width: 480px) {
    .cart-drawer { width: 100%; }
    .cart-fab { bottom: 16px; right: 16px; width: 50px; height: 50px; }
}

/* === List Price / Discount in Cart === */
.drawer-item-listprice {
    font-size: 0.7rem;
    margin-top: 2px;
}

.drawer-item-listprice s {
    color: var(--text-muted);
}

.drawer-item-discount {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--green-text);
    background: var(--green-bg);
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 2px;
}

.cart-item-listprice {
    font-size: 0.75rem;
    text-align: right;
}

.cart-item-listprice s {
    color: var(--text-muted);
}

.cart-item-discount-tag {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--green-text);
    background: var(--green-bg);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* === Mercado Livre Premium Styles === */

@keyframes ml-spin {
    to { transform: rotate(360deg); }
}

.ml-spinner {
    animation: ml-spin 0.8s linear infinite;
}

.filter-switch-label {
    user-select: none;
    transition: color 0.15s;
}

.filter-switch-label:hover {
    color: var(--text-primary) !important;
}

/* Verified Grid Card */
.ml-verified-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ml-verified-card:hover {
    border-color: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.1);
}

.ml-card-main {
    padding: 16px;
    display: flex;
    gap: 16px;
    flex: 1;
}

.ml-card-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    padding: 4px;
    flex-shrink: 0;
}

.ml-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ml-badge-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ml-badge-full {
    background: #2dcc70;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ml-badge-free {
    background: #2980b9;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ml-badge-yellow {
    background: #FFF159;
    color: #111111;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ml-badge-simulated {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.ml-card-title {
    font-weight: 600;
    font-size: 0.925rem;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
}

.ml-card-title:hover {
    color: #FFF159;
    text-decoration: underline;
}

.ml-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
}

.ml-card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #FFF159;
}

.ml-card-sales {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.ml-card-seller {
    font-size: 0.725rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Comparison Sub-Card */
.ml-card-comparison {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px dashed var(--border-color);
    padding: 12px 16px;
    font-size: 0.8rem;
}

.ml-comparison-title {
    font-size: 0.725rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ml-comparison-title svg {
    color: var(--text-muted);
}

.ml-comparison-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.ml-comparison-result {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ml-comparison-result.cheaper {
    color: #2ecc71; /* Supermercado mais barato */
}

.ml-comparison-result.expensive {
    color: #e67e22; /* Mercado Livre mais barato */
}

.ml-comparison-savings {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Other Listings Card (Deduplicated Search Results) */
.ml-others-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px;
    transition: all 0.2s ease;
}

.ml-others-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Variations Panel (Collapsible lists) */
.ml-variations-toggle {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    width: 100%;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s;
}

.ml-variations-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.ml-variations-panel {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    margin-top: 8px;
    animation: fadeIn 0.15s ease;
}

.ml-variations-panel.open {
    display: flex;
}

.ml-variation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
}

.ml-variation-row:last-child {
    border-bottom: none;
}

.ml-variation-title {
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
    flex: 1;
}

.ml-variation-title:hover {
    color: #FFF159;
    text-decoration: underline;
}

.ml-variation-price {
    font-weight: 700;
    color: #FFF159;
}

/* === Strategy Cards Enhanced === */
.strategy-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}
.strategy-shipping {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}
.store-section-totals {
    display: flex;
    align-items: center;
    gap: 12px;
}
.store-fee {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 4px;
}
.store-fee.pickup {
    color: var(--green);
    background: rgba(46,204,113,0.1);
}
.store-items-list {
    padding: 8px 0;
}
.strategy-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.strategy-item-name { flex: 1; }
.strategy-item-price { color: var(--text-primary); font-weight: 500; }

/* === Paste List Modal === */
.modal-card-lg { max-width: 600px; width: 95%; }
.paste-textarea {
    width: 100%;
    min-height: 160px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    resize: vertical;
    margin-bottom: 16px;
}
.paste-textarea:focus {
    border-color: var(--accent);
    outline: none;
}
.paste-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    max-height: 200px;
    overflow-y: auto;
}
.paste-items-preview { display: flex; flex-direction: column; gap: 6px; }
.paste-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    padding: 4px 0;
}
.paste-item-qty {
    font-weight: 600;
    color: var(--accent);
    min-width: 30px;
}
.paste-item-name { flex: 1; color: var(--text-primary); }
.paste-item-match {
    font-size: 0.75rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.paste-item-match.found { color: var(--green); }
.paste-item-match.not-found { color: var(--red); }

/* === List Quick Actions === */
.list-quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    position: relative;
}
.btn-sm {
    font-size: 0.8rem;
    padding: 6px 12px;
    gap: 6px;
}

/* === Templates Dropdown === */
.templates-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    min-width: 200px;
    padding: 4px;
    margin-top: 4px;
}
.template-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font);
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}
.template-option:hover { background: var(--bg-card-hover); }
.template-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* === Price History === */
.price-history-content h4 {
    font-size: 0.85rem;
    color: var(--accent);
    margin: 12px 0 6px;
}
.price-history-content h4:first-child { margin-top: 0; }
.trend-row {
    font-size: 0.8rem;
    padding: 3px 0;
}
.history-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}
.history-store { color: var(--text-primary); font-weight: 500; }
.history-price { color: var(--green); }
.history-date { color: var(--text-muted); font-size: 0.75rem; }
.history-stat-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 8px;
    font-size: 0.75rem;
    padding: 3px 0;
    color: var(--text-secondary);
}

/* === Verified Time Ago === */
.price-time-ago {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* === Product Actions === */
.product-actions {
    display: flex;
    justify-content: flex-end;
    padding: 4px 0 0;
}

/* === Savings Summary === */
.savings-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.savings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.savings-icon { font-size: 1.5rem; margin-bottom: 8px; }
.savings-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}
.savings-value.green { color: var(--green); }
.savings-value.accent { color: var(--accent); }
.savings-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === Substitutions Styles === */
.btn-substitute-pill {
    background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(16, 185, 129, 0.4);
    color: var(--green-text);
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.btn-substitute-pill:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--green);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.btn-substitute-pill .sub-icon {
    font-size: 0.8rem;
    display: inline-block;
    animation: pulseLamp 2s infinite ease-in-out;
}

@keyframes pulseLamp {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.sub-current-product-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 16px;
}

.sub-product-card {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sub-product-card img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: white;
    border: 1px solid var(--border);
}

.sub-product-details {
    flex: 1;
    min-width: 0;
}

.sub-product-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-product-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.sub-product-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

.sub-alternative-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.sub-alternative-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: var(--green);
    opacity: 0.7;
}

.sub-alternative-card:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.sub-alt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sub-alt-savings-badge {
    background: var(--green-bg);
    color: var(--green-text);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.sub-alt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.sub-alt-footer-price {
    display: flex;
    flex-direction: column;
}

.sub-alt-footer-price .price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--green-text);
}

.sub-alt-footer-price .meta {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.btn-apply-sub {
    background: var(--green);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-apply-sub:hover {
    background: #059669;
    transform: scale(1.02);
}

