﻿@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Manrope:wght@500;600;700&display=swap');

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

:root {
    --bg-primary: #07121f;
    --bg-secondary: #101e2e;
    --bg-card: #132438;
    --bg-hover: #1a3048;
    --text-primary: #f2f7ff;
    --text-secondary: #aac1d8;
    --text-muted: #7692ac;
    --accent: #2ea1ff;
    --accent-hover: #0e87ea;
    --success: #10b981;
    --error: #ef4444;
    --border: rgba(178, 217, 255, 0.14);
    --border-hover: rgba(178, 217, 255, 0.34);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.3);
    --focus-ring: 0 0 0 3px rgba(46, 161, 255, 0.32);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% 10%, rgba(42, 163, 255, 0.22), transparent 34%),
        radial-gradient(circle at 85% 8%, rgba(16, 185, 129, 0.18), transparent 28%),
        linear-gradient(170deg, #04101b 0%, #07121f 45%, #0a1828 100%);
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 36px 36px;
    z-index: -1;
    opacity: 0.35;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Header */
.glass-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 50px 20px 26px;
    animation: fadeInDown 0.6s ease-out;
}

.glass-header h1 {
    font-family: 'Space Grotesk', 'Manrope', sans-serif;
    font-size: clamp(2.2rem, 5.2vw, 4rem);
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    text-wrap: balance;
}

.glass-header h1 i {
    margin-right: 12px;
    color: var(--accent);
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.18rem);
    color: var(--text-secondary);
    font-weight: 600;
}

.brand-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(46, 161, 255, 0.35);
    color: #8fd0ff;
    background: rgba(46, 161, 255, 0.08);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

/* Glass Card Effect */
.glass-card {
    background: linear-gradient(170deg, rgba(20, 40, 62, 0.82), rgba(16, 30, 46, 0.92));
    border: 1px solid var(--border);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

/* Search Section */
.search-section {
    margin-bottom: 18px;
    padding: 28px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
    position: relative;
    z-index: 20;
}

.search-box-wrapper {
    max-width: 980px;
    margin: 0 auto;
    position: relative;
    z-index: 30;
}

.search-box {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
}

.search-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
    font-size: 1.1em;
    z-index: 2;
}

#searchInput {
    flex: 1;
    padding: 16px 20px 16px 50px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    font-weight: 400;
}

#searchInput::placeholder {
    color: var(--text-muted);
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-hover);
    box-shadow: var(--focus-ring);
}

.btn-primary {
    padding: 16px 32px;
    font-size: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-alert-toggle {
    padding: 16px 18px;
    font-size: 15px;
    background: rgba(7, 18, 31, 0.6);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-alert-toggle:hover {
    background: var(--bg-hover);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.5);
    transform: translateY(-2px);
}

.btn-alert-toggle.active {
    background: rgba(251, 191, 36, 0.14);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.45);
}

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

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

/* Search History */
.search-history {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    z-index: 9999;
    margin-top: 4px;
    animation: fadeInDown 0.2s ease-out;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.history-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-clear-history {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    font-size: 12px;
}

.btn-clear-history:hover {
    background: var(--bg-hover);
    color: var(--error);
}

.history-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.history-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.history-item-icon {
    color: var(--accent);
    font-size: 14px;
    flex-shrink: 0;
}

.history-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.history-item-time {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 8px;
}

.history-item-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    opacity: 0;
    font-size: 12px;
}

.history-item:hover .history-item-remove {
    opacity: 1;
}

.history-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.history-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Loading */
.loading {
    text-align: center;
    color: var(--text-primary);
    margin: 60px 0;
    padding: 60px;
}

.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Results */
.results {
    animation: fadeIn 0.4s ease-out;
}

.home-alerts-bar {
    margin-bottom: 18px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-color: rgba(245, 158, 11, 0.25);
    background: linear-gradient(135deg, rgba(34, 26, 9, 0.82), rgba(26, 29, 39, 0.9));
    position: relative;
    z-index: 1;
}

.home-alerts-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-alerts-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
}

.home-alerts-title i {
    color: #f59e0b;
}

