/* ==========================================================================
   Fijate Tools - ¿Qué cocino hoy?
   Hojas de estilo canónicas, diseño premium, responsivo y modo cocina
   ========================================================================== */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta base modo oscuro (predeterminado) */
  --bg-base: #0b0f17;
  --bg-surface: #111827;
  --bg-card: #182234;
  --bg-card-hover: #1f2d44;
  --bg-input: #0f172a;
  
  --border-color: #27354a;
  --border-focus: #f97316;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-orange: #f97316;
  --accent-orange-hover: #ea580c;
  --accent-orange-glow: rgba(249, 115, 22, 0.25);
  
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-danger: #ef4444;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(249, 115, 22, 0.3);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;

  --border-color: #cbd5e1;
  --border-focus: #ea580c;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --accent-orange: #ea580c;
  --accent-orange-hover: #c2410c;
  --accent-orange-glow: rgba(234, 88, 12, 0.2);

  --color-success: #059669;
  --color-success-bg: rgba(5, 150, 105, 0.12);
  --color-warning: #d97706;
  --color-warning-bg: rgba(217, 119, 6, 0.12);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(234, 88, 12, 0.2);
}

/* Reset y estructura global canónica */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

.main-wrapper.tool-layout {
  margin-top: 1.5rem;
  margin-bottom: 3rem;
  flex: 1 0 auto;
}


/* ==========================================================================
   Navegación de pestañas de modo
   ========================================================================== */
.mode-tabs-container {
  margin-bottom: 1.5rem;
}

.mode-tabs-nav {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  scrollbar-width: none;
}
.mode-tabs-nav::-webkit-scrollbar {
  display: none;
}

.mode-tab-btn {
  flex: 1 1 0;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mode-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.mode-tab-btn.active {
  color: #ffffff;
  background: var(--accent-orange);
  box-shadow: 0 2px 8px var(--accent-orange-glow);
}

.tab-badge {
  background: rgba(0, 0, 0, 0.25);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
}

.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Pestaña 1: Selector de Nevera y Despensa
   ========================================================================== */
.nevera-hero-card, .roulette-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.nevera-header-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .nevera-header-row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.section-title {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 680px;
}

.nevera-actions-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-chip-action {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 38px;
}

.btn-chip-action:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.btn-chip-reset {
  color: var(--text-muted);
}
.btn-chip-reset:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* Grupos de ingredientes */
.pantry-groups-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pantry-group-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pantry-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pantry-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  min-height: 40px;
}

.pantry-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.pantry-chip.selected {
  background: rgba(249, 115, 22, 0.12);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  font-weight: 600;
  box-shadow: 0 0 12px var(--accent-orange-glow);
}

.pantry-chip .chip-check {
  display: none;
  font-weight: 700;
}
.pantry-chip.selected .chip-check {
  display: inline-block;
}

/* Barra de estado inferior de la nevera */
.pantry-status-bar {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .pantry-status-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.pantry-status-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.status-counter-badge {
  background: var(--accent-orange);
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.status-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.btn-scroll-results {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: var(--accent-orange);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 42px;
}

.btn-scroll-results:hover {
  background: var(--accent-orange-hover);
  box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   Pestaña 2: Ruleta del Hambre / Decide por mí
   ========================================================================== */
.roulette-hero-card {
  text-align: center;
}

.roulette-header .section-subtitle {
  margin: 0 auto 1.5rem;
}

.roulette-modes-filter {
  margin-bottom: 1.5rem;
}

.filter-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.roulette-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.chip-roulette {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.chip-roulette:hover {
  color: var(--text-main);
  border-color: var(--text-dim);
}

.chip-roulette.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-orange-glow);
}

.roulette-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.5rem 0 2rem;
}

.roulette-wheel-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#roulette-canvas {
  width: 100%;
  height: 100%;
  max-width: 440px;
  max-height: 440px;
  border-radius: 50%;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 0, 0, 0.4);
}

.roulette-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: #ffffff;
  text-shadow: 0 0 10px #000000, 0 2px 5px rgba(0, 0, 0, 0.8);
  z-index: 10;
  line-height: 1;
}

.roulette-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 360px;
}

.btn-spin-roulette {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all 0.2s ease;
  min-height: 48px;
}

.btn-spin-roulette:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(249, 115, 22, 0.5);
}

.btn-spin-roulette:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.roulette-sound-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Tarjeta ganadora */
.roulette-winner-card {
  max-width: 520px;
  margin: 1.5rem auto 0;
  background: linear-gradient(145deg, rgba(249, 115, 22, 0.12), rgba(17, 24, 39, 0.9));
  border: 2px solid var(--accent-orange);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  animation: bounceIn 0.4s ease-out;
  box-shadow: var(--shadow-glow);
}

