/* 1. VARIABLES GLOBALES Y ESTILOS BASE  */
:root {
  --primary-color: #e35824;
  /* Nuevo Naranja corporativo */
  --primary-hover: #c4471b;
  --bg-color: #f5f4f1;
  /* Blanco roto premium */
  --text-main: #1a1a1a;
  --text-brown: #55443e;
  --text-muted: #8c857d;
  --border-color: #efeae0;
  --star-color: #edb418;
  /* Oro de la marca */
  --white: #ffffff;
  --font-family: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.5px;
}

a {
  text-decoration: none;
  color: inherit;
}

/* El contenedor principal donde vivirá nuestra SPA (Single Page Application) */
.contenedor-app {
  max-width: 900px;
  /* Centramos el diseño como si fuera una app tipo móvil/tablet para encajar con el mockup */
  margin: 0 auto;
  background-color: var(--bg-color);
  min-height: 100vh;
  position: relative;
}

/* 2. Navegación superior */
.navegacion-superior {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background-color: rgba(245, 244, 241, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #5c1809;
  letter-spacing: -1px;
}

.enlaces-nav {
  display: flex;
  gap: 2rem;
  font-weight: 500;
  color: var(--text-muted);
}

.item-enlace-nav {
  padding-bottom: 0.3rem;
  cursor: pointer;
}

.item-enlace-nav.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

.perfil-nav {
  color: var(--primary-color);
  font-size: 1.2rem;
  cursor: pointer;
}

/* Menú de usuario (Dropdown) */
.menu-usuario {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.item-menu-usuario {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  transition: background 0.2s;
  cursor: pointer;
}

.item-menu-usuario:hover {
  background: var(--bg-color);
}

/* Sub-nav específico para el formulario/detalles (Flecha hacia atrás) */
.back-nav {
  display: flex;
  align-items: center;
  padding: 1.5rem 2rem;
  font-weight: 700;
  font-size: 1.1rem;
  gap: 1rem;
  cursor: pointer;
}

.back-nav i {
  background: #eee;
  border-radius: 50%;
  padding: 8px 12px;
  font-size: 0.9rem;
}

/* 3. VISTA 1: Menú */
.cabecera-menu {
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.titulo-menu {
  font-size: 3rem;
  margin: 0;
}

.icono-avatar {
  width: 50px;
  height: 50px;
  background-color: #ffe8d6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Selector de Tabs */
.selector-pestanas {
  background-color: #f1f2f3;
  border-radius: 12px;
  display: flex;
  margin: 0 2rem 1.5rem 2rem;
  padding: 4px;
}

.btn-pestana {
  flex: 1;
  text-align: center;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.3s;
}

.btn-pestana.active {
  background-color: var(--white);
  color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Filtro */
.caja-filtros {
  margin: 0 2rem 1rem 2rem;
}

.btn-filtro-pildora {
  background: #f1f2f3;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Tarjeta de Producto (Lista) */
.lista-productos {
  padding: 0 2rem 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Encabezados de Categoría en la Carta */
.carta-seccion-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 1.5rem 0 0.5rem 0;
}

.carta-seccion-header:first-child {
  margin-top: 0;
}

.carta-seccion-linea {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  opacity: 0.3;
}

.carta-seccion-titulo {
  font-family: var(--font-family);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  white-space: nowrap;
}

.tarjeta-producto {
  display: flex;
  align-items: center;
  background: var(--white);
  cursor: pointer;
  border-radius: 24px;
  padding: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  border: 1px solid transparent;
}

.tarjeta-producto:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  border-color: var(--border-color);
}

.caja-imagen-producto {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.etiqueta-precio {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--primary-color);
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(227, 88, 36, 0.3);
}

.item-info {
  padding-left: 1.5rem;
  flex-grow: 1;
}

.titulo-producto {
  font-family: var(--font-family);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.etiqueta-recomendado {
  font-size: 0.65rem;
  font-weight: 700;
  color: #b05c2a;
  background: #fff3e0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  margin-bottom: 4px;
  border: 1px solid #ffe0b2;
}

.categoria-producto {
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.estadisticas-producto {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.icono-estrella {
  color: var(--star-color);
}

/* 4. VISTA 2: Detalle del producto */
.caja-imagen-hero {
  width: 100%;
  height: 350px;
  position: relative;
}

.imagen-hero {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Degradado blanco abajo */
.degradado-hero {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(to bottom, rgba(247, 248, 249, 0), rgba(247, 248, 249, 1));
}

.tarjeta-detalle {
  background: var(--white);
  margin: -60px 1.5rem 2rem 1.5rem;
  border-radius: 12px;
  padding: 2rem;
  position: relative;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.cabecera-detalle {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.titulo-detalle {
  font-size: 1.8rem;
  margin: 0;
  line-height: 1.2;
}

.precio-detalle {
  font-size: 1.5rem;
  font-weight: 700;
  color: #903008;
  margin-bottom: 0;
}

.subtitulo-detalle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
  display: block;
}

/* Etiquetas visuales circulares (Picante, Orgánico, etc.) */
.contenedor-etiquetas {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.elemento-etiqueta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.circulo-etiqueta {
  width: 45px;
  height: 45px;
  background-color: #f1efed;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #903008;
  font-size: 1.1rem;
}

.etiqueta-texto {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.descripcion-detalle {
  color: #4a4a4a;
  line-height: 1.6;
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Filtros Píldora */
.btn-filtro-cat,
.btn-filtro-alg {
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  background: #f1f2f3;
  color: var(--text-muted);
}

.btn-filtro-cat.active,
.btn-filtro-alg.active {
  background: var(--text-main) !important;
  color: white !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Rating Box */
.caja-puntuacion {
  background-color: var(--white);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
}

.nota-puntuacion {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-redondeado-borde {
  border: 1px solid var(--border-color);
  background: white;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-redondeado-borde:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* 5. VISTA 3: Formulario de valoración */
.contenedor-formulario {
  padding: 0 2rem 3rem 2rem;
}

.tarjeta-resumen-producto {
  background: #f1f2f3;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.imagen-resumen {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  object-fit: cover;
}

.categoria-resumen {
  font-size: 0.75rem;
  color: #b05c2a;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.titulo-resumen {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0.2rem 0;
}

.ubicacion-resumen {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Estrellas Interactivas */
.caja-estrellas {
  text-align: center;
  margin-bottom: 2.5rem;
}

.pregunta-estrella {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.estrellas-grandes {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.estrellas-grandes i {
  font-size: 2.5rem;
  color: #e2e2e2;
  cursor: pointer;
  transition: color 0.2s;
}

.estrellas-grandes i.active {
  color: var(--star-color);
}

.etiqueta-estrella {
  color: var(--text-muted);
  font-size: 0.9rem;
  min-height: 20px;
}

/* Caja de texto */
.etiqueta-opinion {
  font-weight: 700;
  margin-bottom: 0.8rem;
  display: block;
}

.area-opinion {
  width: 100%;
  background-color: #e5e6e8;
  border: none;
  border-radius: 12px;
  padding: 1.5rem;
  font-size: 1rem;
  min-height: 150px;
  resize: none;
  font-family: inherit;
}

.area-opinion:focus {
  outline: 2px solid var(--primary-color);
}

.pie-opinion {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  margin-bottom: 3rem;
}

/* Botón de envío naranja gigante */
.btn-enviar-naranja {
  background-color: var(--primary-color);
  color: white;
  width: 100%;
  border: none;
  border-radius: 30px;
  padding: 1.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: 0.3s;
}

.btn-enviar-naranja:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.texto-terminos {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
  line-height: 1.4;
}

/* Ocultar elementos para la lógica SPA */
.d-none {
  display: none !important;
}