/* ============================================
   Facebook Marketplace Scraper - Estilos
   ============================================
   Diseño: Dark mode + Glassmorphism + Animaciones
   ============================================ */

/* ---- Reset & Variables ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Colores principales */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-glass: rgba(255, 255, 255, 0.06);
    --bg-glass-strong: rgba(255, 255, 255, 0.10);

    /* Acentos */
    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --accent-success: #00b894;
    --accent-warning: #fdcb6e;
    --accent-danger: #e17055;
    --accent-fire: #ff6b6b;

    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --gradient-fire: linear-gradient(135deg, #ff6b6b 0%, #ffa502 100%);
    --gradient-success: linear-gradient(135deg, #00b894 0%, #55efc4 100%);
    --gradient-warning: linear-gradient(135deg, #fdcb6e 0%, #f39c12 100%);
    --gradient-bg: linear-gradient(180deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);

    /* Texto */
    --text-primary: #f1f1f7;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;
    --text-accent: #a29bfe;

    /* Bordes */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glass: rgba(255, 255, 255, 0.12);

    /* Sombras */
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);

    /* Bordes redondeados */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transiciones */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Fondo animado con partículas ---- */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-particles::before,
.bg-particles::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: floatOrb 20s ease-in-out infinite;
}

.bg-particles::before {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -200px;
}

.bg-particles::after {
    width: 500px;
    height: 500px;
    background: #e17055;
    bottom: -150px;
    left: -150px;
    animation-delay: -10s;
    animation-duration: 25s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -80px) scale(1.1); }
    66% { transform: translate(-30px, 60px) scale(0.9); }
}

/* ---- Container principal ---- */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1800px;
    width: 96%;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ---- Header / Hero ---- */
.header {
    text-align: center;
    padding: 2rem 0 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.header__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.header__icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: var(--shadow-glow);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: var(--shadow-glow); }
    50% { box-shadow: 0 0 60px var(--accent-glow), 0 0 20px var(--accent-glow); }
}

.header__title {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.header__subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* ---- Panel de Búsqueda (Glass Card) ---- */
.search-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.search-panel__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group--full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-input,
.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition-fast);
    outline: none;
    width: 100%;
}

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

.form-input:focus,
.form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255, 255, 255, 0.08);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%238b8b9e'%3E%3Cpath d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ---- Botón principal ---- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 1.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px var(--accent-glow);
    position: relative;
    overflow: hidden;
    min-height: 52px;
}

