/* assets/css/main.css */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #ffffff;
    --bg-secondary: #f5f5f7;
    --card-bg: #ffffff;
    --card-border: #d2d2d7;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --accent: #e50914;
    --green: #34c759;
    --red: #ff3b30;
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    line-height: 1.5;
    padding: 24px 16px 48px;
}

.shell {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   HEADER Y FILTROS
   ======================================== */

header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
}

header h1 {
    display: flex;
    align-items: center;
    justify-content: center; /* mantiene el centrado */
    gap: 14px; /* espacio entre logo y texto */
    flex-wrap: wrap; /* responsive */
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-secondary);
    font-size: .95rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tabs de modelos */
.tabs {
    display: inline-flex;
    background: var(--bg-secondary);
    border-radius: 999px;
    padding: 4px;
    border: 1px solid var(--card-border);
}

.tab {
    padding: 6px 18px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all .2s ease;
    border: 1px solid transparent;
}

.tab.active {
    background: var(--accent);
    color: #ffffff;
}

/* Select estándar (ordenación) */
select.filter-select {
    padding: 8px 14px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .2s ease;
}

select.filter-select:hover,
select.filter-select:focus {
    border-color: var(--accent);
    outline: none;
}

/* ========================================
   CUSTOM SELECT CON BANDERAS
   ======================================== */

.custom-select-wrapper {
    position: relative;
    display: inline-block;
}

.custom-select-trigger {
    padding: 8px 36px 8px 14px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    position: relative;
}

.custom-select-trigger:hover,
.custom-select-trigger.active {
    border-color: var(--accent);
}

.custom-select-trigger .fi {
    font-size: 1.2em;
}

.select-arrow {
    position: absolute;
    right: 12px;
    transition: transform .2s ease;
    pointer-events: none;
}

.custom-select-trigger.active .select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.custom-select-dropdown.open {
    display: block;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    transition: background .15s ease;
    font-size: .85rem;
    white-space: nowrap;
}

.custom-select-option:hover {
    background: var(--bg-secondary);
}

.custom-select-option.active {
    background: var(--bg-secondary);
    font-weight: 600;
}

.custom-select-option .fi {
    font-size: 1.2em;
    flex-shrink: 0;
}

/* Scrollbar del dropdown */
.custom-select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========================================
   BANDERAS (flag-icons) - NO SOBRESCRIBIR
   ======================================== */

/* NO establecer width/height en .fi base - rompe flag-icons */
.fi {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

/* Ajuste de tamaño SOLO en contextos específicos */
.custom-select-trigger .fi,
.custom-select-option .fi,
.meta-top .fi,
.detail-meta-line .fi {
    font-size: 1.2em; /* Controla el tamaño mediante font-size, no width/height */
}

/* ========================================
   GRID DE VEHÍCULOS
   ======================================== */

main {
    margin-top: 32px;
}

.list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

@media (min-width: 768px) {
    .list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .list {
        grid-template-columns: repeat(4, 1fr);
    }
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 16px;
}

.meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: .75rem;
    color: var(--text-secondary);
}