@keyframes bounceIn {
  0% { transform: scale(0.9); opacity: 0; }
  60% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); }
}

.winner-badge {
  display: inline-block;
  background: var(--accent-orange);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.winner-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.winner-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.winner-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.winner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .winner-actions {
    flex-direction: row;
  }
  .winner-actions button {
    flex: 1;
  }
}

.btn-winner-cook {
  padding: 0.75rem 1.25rem;
  background: var(--accent-orange);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  min-height: 42px;
}
.btn-winner-retry {
  padding: 0.75rem 1.25rem;
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
}

/* ==========================================================================
   Filtros y Búsqueda Predictiva
   ========================================================================== */
.recipes-filter-section {
  margin-bottom: 1.5rem;
}

.filter-bar-header {
  margin-bottom: 1rem;
}

.search-input-wrap {
  position: relative;
  width: 100%;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  padding: 0.85rem 2.8rem 0.85rem 2.8rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  min-height: 46px;
  outline: none;
  transition: all 0.2s ease;
}

.search-input-wrap input:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px var(--accent-orange-glow);
}

.btn-clear-search {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-chips-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.filter-chip {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
}

.filter-chip:hover {
  color: var(--text-main);
  border-color: var(--text-dim);
}

.filter-chip.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #ffffff;
}

.filter-chip.match-perfect-chip {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}
.filter-chip.match-perfect-chip.active {
  background: var(--color-success);
  color: #ffffff;
}

.filter-chip.match-one-chip {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
}
.filter-chip.match-one-chip.active {
  background: var(--color-warning);
  color: #ffffff;
}

/* ==========================================================================
   Parrilla de Recetas
   ========================================================================== */
.recipes-counter-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .recipes-counter-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.recipes-found-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.sort-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-select-wrap label {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-select-wrap select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  padding: 0.45rem 2.2rem 0.45rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  min-height: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  appearance: none;
}

.recipes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .recipes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .recipes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.recipe-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.recipe-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-orange);
  box-shadow: var(--shadow-md);
}

.recipe-card-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.category-pill {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
}

.match-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.match-100 {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.match-90 {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.recipe-card-title {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
  line-height: 1.3;
}

.recipe-card-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
  margin-bottom: 1rem;
  flex: 1 0 auto;
}

.recipe-card-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-metric-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.recipe-card-footer {
  margin-top: 0.75rem;
}

.btn-card-view {
  width: 100%;
  padding: 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.recipe-card:hover .btn-card-view {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #ffffff;
}

/* Estado vacío */
.recipes-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-xl);
}

.empty-emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.recipes-empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.recipes-empty-state p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

.btn-reset-filters {
  padding: 0.65rem 1.25rem;
  background: var(--accent-orange);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  min-height: 42px;
}

/* ==========================================================================
   Modal de Detalle de Receta
   ========================================================================== */
.recipe-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.recipe-modal-backdrop.hidden {
  display: none;
}

.recipe-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.btn-close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-close-modal:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

.modal-recipe-header {
  margin-bottom: 1.25rem;
  padding-right: 2.5rem;
}

.modal-recipe-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-orange);
  margin-bottom: 0.4rem;
}

.modal-recipe-title {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.modal-recipe-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Métricas modal */
.modal-recipe-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

@media (min-width: 480px) {
  .modal-recipe-metrics {
    grid-template-columns: repeat(4, 1fr);
  }
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.metric-icon {
  font-size: 1.4rem;
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-main);
}

/* Escalador de raciones */
.servings-scaler-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.3);
  padding: 1rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

@media (min-width: 480px) {
  .servings-scaler-box {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.servings-title {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
}

.servings-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.servings-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-serv-minus, .btn-serv-plus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--accent-orange);
  background: var(--accent-orange);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-serv-minus:hover, .btn-serv-plus:hover {
  background: var(--accent-orange-hover);
}

.servings-count-display {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  min-width: 90px;
  text-align: center;
}

/* Lista de ingredientes y checklist */
.modal-section-ingredients, .modal-section-steps {
  margin-bottom: 1.5rem;
}

.section-title-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.modal-subheading {
  font-size: 1.15rem;
}

.btn-copy-shopping {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  min-height: 36px;
}

.btn-copy-shopping:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.checklist-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.ingredients-checklist {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 480px) {
  .ingredients-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ingredient-item-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.ingredient-item-check:hover {
  background: var(--bg-card-hover);
}

.ingredient-item-check.checked {
  opacity: 0.5;
  text-decoration: line-through;
  border-color: transparent;
}

.ingredient-item-check input[type="checkbox"] {
  accent-color: var(--accent-orange);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.ing-amount {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-orange);
}

/* Pasos numerados */
.recipe-steps-list {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.recipe-step-item {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-main);
}

.step-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.4);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-orange);
  font-weight: 600;
}

