.mercado-secundario-card {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Contenedor del icono */
.mercado-secundario-icon-container {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}

/* Icono principal */
.mercado-secundario-icon {
  width: 48px;
  height: 48px;
  color: #0F52AA;
}

/* Icono de información */
.mercado-secundario-info-icon {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  background: #f8f9fa;
  border-radius: 50%;
  cursor: help;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mercado-secundario-info-icon svg {
  width: 12px;
  height: 12px;
  color: #6c757d;
}

/* Tooltip */
.mercado-secundario-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 10px 12px;
  background: #333;
  color: white;
  border-radius: 6px;
  font-size: 0.75rem;
  line-height: 1.3;
  white-space: normal;
  width: 180px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  word-wrap: break-word;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.mercado-secundario-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.mercado-secundario-info-icon:hover .mercado-secundario-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Botón principal con precio */
.mercado-secundario-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.8rem;
  font-size: 11px;
  font-weight: 600;
  border: 2px solid #ffffff;
  border-radius: 36px;
  background: linear-gradient(135deg, #0F52AA 0%, #0F52AA 100%);
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  transition: all 1s ease !important;
  text-align: center;
  box-sizing: border-box;
  width: 100%;
  box-shadow: none !important;
  margin-top: auto;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.4;
}

.mercado-secundario-btn:hover {
  background: linear-gradient(135deg, #167BFF 0%, #167BFF 100%);
  box-shadow: none !important;
  border: 2px solid #ffffff;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-2px);
}

.mercado-secundario-btn:active {
  box-shadow: none !important;
  border: 2px solid #ffffff;
  transform: translateY(0);
}

.btn-text {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
}

.btn-price {
  font-size: 9px;
  font-weight: 400;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
  margin-top: 2px;
}

/* Menú desplegable - VERSIÓN MEJORADA PARA NOMBRES COMPLETOS */
.mercado-secundario-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 400px; /* Un poco más ancho para nombres completos */
  max-width: 90vw;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  margin-top: 0.5rem;
  z-index: 10000;
  max-height: 500px;
  overflow-y: auto;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Ajuste para pantallas pequeñas */
@media (max-width: 480px) {
  .mercado-secundario-menu {
    width: 340px; /* Un poco más ancho en móvil */
    left: 0;
    transform: none;
    right: 0;
    margin-left: auto;
    margin-right: auto;
  }
}

.mercado-secundario-menu.show {
  display: block;
}

/* Secciones del menú */
.mercado-secundario-menu-section {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.mercado-secundario-menu-section:last-child {
  border-bottom: none;
}

.mercado-secundario-menu-section-title {
  display: block;
  padding: 0.25rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6c757d;
  background: #f0f0f0;
  letter-spacing: 0.5px;
}

/* Ítems del menú - OPTIMIZADO PARA NOMBRES COMPLETOS */
.mercado-secundario-menu-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s ease;
  position: relative;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.mercado-secundario-menu-item:last-child {
  border-bottom: none;
}

.mercado-secundario-menu-item:hover {
  background: #f8f9fa;
}

.menu-item-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.menu-item-text {
  flex: 1;
  text-align: left;
  font-size: 0.8rem; /* Reducido para nombres completos */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  padding-right: 4px;
  font-weight: 500;
}

.menu-item-price {
  font-size: 0.7rem; /* Reducido para nombres completos */
  font-weight: 600;
  color: #0F52AA;
  background: #e6f0ff;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0 2px;
  font-family: 'Courier New', monospace;
  letter-spacing: -0.5px;
}

.external-link-icon {
  font-size: 0.8rem;
  opacity: 0.5;
  margin-left: 2px;
  flex-shrink: 0;
  width: 16px;
  text-align: right;
}

/* Ítems deshabilitados */
.mercado-secundario-menu-item.disabled {
  color: #999;
  cursor: not-allowed;
  background: #f9f9f9;
}

.mercado-secundario-menu-item.disabled:hover {
  background: #f9f9fa;
}

.mercado-secundario-menu-item.disabled .menu-item-price {
  display: none;
}

/* Tooltip para ítems deshabilitados */
.mercado-secundario-menu-item.disabled {
  position: relative;
}

.mercado-secundario-menu-item.disabled:hover::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 6px 10px;
  background: #333;
  color: white;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  z-index: 10001;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.mercado-secundario-menu-item.disabled:hover::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: 2px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
  z-index: 10001;
  pointer-events: none;
}

/* Responsive mejorado para nombres completos */
@media (max-width: 480px) {
  .mercado-secundario-card {
    padding: 1rem;
    min-height: 180px;
  }
  
  .mercado-secundario-icon {
    width: 40px;
    height: 40px;
  }
  
  .mercado-secundario-btn {
    padding: 0.7rem 0.5rem;
  }
  
  .btn-text {
    font-size: 10px;
  }
  
  .btn-price {
    font-size: 8px;
    padding: 1px 6px;
  }
  
  .mercado-secundario-tooltip {
    width: 160px;
    font-size: 0.7rem;
    padding: 8px 10px;
    margin-bottom: 6px;
  }
  
  .mercado-secundario-menu {
    width: 320px;
    max-height: 350px;
  }
  
  .mercado-secundario-menu-item {
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    gap: 4px;
  }
  
  .menu-item-icon {
    width: 20px;
    font-size: 1rem;
  }
  
  .menu-item-text {
    font-size: 0.7rem; /* Aún más pequeño en móvil */
  }
  
  .menu-item-price {
    font-size: 0.6rem;
    padding: 1px 3px;
    max-width: 65px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Ajuste para tablets */
@media (min-width: 481px) and (max-width: 768px) {
  .mercado-secundario-btn {
    padding: 0.7rem 0.6rem;
  }
  
  .btn-text {
    font-size: 10px;
  }
  
  .btn-price {
    font-size: 8px;
  }
  
  .mercado-secundario-menu {
    width: 380px;
  }
  
  .menu-item-text {
    font-size: 0.75rem;
  }
  
  .menu-item-price {
    font-size: 0.65rem;
    padding: 2px 4px;
  }
}

@media (min-width: 769px) {
  .mercado-secundario-btn {
    padding: 0.75rem 1rem;
  }
  
  .btn-text {
    font-size: 11px;
  }
  
  .btn-price {
    font-size: 9px;
  }
  
  .menu-item-text {
    font-size: 0.8rem;
  }
  
  .menu-item-price {
    font-size: 0.7rem;
  }
}