.title {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.price-main {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.price-change {
    font-size: .75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.price-change.up   { color: var(--red); }
.price-change.down { color: var(--green); }

.price-change svg {
    width: 8px;
    height: 8px;
}

.pill-row {
    font-size: .75rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill-row span {
    background: var(--bg-secondary);
    padding: 3px 8px;
    border-radius: 4px;
}

.empty {
    color: var(--text-secondary);
    font-size: .95rem;
    padding: 48px 16px;
    text-align: center;
}

/* ========================================
   DETALLE DEL VEHÍCULO
   ======================================== */

.breadcrumb {
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .9rem;
    transition: color .2s ease;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.detail-header {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 32px;
}

.detail-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.detail-meta-line {
    color: var(--text-secondary);
    font-size: .9rem;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
}

@media (max-width: 1024px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   SLIDER DE FOTOS
   ======================================== */

.detail-photos {
    position: relative;
}

.slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    aspect-ratio: 16 / 10;
}

.slider-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
}

.slider-item {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: background .2s ease;
    color: var(--text);
}

.slider-btn:hover {
    background: #fff;
}

.slider-prev { left: 16px; }
.slider-next { right: 16px; }

.slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background .2s ease;
}

.slider-dot.active,
.slider-dot:hover {
    background: #fff;
}

.no-photo {
    aspect-ratio: 16 / 10;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}



/* ========================================
   SIDEBAR DE INFO
   ======================================== */

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.price-card,
.specs-card,
.options-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
}

.price-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.price-current {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
}

.recommendation {
    font-size: .9rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 6px;
    text-align: center;
}

.recommendation.buy {
    background: #d1f4e0;
    color: #0d6832;
}

.recommendation.hold {
    background: #fff3cd;
    color: #856404;
}

.recommendation.wait {
    background: #f8d7da;
    color: #721c24;
}

.recommendation.confidence-high {
    border: 2px solid currentColor;
    font-weight: 700;
}

.recommendation.confidence-medium {
    border: 1px solid currentColor;
}

.recommendation.confidence-low {
    opacity: 0.7;
}

.price-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.price-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: .75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.price-drops {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.drop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drop-label {
    font-size: .85rem;
    color: var(--text-secondary);
}

.drop-value {
    font-size: .95rem;
    font-weight: 600;
}

.drop-item.positive .drop-value {
    color: var(--green);
}

.drop-item.negative .drop-value {
    color: var(--red);
}

.recommendation-box {
    padding: 16px;
    border-radius: 8px;
    font-size: .9rem;
    line-height: 1.6;
}

.recommendation-box.buy {
    background: #d1f4e0;
    color: #0d6832;
}

.recommendation-box.hold {
    background: #fff3cd;
    color: #856404;
}

.recommendation-box.wait {
    background: #f8d7da;
    color: #721c24;
}

.inventory-time,
.market-velocity {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.specs-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 16px;
    font-size: .9rem;
}

.specs-list dt {
    color: var(--text-secondary);
    font-weight: 500;
}

.specs-list dd {
    color: var(--text);
    margin: 0;
}

.specs-list .vin {
    font-family: 'Courier New', monospace;
    font-size: .8rem;
}

.options-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: .9rem;
}

.options-list li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  column-gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-secondary);
}


.options-list li:last-child {
    border-bottom: none;
}

.opt-name {
    color: var(--text);
}

.opt-price {
    font-weight: 600;
    color: var(--text-secondary);
}

/* ========================================
   GRÁFICA
   ======================================== */

.chart-section {
    grid-column: 1 / -1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 16px;
}

.chart-section canvas {
    max-height: 300px;
}

/* ========================================
   LIGHTBOX
   ======================================== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.lightbox-close:hover {
    color: var(--accent);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 3rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.4);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
}

@media (max-width: 640px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
}
.rec-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.rec-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9em;
}

.rec-badge.confidence-high {
    border: 2px solid currentColor;
}

.confidence-label {
    font-size: 0.85em;
    opacity: 0.8;
}

.rec-reason {
    margin: 0 0 15px 0;
    font-size: 1.05em;
}

.rec-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.metric {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.metric-icon {
    font-size: 1.2em;
}
/* ========================================
   BOTONERA ACCIONES VEHÍCULO
   ======================================== */

.actions-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

/* Base común */
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

/* Hover común */
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Botón principal – CPO */
.action-btn.primary {
    background: var(--accent);
    color: #ffffff;
}

/* Botón secundario – Tesla nuevo */
.action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--card-border);
}

/* Botón terciario – Alertas */
.action-btn.tertiary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px dashed var(--card-border);
}

.action-btn.tertiary:hover {
    background: var(--bg-secondary);
}

/* Texto secundario del botón */
.action-sub {
    font-size: .75rem;
    font-weight: 500;
    opacity: 0.8;
    margin-top: 2px;
}
.follow-banner {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #1e3a8a;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: .9rem;
    font-weight: 500;
}
/* ========================================
   Botón "Seguir este coche" con ayuda
   ======================================== */

.follow-btn {
    justify-content: space-between;
    gap: 8px;
}

/* Texto del botón */
.follow-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Contenedor del ? */
.follow-help-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Icono ? */
.follow-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    font-size: .75rem;
    font-weight: 700;
    cursor: help;
    background: #fff;
    color: var(--text-secondary);
}

/* Tooltip */
.follow-tooltip {
    position: absolute;
    bottom: 130%;
    right: 0;
    width: 240px;
    background: #1d1d1f;
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: .8rem;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease;
    z-index: 20;
}

/* Flecha */
.follow-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 10px;
    border-width: 6px;
    border-style: solid;
    border-color: #1d1d1f transparent transparent transparent;
}

/* Mostrar tooltip */
.follow-help-icon:hover + .follow-tooltip,
.follow-help-icon:focus + .follow-tooltip {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
/* ========================================
   Badge "En seguimiento" en listado
   ======================================== */

.card {
    position: relative; /* necesario para el badge */
}

.follow-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    font-size: .7rem;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
    pointer-events: none;
}
.follow-info {
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: #1d3b8b;
    background: #eef4ff;
    border-radius: 8px;
}

