/* Estilo general */
body {
  font-family: 'Inter', sans-serif;
  background-color: #f7f7f7;
  color: #222;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.main-header {
  background-color: #fff;
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #eaeaea;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: #ff385c;
  letter-spacing: -0.5px;
}

.main-nav {
  display: flex;
  gap: 20px;
}

.nav-link {
  text-decoration: none;
  color: #555;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #ff385c;
}

/* Contenido Principal */
.content-wrapper {
  flex: 1;
  padding: 40px 20px;
  max-width: 660px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.results-page-wrapper {
  max-width: 1200px;
}

/* Footer Línea Legal */
.main-footer {
  background-color: #222;
  color: #aaa;
  padding: 30px 40px;
  margin-top: auto;
  font-size: 12px;
  text-align: center;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
}

.amazon-disclaimer {
  line-height: 1.5;
  margin-bottom: 15px;
}

.footer-links {
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.footer-links a {
  color: #ddd;
  text-decoration: none;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:not(:last-child)::after {
  content: "|";
  position: absolute;
  right: -5px;
  color: #555;
}

/* Necesitamos posición relativa en el enlace para el seudoelemento absoluto, 
   o simplemente usar relative en pseudo: */
.footer-links a {
  position: relative;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.copyright {
  margin: 0;
  opacity: 0.7;
}

/* Encabezados */
h1 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  font-weight: 600;
}

/* Prioridades */
ul {
  list-style: none;
  padding: 0;
  margin-bottom: 30px;
}

li {
  background: #fff;
  border: 1px solid #ddd;
  padding: 12px 15px;
  margin-bottom: 10px;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

li.dragging {
  opacity: 0.6;
  transform: scale(1.03);
  background-color: #ffe3e3;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.drag-handle {
  cursor: grab;
  color: #aaa;
  font-size: 20px;
  user-select: none;
  padding-right: 5px;
}

.drag-handle:active {
  cursor: grabbing;
}

ul.animated-sort li {
  transition: all 0.4s ease;
}

.order-number {
  margin-right: 10px;
  font-weight: bold;
}

/* Tooltips */
.info-icon {
  margin-left: auto;
  flex-shrink: 0;
  cursor: pointer;
  color: #888;
  font-weight: bold;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  text-align: center;
  line-height: 18px;
  font-size: 12px;
  background: #eee;
  position: relative;
}

.tooltip {
  display: none;
  position: absolute;
  top: 25px;
  left: 0;
  background: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
  width: 220px;
  z-index: 10;
}

.info-icon.active .tooltip,
.info-icon:hover .tooltip {
  display: block;
}

/* Checkbox marcas */
.marca-options {
  display: none;
  margin-top: 15px;
  width: 100%;
  padding-top: 15px;
  border-top: 1px dashed #eee;
}

/* Aplicaremos grid al contenedor de las marcas cuando esté visible */
.marca-options.visible {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.marca-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  background-color: #f9f9f9;
  border: 1px solid #eee;
  transition: all 0.2s;
}

.marca-options label:hover {
  background-color: #fff0f2;
  border-color: #ff385c;
  color: #ff385c;
}

.marca-options input[type="checkbox"] {
  accent-color: #ff385c;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Botones generales */
button {
  background-color: #ff385c;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background-color: #e03150;
}

/* Submit Button */
.submit-button {
  margin-top: 30px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #ff385c 0%, #e03150 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 15px rgba(255, 56, 92, 0.3);
  transition: all 0.3s ease;
}

.submit-button:hover {
  background: linear-gradient(135deg, #e03150 0%, #c41e42 100%);
  box-shadow: 0 6px 20px rgba(255, 56, 92, 0.4);
  transform: translateY(-2px);
}

/* ======= Estilos de la página de resultados ======= */
.results-header {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto 20px;
  display: flex;
  justify-content: flex-start;
}

.back-button {
  background-color: #ff385c;
  color: white;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-block;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(255, 56, 92, 0.2);
}

.back-button:hover {
  background-color: #e03150;
  transform: translateY(-2px);
}

.results-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

.result-card {
  display: flex;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  /* Suave sombra premium */
  overflow: hidden;
  margin-bottom: 30px;
  max-width: 1100px;
  width: 100%;
  box-sizing: border-box;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.result-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.result-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 30px;
  box-sizing: border-box;
}

.result-info-grid {
  padding: 30px;
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  align-items: center;
}

.features-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid #eee;
  padding-right: 30px;
}

.reasoning-column {
  display: flex;
  height: 100%;
  align-items: center;
}

.features-column h2 {
  margin-top: 0;
  font-size: 24px;
  font-weight: 700;
  color: #111;
  margin-bottom: 15px;
}

.features-list p {
  margin: 8px 0;
  color: #555;
  font-size: 15px;
  line-height: 1.5;
}

.features-list p strong {
  color: #333;
  font-weight: 600;
}

.ai-reasoning {
  background: linear-gradient(135deg, rgba(255, 56, 92, 0.05) 0%, rgba(255, 56, 92, 0.1) 100%);
  border-left: 4px solid #ff385c;
  padding: 15px 20px;
  border-radius: 0 8px 8px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
}

.ai-icon {
  font-size: 1.2rem;
  margin-top: -2px;
}

.ai-reasoning p {
  margin: 0;
  font-size: 14px;
  color: #444;
}

.tech-link {
  color: #ff385c;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed #ff385c;
  transition: all 0.2s ease;
  cursor: pointer;
}

.tech-link:hover {
  color: #e03150;
  border-bottom: 1px solid #e03150;
  background-color: rgba(255, 56, 92, 0.05);
}

.price {
  color: #111;
  font-weight: 800;
  font-size: 24px;
  margin: 0 0 10px;
  background: -webkit-linear-gradient(45deg, #ff385c, #bd1e59);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.price-action {
  display: flex;
  flex-direction: column;
  margin-top: 15px;
}

.buy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: #ff9900;
  color: #111;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
  transition: all 0.3s ease;
  width: fit-content;
}

.buy-link:hover {
  background: #e38800;
  box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
  transform: translateY(-2px);
}

.az-icon {
  font-size: 1.2rem;
}

/* Spinner & Loader */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 50px;
  color: #666;
  font-weight: bold;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #ff385c;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Badges & Image styling */
.image-wrapper {
  position: relative;
  width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
}

.badge-top {
  position: absolute;
  top: 15px;
  left: 15px;
  background: linear-gradient(45deg, #ffd700, #ff8c00);
  color: #111;
  font-weight: 800;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

@media (max-width: 768px) {
  .content-wrapper {
    padding: 20px 15px;
  }

  .result-card {
    flex-direction: column;
  }

  .image-wrapper {
    width: 100%;
    height: 250px;
    border-bottom: 1px solid #f0f0f0;
  }

  .result-info-grid {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 15px;
  }

  .features-column {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
  }

  .buy-link {
    width: 100%;
    box-sizing: border-box;
  }

  .main-header {
    flex-direction: column;
    padding: 15px 20px;
    gap: 15px;
  }

  .footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .footer-links a {
    margin: 0;
    padding: 10px 0;
    width: 100%;
    justify-content: center;
    border-bottom: 1px solid #333;
  }
  
  .footer-links a:last-child {
    border-bottom: none;
  }

  .footer-links a::after {
    display: none;
  }
}