/* Truco del chef */
.modal-chef-tip-box {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.chef-icon {
  font-size: 1.5rem;
}

.chef-content strong {
  display: block;
  color: var(--color-success);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.chef-content p {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.45;
}

/* Acciones finales modal */
.modal-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-launch-kitchen-mode {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all 0.2s ease;
  min-height: 48px;
}

.btn-launch-kitchen-mode:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(249, 115, 22, 0.45);
}

/* ==========================================================================
   Modo Cocina (Manos en la masa / Pantalla Completa)
   ========================================================================== */
.kitchen-mode-overlay {
  position: fixed;
  inset: 0;
  background: #06090e;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  color: #ffffff;
}

.kitchen-mode-overlay.hidden {
  display: none;
}

.kitchen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid #1f2937;
}

.kitchen-mode-badge {
  display: inline-block;
  background: #f97316;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.25rem;
}

.kitchen-recipe-name {
  font-size: 1.35rem;
  color: #f3f4f6;
}

.btn-exit-kitchen {
  padding: 0.5rem 1rem;
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #374151;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
}

.kitchen-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 0;
}

.kitchen-step-indicator {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: #f97316;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.kitchen-step-card {
  background: #111827;
  border: 1px solid #27354a;
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.kitchen-step-text {
  font-size: 1.5rem;
  line-height: 1.45;
  font-weight: 500;
  color: #f9fafb;
}

@media (min-width: 768px) {
  .kitchen-step-text {
    font-size: 2rem;
    line-height: 1.4;
  }
}

/* Módulo de temporizador en modo cocina */
.kitchen-timer-module {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #1f2937;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.timer-display-box {
  text-align: center;
}

.timer-digits {
  display: block;
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 800;
  color: #f97316;
  letter-spacing: 0.05em;
  text-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
}

.timer-status-text {
  font-size: 0.95rem;
  color: #9ca3af;
}

.timer-controls {
  display: flex;
  gap: 0.75rem;
}

.btn-timer-toggle {
  padding: 0.75rem 1.5rem;
  background: #f97316;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}

.btn-timer-reset {
  padding: 0.75rem 1.25rem;
  background: #1f2937;
  color: #d1d5db;
  border: 1px solid #374151;
  border-radius: var(--radius-md);
  font-size: 1rem;
  cursor: pointer;
  min-height: 48px;
}

/* Pie del modo cocina con navegación gigante */
.kitchen-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #1f2937;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.btn-kitchen-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  background: #1f2937;
  color: #ffffff;
  border: 1px solid #374151;
  border-radius: var(--radius-lg);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 52px;
  flex: 1;
}

.btn-kitchen-next {
  background: #f97316;
  border-color: #f97316;
}

.btn-kitchen-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.kitchen-progress-bar-wrap {
  flex: 2;
  height: 8px;
  background: #1f2937;
  border-radius: 999px;
  overflow: hidden;
}

.kitchen-progress-bar-fill {
  height: 100%;
  background: #f97316;
  transition: width 0.3s ease;
}

/* ==========================================================================
   Toast accesible
   ========================================================================== */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 3000;
  animation: slideInUp 0.3s ease;
}

.toast-notification.hidden {
  display: none;
}

@keyframes slideInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Acordeón SEO y Guías
   ========================================================================== */
.seo-accordion-section {
  margin: 3.5rem 0 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.seo-section-title {
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}

.seo-accordion-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.seo-accordion-summary {
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.seo-accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-arrow {
  transition: transform 0.2s ease;
}

.seo-accordion-item[open] .accordion-arrow {
  transform: rotate(180deg);
}

.seo-accordion-content {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.seo-accordion-content ul {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* ==========================================================================
   Responsive móvil estricto
   ========================================================================== */
@media (max-width: 640px) {
  .tool-layout {
    padding: 0 0.75rem;
    margin: 1rem auto 2rem;
  }

  .nevera-hero-card, .roulette-hero-card {
    padding: 1.25rem 1rem;
  }

  .btn-scroll-results, .btn-winner-cook, .btn-winner-retry, .btn-spin-roulette {
    width: 100%;
  }

  .kitchen-mode-overlay {
    padding: 1rem;
  }
  .kitchen-step-card {
    padding: 1.25rem;
  }
  .kitchen-step-text {
    font-size: 1.35rem;
  }
  .timer-digits {
    font-size: 2.75rem;
  }
  .btn-kitchen-nav span {
    font-size: 0.9rem;
  }
}
