/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: #fff;
  color: #2e2e2e;
  line-height: 1.6;
  padding-top: 120px;
  /* Para que el contenido no quede debajo del menú fijo */
}

a {
  text-decoration: none;
  color: #6a0dad;
}

/* Menú principal */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #fff;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.main-nav {
  margin: 10px 40px;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.main-nav ul li {
  position: relative;
  display: inline-block;
}

.main-nav a {
  text-decoration: none;
  color: #6a0dad;
}

.main-nav a:hover {
  color: #8a2be2;
}

/* Banner */
.logo img {
  height: 100px;
  padding: 2px;
  margin: auto 20px;
}

.ad-container {
  max-width: 1200px;
  margin: 15px auto;
  padding: 0 20px;
  text-align: center;
  min-height: 90px;
}

.recipe-name {
  font-size: 1.2em;
  font-weight: bold;
}

/* Secciones */
.content {
  max-width: 1200px;
  margin: 15px auto;
  padding: 0 20px;
}

.section {
  margin-bottom: 40px;
}

.section h2 {
  color: #6a0dad;
  border-bottom: 2px solid #6a0dad;
  padding-bottom: 5px;
  margin-bottom: 20px;
}

h1 {
  color: #6a0dad;
  font-size: 1.8rem;
  margin-bottom: 25px;
  border-bottom: 3px solid #6a0dad;
  padding-bottom: 10px;
}