/* =====================================================
   SPECIFICATIONS – iconos (versión limpia y definitiva)
   ===================================================== */

.specs-list.specs-with-icons dt {
  padding-left: 22px;
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 14px 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Mapeo de iconos (alineado con /assets/icons) */
.specs-list.specs-with-icons .icon-year {
  background-image: url('/assets/icons/calendar.svg');
}

.specs-list.specs-with-icons .icon-drivetrain {
  background-image: url('/assets/icons/drivetrain.svg');
}

.specs-list.specs-with-icons .icon-paint {
  background-image: url('/assets/icons/paint.svg');
}

.specs-list.specs-with-icons .icon-interior {
  background-image: url('/assets/icons/interior.svg');
}

.specs-list.specs-with-icons .icon-wheels {
  background-image: url('/assets/icons/wheels.svg');
}

.specs-list.specs-with-icons .icon-vin {
  background-image: url('/assets/icons/vin.svg');
}


/* =====================================================
   OPTIONS & EXTRAS – iconos por elemento
   ===================================================== */

.options-with-icons li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.opt-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.75;
}

/* Iconos disponibles */
.icon-cpu-chip    { background-image: url('/assets/icons/cpu-chip.svg'); }
.icon-wifi        { background-image: url('/assets/icons/wifi.svg'); }
.icon-sun         { background-image: url('/assets/icons/sun.svg'); }
.icon-square-3-stack-3d { background-image: url('/assets/icons/square-3-stack-3d.svg'); }
.icon-cog         { background-image: url('/assets/icons/cog.svg'); }
.icon-plus-circle { background-image: url('/assets/icons/plus-circle.svg'); }


/* =====================================================
   OPTIONS – icono en el título
   ===================================================== */

.card-title.with-icon::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.75;
}

.icon-options::before {
  background-image: url('/assets/icons/sparkles.svg');
}
.page-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.brand-inline img {
  height: clamp(36px, 6vw, 80px);
  width: auto;
  opacity: 0.8;
}

.brand-inline:hover img {
  opacity: 1;
}

.back-link {
  font-size: 0.9rem;
  color: #6e6e73;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}
.hero-logo {
  height: clamp(44px, 5.5vw, 65px); /* más grande, proporcional al texto */
  margin-bottom: 0; /* quita el margen inferior */
  opacity: 0.9; /* un poco más visible */
  flex-shrink: 0; /* evita que se comprima en móvil */
}
.action-btn.disabled {
    background: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.action-btn.disabled:hover {
    background: #9ca3af !important;
}
.catalog-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin: 1.5rem 0;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.015);
    border-radius: 6px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.stat-dot {
    width: 4px;
    height: 4px;
    background: #e82127;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-value {
    font-weight: 600;
    color: #171a20;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.stat-label {
    color: #5c5e62;
    font-size: 0.9rem;
    font-weight: 400;
}

@media (max-width: 600px) {
    .catalog-stats {
        flex-direction: column;
        gap: 1rem;
    }
}
.confidence-label-high {
    color: #166534;      /* verde */
    font-weight: 600;
}

.confidence-label-medium {
    color: #92400e;      /* ámbar */
}

.confidence-label-low {
    color: #991b1b;      /* rojo suave */
    font-style: italic;
}
.rec-separator {
    color: #6b7280;
}

/* ================================
   Google Translate – integrado con filtros
   ================================ */

#google_translate_element {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 1000;
}

/* Contenedor interno */
#google_translate_element .goog-te-gadget {
  font-size: 0; /* elimina textos residuales */
}

/* Select de Google */
#google_translate_element select.goog-te-combo {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  height: 36px;
  padding: 0 36px 0 12px;

  border-radius: 999px; /* igual que tus pills */
  border: 1px solid #d2d2d7;
  background-color: #ffffff;

  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1d1d1f;

  cursor: pointer;

  /* Flecha similar a tus selects */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236e6e73' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

/* Hover como tus filtros */
#google_translate_element select.goog-te-combo:hover {
  border-color: #b0b0b5;
}

/* Focus limpio */
#google_translate_element select.goog-te-combo:focus {
  outline: none;
  border-color: #e50914; /* rojo Tesla */
}

/* Ocultar branding textual (NO el icono flotante del iframe) */
#google_translate_element .goog-logo-link,
#google_translate_element .goog-te-gadget span {
  display: none !important;
}