.home-alerts-status {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-check-alerts {
    padding: 11px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-check-alerts:hover {
    border-color: rgba(59, 130, 246, 0.5);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-check-alerts:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.alerts-section {
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(165deg, rgba(14, 30, 46, 0.86), rgba(13, 26, 41, 0.95));
}

.alerts-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.alerts-header-row h2 {
    font-size: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.alerts-panels {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.alerts-panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
    padding: 14px;
}

.alerts-panel h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
}

.alert-query-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 10px;
    background: var(--bg-card);
    gap: 10px;
}

.alert-query-text {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.alert-query-text i {
    color: #fbbf24;
}

.alert-query-text span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-query-actions {
    display: flex;
    gap: 6px;
}

.alert-query-run,
.alert-query-remove,
.alert-item-remove,
.alert-item-link {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.alert-query-run:hover,
.alert-item-link:hover {
    color: var(--accent);
    border-color: rgba(59, 130, 246, 0.45);
}

.alert-query-remove:hover,
.alert-item-remove:hover {
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.45);
}

.alert-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: var(--bg-card);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.alert-item-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alert-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.alert-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.alert-item-prices {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.old-price {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 12px;
}

.new-price {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
}

.drop-pill {
    color: #16a34a;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 600;
}

.alert-item-actions {
    display: flex;
    gap: 6px;
}

.results-header {
    padding: 24px;
    margin-bottom: 24px;
    background: linear-gradient(175deg, rgba(15, 33, 52, 0.86), rgba(16, 30, 46, 0.96));
}

.stats {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    border: 1px solid var(--border);
}

.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.view-controls {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    font-size: 14px;
}

.view-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.view-btn.active {
    background: var(--accent);
    color: white;
}

/* Filters */
.filters-bar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    flex-wrap: wrap;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.filter-sliders {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-slider-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.slider-value {
    margin-left: auto;
    font-weight: 600;
    color: var(--accent);
    font-size: 14px;
}

.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-primary);
    outline: none;
    margin-top: 8px;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.filter-actions {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 140px;
}

.sort-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sort-group label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 200px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.filter-group input[type="number"] {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-filter,
.btn-clear {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.btn-filter {
    background: var(--accent);
    color: white;
}

.btn-filter:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-clear {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

/* Products Container */
.products-container {
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.products-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Vista de lista â€” rediseÃ±o */
.products-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}

.products-container.list-view .product-card {
    display: grid;
    grid-template-columns: 100px 1fr auto auto;
    grid-template-areas: "img info price action";
    align-items: center;
    gap: 18px;
    max-width: 100%;
    padding: 14px 18px;
    margin: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    transition: background 0.2s ease;
}

.products-container.list-view .product-card:last-child {
    border-bottom: none;
}

.products-container.list-view .product-card:hover {
    background: var(--bg-hover);
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.products-container.list-view .product-card:hover::before {
    display: none;
}

.products-container.list-view .product-image-container {
    grid-area: img;
    width: 100px;
    height: 100px;
    min-width: 100px;
    min-height: 100px;
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.products-container.list-view .product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.products-container.list-view .product-card-body {
    grid-area: info;
    min-width: 0;
}

.products-container.list-view .product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    min-height: auto;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-container.list-view .product-info {
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.products-container.list-view .product-source,
.products-container.list-view .product-store {
    font-size: 11px;
    padding: 4px 8px;
}

.products-container.list-view .product-descuento {
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 12px;
}

.products-container.list-view .product-price-block {
    grid-area: price;
    text-align: right;
}

.products-container.list-view .product-price {
    font-size: 20px;
    margin-bottom: 0;
}

.products-container.list-view .product-link {
    grid-area: action;
    width: auto;
    min-width: 140px;
    padding: 10px 18px;
    font-size: 13px;
}

.products-container.list-view .product-card:not(:has(.product-image-container)) {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "info price action";
}

/* Product Card */
.product-card {
    background: linear-gradient(170deg, rgba(20, 39, 59, 0.88), rgba(15, 29, 45, 0.95));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    animation: fadeInUp 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-xl);
}

.product-image-container {
    width: 100%;
    height: 220px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    min-height: 48px;
    line-height: 1.45;
}

.product-price {
    font-size: 26px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.product-descuento {
    color: var(--success);
    font-size: 13px;
    margin-bottom: 12px;
    font-weight: 500;
}

.price-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.price-change.down {
    color: #16a34a;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.price-change.up {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.price-change.flat {
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.28);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.product-source {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    width: fit-content;
    border: 1px solid var(--border);
}

.product-store {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    width: fit-content;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.product-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent), #0a88ee);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    width: 100%;
}

.product-link:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.product-link:active {
    transform: translateY(0);
}

/* Tab Content */
.tab-content {
    display: none !important;
}

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

.tab-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.btn-retry-source {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-retry-source:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.5);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.btn-retry-source:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.empty-state p {
    font-size: 16px;
}

/* Error */
.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    padding: 16px 20px;
    border-radius: 12px;
    text-align: center;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.source-disclaimer {
    margin-top: 22px;
    margin-bottom: 30px;
    padding: 18px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    background: linear-gradient(160deg, rgba(14, 30, 46, 0.88), rgba(12, 25, 39, 0.94));
}

.source-disclaimer h2 {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.source-disclaimer p + p {
    margin-top: 8px;
}

.source-disclaimer a {
    color: #8fd0ff;
    font-weight: 700;
    text-decoration: none;
}

.source-disclaimer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .glass-header h1 {
        font-size: 2.2em;
    }

    .glass-header {
        padding-top: 34px;
    }
    
    .search-box {
        flex-direction: column;
    }

    .search-actions {
        width: 100%;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .btn-alert-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tabs {
        width: 100%;
        justify-content: center;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .products-container.grid-view {
        grid-template-columns: 1fr;
    }
    
    .products-container.list-view .product-card {
        grid-template-columns: 1fr;
        grid-template-areas: "img" "info" "price" "action";
        gap: 12px;
        padding: 16px;
    }
    
    .products-container.list-view .product-image-container {
        width: 80px;
        height: 80px;
        min-width: 80px;
        min-height: 80px;
        justify-self: start;
    }
    
    .products-container.list-view .product-price-block {
        text-align: left;
    }
    
    .products-container.list-view .product-link {
        width: 100%;
        min-width: 0;
    }
    
    .filter-sliders {
        flex-direction: column;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .sort-select {
        min-width: 100%;
    }

    .alerts-panels {
        grid-template-columns: 1fr;
    }

    .home-alerts-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-check-alerts {
        width: 100%;
        justify-content: center;
    }
}