/* Profesiones y Expansiones(tarjetas) */
.profesiones {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.card {
  padding: 20px;
  text-align: center;
  flex: 1 1 250px;
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card img {
  height: 150px;
}

.card h3 {
  color: #6a0dad;
  margin-bottom: 10px;
}

.card p {
  color: #2e2e2e;
}

/* Expansiones (tarjetas) */
.expansiones {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.card-expansion {
  background-color: #dcd0ff;
  padding: 20px;
  text-align: center;
  color: #6a0dad;
  cursor: pointer;
  flex: 1 1 180px;
  transition: transform 0.3s;
}

.card-expansion:hover {
  background-color: #c5b3ff;
  transform: translateY(-5px);
}

/* Página de Aviso Legal */
.legal-section {
  margin-bottom: 30px;
}

.legal-content {
  line-height: 1.8;
  font-size: 0.95rem;
}

.legal-content p {
  margin-bottom: 12px;
}

.legal-content ul {
  margin: 10px 0 15px 25px;
}

.legal-content ul li {
  margin-bottom: 6px;
}

.legal-content h3 {
  margin-top: 18px;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.legal-content .materials-table td {
  padding: 8px;
  border-bottom: 1px solid #e0d4ff;
  font-size: 0.9rem;
}

body.dark-mode .legal-content .materials-table td {
  border-bottom-color: rgba(187, 159, 255, 0.15);
}

/* Footer */
footer {
  text-align: center;
  margin: 20px auto;
}

/* Tabla de materiales */
.materials-table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
  margin-top: 10px;
}

.materials-table thead tr {
  border-bottom: 2px solid #6a0dad;
}

body.dark-mode .materials-table thead tr {
  border-bottom-color: #bb9fff;
}

.materials-table th {
  padding: 5px;
  cursor: pointer;
  user-select: none;
}

/* ===================== */
/* 🌙 MODO OSCURO */
/* ===================== */

body.dark-mode {
  background-color: #000;
  color: #e4e4e4;
}

body.dark-mode .main-header {
  background-color: #000;
}

body.dark-mode .main-nav a,
body.dark-mode .hero p,
body.dark-mode .card p {
  color: #fff;
}

body.dark-mode h1,
body.dark-mode h3,
body.dark-mode h2,
body.dark-mode .section h3,
body.dark-mode .section h2 {
  color: #bb9fff;
}

body.dark-mode .card-expansion {
  background-color: #2a213f;
  color: #bb9fff;
}

body.dark-mode .card-expansion:hover {
  background-color: #372b5a;
}


#darkModeToggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

/* ===================== */
/* 📱 RESPONSIVE DESIGN  */
/* ===================== */

/* --- Tabla responsive --- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- TABLET (max 1024px) --- */
@media (max-width: 1024px) {
  .content {
    padding: 0 15px;
  }

  .card-expansion {
    flex: 1 1 150px;
    padding: 15px;
  }

  .card {
    flex: 1 1 200px;
  }
}

/* --- MOBILE (max 768px) --- */
@media (max-width: 768px) {
  body {
    padding-top: 96px;
  }

  /* Header */
  .main-header {
    padding: 8px 15px;
  }

  .logo img {
    height: 80px;
    margin: 5px 0;
  }

  .main-nav {
    margin: 0 10px;
  }

  /* Nav siempre visible */
  .main-nav ul {
    gap: 12px;
  }

  /* Titulos */
  h1 {
    font-size: 1.4rem;
    margin-bottom: 18px;
  }

  .section h2 {
    font-size: 1.2rem;
  }

  /* Cards de profesiones */
  .profesiones {
    gap: 10px;
  }

  .card {
    padding: 10px;
    flex: 1 1 140px;
  }

  .card img {
    height: 120px;
    width: auto;
  }

  .card h3 {
    font-size: 0.9rem;
  }

  /* Cards de expansiones */
  .card-expansion {
    flex: 1 1 130px;
    padding: 14px 10px;
    font-size: 0.9rem;
  }

  /* Glass filter (sticky slider) */
  .leveling-wrapper-glass {
    top: 96px;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
  }

  .glass-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .glass-title {
    font-size: 1rem;
  }

  .glass-badge {
    font-size: 0.85rem;
    padding: 4px 12px;
  }

  /* Recipe steps */
  .custom-step {
    padding: 12px 14px;
    margin-bottom: 14px;
  }

  .custom-step strong {
    font-size: 1rem;
  }

  .recipe-name {
    font-size: 1em;
  }

  /* Section toggles */
  .section-toggle {
    padding: 10px 14px;
  }

  .section-toggle-title {
    font-size: 1.05rem;
  }

  /* Materials table */
  #materialsTable,
  .materials-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Legal page */
  .legal-content {
    font-size: 0.88rem;
  }

  .legal-content .materials-table {
    font-size: 0.8rem;
  }

  /* Ad container */
  .ad-container {
    padding: 0 10px;
    min-height: 50px;
  }
}

/* --- SMALL MOBILE (max 480px) --- */
@media (max-width: 480px) {
  body {
    padding-top: 96px;
  }

  h1 {
    font-size: 1.15rem;
    margin-bottom: 14px;
    padding-bottom: 8px;
  }

  .section h2 {
    font-size: 1.05rem;
  }

  .content {
    padding: 0 10px;
  }

  /* Cards en 2 columnas */
  .profesiones {
    gap: 8px;
  }

  .card {
    flex: 1 1 120px;
    padding: 8px;
  }

  .card img {
    height: 90px;
  }

  .card h3 {
    font-size: 0.8rem;
    margin-bottom: 5px;
  }

  /* Expansiones en 2 columnas */
  .card-expansion {
    flex: 1 1 110px;
    padding: 12px 8px;
    font-size: 0.82rem;
  }

  /* Glass slider */
  .leveling-wrapper-glass {
    top: 96px;
    padding: 10px 12px;
  }

  .glass-title {
    font-size: 0.9rem;
  }

  .glass-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .glass-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }

  /* Recipe steps compactos */
  .custom-step {
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  .custom-step strong {
    font-size: 0.92rem;
  }

  .recipe-name {
    font-size: 0.92em;
  }

  /* Toggle headers */
  .section-toggle-title {
    font-size: 0.95rem;
  }

  .section-toggle-icon {
    font-size: 1rem;
  }

  /* Footer */
  footer {
    font-size: 0.8rem;
    padding: 10px;
  }
}

/* ===================== */
/* 💎 FILTRO PREMIUM GLASS */
/* ===================== */
.leveling-wrapper-glass {
  position: sticky;
  top: 130px;
  z-index: 100;
  margin-bottom: 30px;
  padding: 20px 25px;
  border-radius: 16px;
  background: rgba(243, 232, 255, 0.85);
  /* #f3e8ff semi-transparente */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(106, 13, 173, 0.15);
  box-shadow: 0 8px 32px rgba(106, 13, 173, 0.15);
  transition: all 0.3s ease;
}

body.dark-mode .leveling-wrapper-glass {
  background: rgba(42, 33, 63, 0.75);
  /* #2a213f semi-transparente */
  border: 1px solid rgba(187, 159, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.glass-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  /* para móviles */
  gap: 10px;
}

.glass-title {
  border: none !important;
  margin: 0 !important;
  font-size: 1.3rem;
  color: #6a0dad;
  font-weight: 800;
}

body.dark-mode .glass-title {
  color: #bb9fff;
}

.glass-badge {
  background: linear-gradient(135deg, #6a0dad, #9b51e0);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(106, 13, 173, 0.4);
}

body.dark-mode .glass-badge {
  background: linear-gradient(135deg, #9b51e0, #bb9fff);
  color: #1a1a2e;
  box-shadow: 0 4px 15px rgba(187, 159, 255, 0.3);
}

.glass-badge span {
  font-size: 1.2rem;
  margin-left: 4px;
}

.glass-slider-container {
  width: 100%;
}

.glass-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(106, 13, 173, 0.2);
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

body.dark-mode .glass-slider {
  background: rgba(187, 159, 255, 0.2);
}

.glass-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6a0dad;
  border: 3px solid #fff;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(106, 13, 173, 0.6);
  transition: transform 0.1s;
}

.glass-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

body.dark-mode .glass-slider::-webkit-slider-thumb {
  background: #bb9fff;
  border-color: #2a213f;
  box-shadow: 0 0 12px rgba(187, 159, 255, 0.6);
}

.glass-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6a0dad;
  border: 3px solid #fff;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(106, 13, 173, 0.6);
}

body.dark-mode .glass-slider::-moz-range-thumb {
  background: #bb9fff;
  border-color: #2a213f;
  box-shadow: 0 0 12px rgba(187, 159, 255, 0.6);
}

/* Indicadores de orden en tabla de materiales */
.sort-indicator {
  color: #6a0dad;
  font-size: 14px;
}

body.dark-mode .sort-indicator {
  color: #bb9fff;
}

/* ===================== */
/* 📜 TARJETAS DE RECETAS (STEPS) */
/* ===================== */
.custom-step {
  background: #fdfbff;
  border-left: 5px solid #6a0dad;
  padding: 15px 20px;
  margin-top: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  line-height: 1.6;
}

.custom-step:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(106, 13, 173, 0.15);
}

.custom-step strong {
  display: inline-block;
  font-size: 1.15rem;
  color: #6a0dad;
  margin-bottom: 8px;
  border-bottom: 2px solid rgba(106, 13, 173, 0.2);
  padding-bottom: 6px;
  width: 100%;
}

body.dark-mode .custom-step {
  background: #2a213f;
  border-left-color: #bb9fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .custom-step:hover {
  box-shadow: 0 6px 15px rgba(187, 159, 255, 0.2);
}

body.dark-mode .custom-step strong {
  color: #bb9fff;
  border-bottom-color: rgba(187, 159, 255, 0.2);
}

/* Identificador visual visual para Rutas Alternativas */
.custom-step[data-alt="true"] {
  border-left-color: #f39c12;
}

body.dark-mode .custom-step[data-alt="true"] {
  border-left-color: #f1c40f;
}

.custom-step[data-alt="true"] strong {
  color: #d35400;
  border-bottom-color: rgba(243, 156, 18, 0.2);
}

body.dark-mode .custom-step[data-alt="true"] strong {
  color: #f1c40f;
  border-bottom-color: rgba(241, 196, 15, 0.2);
}

/* ===================== */
/* 📦 TOGGLE DE SECCION GENÉRICO */
/* ===================== */
.section-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 12px 20px;
  background: rgba(106, 13, 173, 0.08);
  /* Fondo purpura super sutil */
  border-radius: 8px;
  margin-bottom: 15px;
  transition: background 0.3s;
}

.section-toggle:hover {
  background: rgba(106, 13, 173, 0.15);
}

body.dark-mode .section-toggle {
  background: rgba(187, 159, 255, 0.1);
}

body.dark-mode .section-toggle:hover {
  background: rgba(187, 159, 255, 0.18);
}

.section-toggle-title {
  margin: 0 !important;
  border: none !important;
  font-size: 1.3rem;
  color: #6a0dad;
}

body.dark-mode .section-toggle-title {
  color: #bb9fff;
}

.section-toggle-icon {
  font-size: 1.2rem;
  color: #6a0dad;
  transition: transform 0.3s ease;
}

body.dark-mode .section-toggle-icon {
  color: #bb9fff;
}

.section-content {
  display: block;
}

/* Rotación del icono si está colapsado */
.section-toggle.collapsed .section-toggle-icon {
  transform: rotate(-90deg);
}

/* ===================== */
/* 🍪 BANNER DE COOKIES  */
/* ===================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner-visible {
  transform: translateY(0);
}

.cookie-banner-hidden {
  transform: translateY(100%);
}

.cookie-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(106, 13, 173, 0.12);
  box-shadow: 0 -4px 30px rgba(106, 13, 173, 0.15), 0 4px 15px rgba(0, 0, 0, 0.08);
}

body.dark-mode .cookie-content {
  background: rgba(30, 22, 50, 0.92);
  border-color: rgba(187, 159, 255, 0.15);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4), 0 4px 15px rgba(187, 159, 255, 0.1);
}

.cookie-text {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.cookie-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.cookie-text p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #333;
}

body.dark-mode .cookie-text p {
  color: #ddd;
}

.cookie-text a {
  color: #6a0dad;
  font-weight: 600;
  text-decoration: underline;
}

body.dark-mode .cookie-text a {
  color: #bb9fff;
}

.cookie-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: linear-gradient(135deg, #6a0dad, #9b51e0);
  color: #fff;
  box-shadow: 0 4px 12px rgba(106, 13, 173, 0.35);
}

.cookie-btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(106, 13, 173, 0.45);
}

body.dark-mode .cookie-btn-accept {
  background: linear-gradient(135deg, #9b51e0, #bb9fff);
  color: #1a1a2e;
}

.cookie-btn-reject {
  background: transparent;
  color: #6a0dad;
  border: 2px solid rgba(106, 13, 173, 0.3);
}

.cookie-btn-reject:hover {
  border-color: #6a0dad;
  background: rgba(106, 13, 173, 0.05);
}

body.dark-mode .cookie-btn-reject {
  color: #bb9fff;
  border-color: rgba(187, 159, 255, 0.3);
}

body.dark-mode .cookie-btn-reject:hover {
  border-color: #bb9fff;
  background: rgba(187, 159, 255, 0.08);
}

/* Responsive: apilar en móvil */
@media (max-width: 600px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
    padding: 18px 20px;
  }

  .cookie-text {
    flex-direction: column;
    align-items: center;
  }

  .cookie-buttons {
    width: 100%;
    justify-content: center;
  }

  .cookie-btn {
    flex: 1;
  }
}