.actions-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.2fr;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-secondary-action {
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-secondary-action:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-deep-action {
    background: linear-gradient(135deg, #e17055 0%, #fdcb6e 100%);
    box-shadow: 0 4px 15px rgba(225, 112, 85, 0.2);
}

.btn-deep-action:hover {
    box-shadow: 0 8px 30px rgba(225, 112, 85, 0.35);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled::before {
    display: none;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: rgba(225, 112, 85, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(225, 112, 85, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-cancel:hover {
    background: rgba(225, 112, 85, 0.25);
}

/* ---- Barra de Progreso ---- */
.progress-section {
    display: none;
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s ease-out;
}

.progress-section.active {
    display: block;
}

.progress-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-card);
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.progress-status {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.progress-pct {
    font-size: 0.85rem;
    color: var(--text-accent);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.progress-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease-out;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ---- Toolbar de resultados ---- */
.results-toolbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
    animation: fadeIn 0.5s ease-out;
}

.results-toolbar.active {
    display: flex;
}

.results-count {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.results-count strong {
    color: var(--text-primary);
    font-weight: 700;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sort-select {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.5rem 2.2rem 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%238b8b9e'%3E%3Cpath d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.sort-select:focus {
    border-color: var(--accent-primary);
}

.sort-select option {
    background: var(--bg-secondary);
}

/* ---- Grid de Productos ---- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* ---- Tarjeta de Producto ---- */
.product-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-smooth);
    animation: fadeInUp 0.6s ease-out both;
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-glass);
    box-shadow: var(--shadow-elevated);
}

.product-card__image-wrapper {
    position: relative;
    width: 100%;
    height: 130px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-card__image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(108, 92, 231, 0.1));
}

/* Badge de score */
.product-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(10px);
    z-index: 2;
    animation: badgePop 0.4s var(--transition-bounce);
}

@keyframes badgePop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.badge--best {
    background: rgba(255, 107, 107, 0.9);
    color: white;
    box-shadow: 0 2px 12px rgba(255, 107, 107, 0.4);
}

.badge--good {
    background: rgba(0, 184, 148, 0.9);
    color: white;
    box-shadow: 0 2px 12px rgba(0, 184, 148, 0.4);
}

.badge--regular {
    background: rgba(253, 203, 110, 0.9);
    color: #333;
    box-shadow: 0 2px 12px rgba(253, 203, 110, 0.3);
}

.badge--expensive {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

/* Score circular */
.product-card__score {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.product-card__score-value {
    font-size: 0.8rem;
    font-weight: 800;
    color: white;
    font-variant-numeric: tabular-nums;
}

.product-card__body {
    padding: 1.25rem;
}

.product-card__price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.product-card__title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.product-card__meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.product-card__meta-icon {
    font-size: 0.85rem;
    width: 1.2em;
    text-align: center;
}

.product-card__description {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.product-card__actions {
    display: flex;
    gap: 0.75rem;
}

.btn-view {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-view:hover {
    background: rgba(108, 92, 231, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

/* ---- Estado vacío ---- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    animation: fadeIn 0.8s ease-out;
}

.empty-state__icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state__title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state__text {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
    font-size: 0.9rem;
}

/* ---- Error state ---- */
.error-state {
    background: rgba(225, 112, 85, 0.08);
    border: 1px solid rgba(225, 112, 85, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: none;
    animation: shakeX 0.5s ease;
}

.error-state.active {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.error-state__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.error-state__message {
    color: var(--accent-danger);
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ---- Footer ---- */
.footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-subtle);
    margin-top: 2rem;
}

.footer__text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- Animaciones de entrada ---- */
@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);
    }
}

/* Stagger para tarjetas */
.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.10s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.20s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.30s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.40s; }
.product-card:nth-child(9) { animation-delay: 0.45s; }
.product-card:nth-child(10) { animation-delay: 0.50s; }

/* ---- Spinner de carga ---- */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ---- Tooltip ---- */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
    border: 1px solid var(--border-glass);
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    .header__title {
        font-size: 1.75rem;
    }

    .header__subtitle {
        font-size: 0.95rem;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
    }

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

    .results-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .search-panel {
        padding: 1.25rem;
    }

    .actions-container {
        grid-template-columns: 1fr;
    }

    .analysis-options {
        grid-template-columns: 1fr;
    }

    .analysis-divider {
        justify-content: center;
        padding: 0.5rem 0;
    }

    .analysis-panel {
        padding: 1.25rem;
    }

    .expandable-item__top {
        grid-template-columns: auto 1fr auto;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .expandable-item__score {
        display: none;
    }

    .expandable-item__details {
        padding: 0 1rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem 0 2rem;
    }

    .header__title {
        font-size: 1.4rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .product-card__image-wrapper {
        height: 180px;
    }
}

/* ---- Panel de Análisis con IA ---- */
.analysis-panel {
    display: none;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
    animation: fadeInUp 0.6s ease-out;
}

.analysis-panel.active {
    display: block;
}

.analysis-options {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

.analysis-option {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.analysis-option .form-group {
    flex: 1;
}

.analysis-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.analysis-divider {
    display: flex;
    align-items: center;
    padding-top: 0.5rem;
}

.analysis-divider span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-analysis {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.85rem 1.5rem;
}

.btn-deep {
    background: linear-gradient(135deg, #e17055 0%, #fdcb6e 100%);
    box-shadow: 0 4px 15px rgba(225, 112, 85, 0.3);
}

.btn-deep:hover {
    box-shadow: 0 8px 30px rgba(225, 112, 85, 0.4);
}

.analysis-progress {
    display: none;
    margin-top: 1rem;
}

.analysis-progress.active {
    display: block;
}

/* ---- LLM Score en tarjetas de producto ---- */
.product-card__llm {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.25rem 0.5rem;
    z-index: 2;
}

.product-card__llm-value {
    font-size: 0.85rem;
    font-weight: 800;
    color: #a29bfe;
    font-variant-numeric: tabular-nums;
}

.product-card__llm-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-card__justificacion {
    font-size: 0.8rem;
    color: var(--text-accent);
    font-style: italic;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

/* ---- Lista Expandible (resultados análisis) ---- */
.result-section {
    display: none;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.result-section[style*="block"] {
    display: block;
}

.expandable-list {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.expandable-header {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-glass-strong);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.expandable-item {
    border-bottom: 1px solid var(--border-subtle);
    animation: fadeInUp 0.4s ease-out both;
}

.expandable-item:last-child {
    border-bottom: none;
}

.expandable-item__top {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.expandable-item__top:hover {
    background: var(--bg-card-hover);
}

.expandable-item__ranking {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-accent);
    width: 2.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.expandable-item__title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.expandable-item__price {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.expandable-item__score {
    font-size: 0.9rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-variant-numeric: tabular-nums;
    text-align: center;
    min-width: 3rem;
}

.llm-score--high {
    background: rgba(0, 184, 148, 0.2);
    color: #55efc4;
}
.llm-score--mid {
    background: rgba(253, 203, 110, 0.2);
    color: #fdcb6e;
}
.llm-score--low {
    background: rgba(225, 112, 85, 0.15);
    color: #e17055;
}
.llm-score--poor {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.expandable-item__toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: var(--transition-fast);
    font-family: inherit;
}

.expandable-item__toggle:hover {
    color: var(--text-primary);
}

.expandable-item__details {
    display: none;
    padding: 0 1.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.expandable-item__details.open {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.expandable-item__details p {
    margin-bottom: 0.5rem;
}

.expandable-item__details strong {
    color: var(--text-primary);
}

.expandable-item__details a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.expandable-item__details a:hover {
    text-decoration: underline;
}

/* ---- Scrollbar personalizado ---- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---- Selection ---- */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* ---- Dashboard de 3 Columnas ---- */
.dashboard-section {
    width: 100%;
    margin-top: 1rem;
    animation: fadeInUp 0.8s ease-out;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

.dashboard-col {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 75vh;
    box-shadow: var(--shadow-card);
    transition: border-color var(--transition-fast);
}

.dashboard-col:hover {
    border-color: rgba(108, 92, 231, 0.2);
}

.col-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1rem;
}

.col-header__icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: var(--bg-glass-strong);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.col-header__info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.col-header__info .col-header__subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.col-scroll-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-top: 0.5rem;
}

/* Scrollbar específico para las columnas */
.col-scroll-content::-webkit-scrollbar {
    width: 6px;
}

.col-scroll-content::-webkit-scrollbar-track {
    background: transparent;
}

.col-scroll-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.col-scroll-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Modificaciones de espaciado en grids internos */
.dashboard-col .products-grid {
    grid-template-columns: 1fr; /* Columna simple dentro del dashboard */
    gap: 1.25rem;
    margin-bottom: 0;
}

.dashboard-col .expandable-list {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.dashboard-col .expandable-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    backdrop-filter: blur(10px);
}

.dashboard-col .expandable-item:last-child {
    margin-bottom: 0;
}

.dashboard-col .expandable-header {
    display: none; /* Ocultar cabeceras duplicadas de listas */
}

.dashboard-col .sort-controls {
    margin-bottom: 0.75rem;
    justify-content: flex-end;
}

/* Responsive para Dashboard */
@media (max-width: 1024px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
    .dashboard-col {
        height: auto;
        max-height: 80vh;
    }
}

/* Expandable Item Rich Layout details */
.expandable-item__info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
}

.expandable-item__img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.expandable-item__img-placeholder {
    width: 50px;
    height: 50px;
    background: var(--bg-glass-strong);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.expandable-item__text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex-grow: 1;
}

.expandable-item__meta-row {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.expandable-item__justificacion-preview {
    font-size: 0.75rem;
    color: var(--text-accent);
    font-style: italic;
    margin-top: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