/* Forzar tipografía correcta en Google Translate */
#google_translate_element select.goog-te-combo {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  text-transform: uppercase;
}

.slider-group {
    flex-direction: column;
    align-items: stretch;
    min-width: 220px;
}

.slider-values {
    display: flex;
    justify-content: center;
    gap: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

/* Mantener accent-color SOLO para sliders simples */
.filters > .filter-group:not(.slider-group) input[type="range"] {
    accent-color: var(--accent);
}
/* Desactivar accent-color en sliders dobles Tesla-like */
.slider-group input[type="range"] {
    accent-color: unset;
}

.range-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.range-inputs input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    font-size: .85rem;
    text-align: center;
}

.range-slider {
    position: relative;
    height: 24px;
}

.range-slider input[type="range"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    pointer-events: none;
    appearance: none;
    background: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}
.range-slider {
    position: relative;
    height: 28px;
}

.range-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    transform: translateY(-50%);
}

.range-fill {
    position: absolute;
    top: 50%;
    height: 6px;
    background: var(--accent);
    border-radius: 999px;
    transform: translateY(-50%);
}

.range-slider input[type="range"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 28px;
    background: none;
    pointer-events: none;
    appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #0a66c2;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}

.range-slider input[type="range"]::-webkit-slider-runnable-track {
    background: none;
}
/* IMPORTANTE: eliminar accent-color global */
input[type="range"] {
    accent-color: unset;
}

/* === TESLA-LIKE SLIDERS ONLY === */

.tesla-slider .range-track {
    background: #e5e7eb; /* gris claro */
}

.tesla-slider .range-fill {
    background: #0a66c2; /* azul Tesla-like */
}

.tesla-slider input[type="range"]::-webkit-slider-runnable-track {
    background: none;
}

.tesla-slider input[type="range"]::-moz-range-track {
    background: none;
}

/* Asegurar que el track nativo no pinta color */
.tesla-slider input[type="range"] {
    accent-color: transparent;
    background: none;
}
/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    margin-top: 64px;
    padding: 32px 16px 20px;
    background: var(--bg-secondary);
    border-top: 2px solid var(--card-border);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
}

.footer-col h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.footer-col p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.footer-muted {
    opacity: 0.75;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    margin-bottom: 8px;
}

.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer a:hover {
    color: var(--accent);
}

.footer-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 6px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.footer-bottom {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 600px) {
    .footer-inner {
        gap: 24px;
    }
}
/* ========================================
   STATIC CONTENT PAGES
   ======================================== */

.content-page {
    max-width: 800px;
    margin: 0 auto;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
}

.content-page p {
    margin-bottom: 16px;
}

.content-page .muted {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ========================================
   Best Opportunities – HOT DEAL badge
   ======================================== */

.hot-deal-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-size: .7rem;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 6px;
    z-index: 5;
    pointer-events: none;
}

.best-opps-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin: 12px 0 18px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    font-size: .9rem;
}

.best-opps-cta a {
    margin-left: auto;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.pill.price-drop {
    color: #15803d;
    background: #dcfce7;
    font-weight: 600;
}

.pill.below-market {
    color: #374151;
    background: #f3f4f6;
}
/* Precio muy por debajo de mercado (normal) */
.pill.below-market {
    background: #f3f4f6;
    color: #374151;
}

/* Precio extremadamente bajo vs mercado */
.pill.below-market.strong {
    background: #ecfdf5;
    color: #047857;
    font-weight: 600;
}

.card:has(.price-drop) .pill.below-market {
    opacity: 0.85;
}

.breadcrumb {
    font-size: .85rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb span {
    margin: 0 4px;
}
.best-opps-cta {
    position: relative;
    cursor: pointer;
}

.best-opps-cta .stretched-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Estilo visual del texto tipo link */
.best-opps-cta .cta-link-text {
    margin-left: auto;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

/* Feedback visual */
.best-opps-cta:hover {
    background: #fff1e6;
}

.best-opps-cta:hover .cta-link-text {
    text-decoration: underline;
}

.price-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    line-height: 1;
}

/* Bajada */
.price-change.down {
    background: #dcfce7;
    color: #15803d;
}

/* Subida */
.price-change.up {
    background: #fee2e2;
    color: #b91c1c;
}
.telegram-banner {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 20px auto 28px;
    text-align: center;
    max-width: 900px;
}

.telegram-banner-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 6px;
}

.telegram-banner-text {
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 12px;
    line-height: 1.4;
}

.telegram-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.telegram-links a {
    background: #1d4ed8;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}

.telegram-links a:hover {
    background: #1e40af;
}