/* System Design: Asesor de Carnes (Glassmorphism Dark Mode) */
:root {
  --bg-dark: #0f0505;
  --bg-card: rgba(32, 12, 12, 0.7);
  --bg-card-hover: rgba(50, 18, 18, 0.85);
  --border-card: rgba(239, 68, 68, 0.2);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-gold: #eab308;
  --accent-green: #22c55e;
  --gradient-fire: linear-gradient(135deg, #ef4444, #f97316, #eab308);
  --gradient-bg: radial-gradient(circle at 50% 0%, #350a0a 0%, #0f0505 70%);
  --shadow-glow: 0 8px 32px rgba(239, 68, 68, 0.15);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-dark);
  background-image: var(--gradient-bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

button,
input,
select,
textarea {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #111;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 3px;
}

.connection-status {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  z-index: 300;
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(248, 113, 113, 0.6);
  border-radius: 999px;
  background: #450a0a;
  color: #fee2e2;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.85rem;
  text-align: center;
}

/* Header & Navbar */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-card);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: ui-rounded, "Segoe UI", system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-icon {
  font-size: 1.8rem;
}

.install-btn {
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(249, 115, 22, 0.55);
  border-radius: var(--radius-sm);
  background: rgba(249, 115, 22, 0.12);
  color: #fed7aa;
  cursor: pointer;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  background: var(--gradient-fire);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Main Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* View Sections */
.view-section {
  display: none;
  animation: fadeIn 0.35s ease;
  scroll-margin-top: 9rem;
}

.view-section.active {
  display: block;
}

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

/* Hero Banner */
.hero {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 2.5rem 1rem;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
}

.hero h1 {
  font-family: ui-rounded, "Segoe UI", system-ui, sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0 auto;
}

/* Glassmorphic Grid & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(239, 68, 68, 0.4);
}

.card-title {
  font-family: ui-rounded, "Segoe UI", system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;

  color: var(--accent-gold);
}

/* Form Controls & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

/* Range Slider */
.slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.range-slider {
  flex: 1;
  accent-color: var(--accent-red);
}

.slider-val {
  min-width: 48px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.btn-primary {
  background: var(--gradient-fire);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-orange);
}

/* Stats / Result Badges */
.stat-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Meat Cut Card Component */
.cut-card {
  position: relative;
  overflow: hidden;
}

.cut-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.cut-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-red { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-gold { background: rgba(234, 179, 8, 0.2); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.3); }
.badge-orange { background: rgba(249, 115, 22, 0.2); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.3); }

.cut-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
}

.spec-item {
  font-size: 0.75rem;
  text-align: center;
}

.spec-item span {
  display: block;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.85rem;
}

/* Technical Guide Specs */
.tech-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

.tech-highlight {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-orange);
  margin-bottom: 0.5rem;
}

.flow-steps {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.flow-step {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.3);
}

.flow-step.active {
  border-color: rgba(249, 115, 22, 0.55);
  background: rgba(249, 115, 22, 0.15);
  color: #ffd8b0;
}

/* Shopping List */
.shopping-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shopping-list-item:last-child {
  border-bottom: none;
}

/* Recipe / Preparation Layout */
.recipe-shell {
  display: grid;
  gap: 1rem;
}

.recipe-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.recipe-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.recipe-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
}

.recipe-panel {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.recipe-panel h4 {
  font-family: 'Outfit', sans-serif;
  color: var(--accent-orange);
  margin-bottom: 0.75rem;
}

.ingredient-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.ingredient-item {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.12);
}

.ingredient-item strong {
  display: block;
  margin-bottom: 0.15rem;
}

.ingredient-detail {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.recipe-steps {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.recipe-step {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.75rem;
  align-items: start;
}

.recipe-step-number {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  background: var(--gradient-fire);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.28);
}

.recipe-step-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.recipe-step-text {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.mini-recipe {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 0.75rem;
}

.mini-recipe h4 {
  color: var(--accent-gold);
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.mini-recipe-list {
  display: grid;
  gap: 0.45rem;
  list-style: none;
}

.mini-recipe-chip {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: rgba(249, 115, 22, 0.14);
  color: #ffd3b2;
  font-size: 0.78rem;
  border: 1px solid rgba(249, 115, 22, 0.18);
}

.chef-pro-block {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chef-pro-grid {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.chef-profile {
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.chef-profile summary {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--accent-gold);
  font-weight: 700;
  cursor: pointer;
}

.chef-profile summary small,
.chef-detail-list small {
  color: var(--text-secondary);
  font-weight: 400;
}

.chef-profile h5 {
  margin: 0.85rem 0 0.35rem;
  color: var(--text-primary);
}

.chef-detail-list {
  display: grid;
  gap: 0.35rem;
  padding-left: 1.15rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.chef-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.chef-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 0.76rem; }
.chef-table th, .chef-table td { padding: 0.4rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); text-align: left; }

.recipe-panel > div[style*="overflow-x"],
.tech-box > div[style*="overflow-x"] {
  max-width: 100%;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.recipe-panel table,
.tech-box table { min-width: 620px; }

.ai-status {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.ai-spinner {
  width: 1.4rem;
  height: 1.4rem;
  flex: 0 0 auto;
  border: 3px solid rgba(249, 115, 22, 0.2);
  border-top-color: var(--accent-orange);
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
}

.ai-incompatible,
.ai-error { border-color: rgba(239, 68, 68, 0.4); }
.allergy-warning {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
}
.allergy-warning ul { margin: 0.45rem 0 0.45rem 1.15rem; }
.allergy-warning p { margin-top: 0.45rem; }
.food-safety {
  display: grid;
  gap: 0.3rem;
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid rgba(34, 197, 94, 0.38);
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.09);
  color: #dcfce7;
  font-size: 0.82rem;
}
.food-safety p { margin: 0; color: #bbf7d0; }
.food-safety a { color: #fde68a; }
.food-safety .safety-verification { color: #fde68a; font-weight: 700; }
.safety-stage { border-top: 1px solid rgba(187, 247, 208, 0.2); padding-top: 0.45rem; }
.safety-stage summary { cursor: pointer; font-weight: 700; color: #dcfce7; }
.safety-stage ul { margin: 0.45rem 0 0 1.15rem; color: #bbf7d0; }
.field-help { margin: -0.25rem 0 0; color: var(--text-muted); font-size: 0.85rem; }
.ranking-box { margin: 0.85rem 0; padding: 0.75rem; border: 1px solid rgba(249, 115, 22, 0.35); border-radius: 12px; background: rgba(249, 115, 22, 0.07); }
.ranking-box p { margin: 0.55rem 0; font-size: 0.86rem; }
.ranking-box summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.ranking-box ul { margin: 0.55rem 0 0 1.1rem; font-size: 0.82rem; }
.ranking-score { display: flex; align-items: baseline; gap: 0.55rem; }
.ranking-score strong { color: var(--accent); font-size: 1.35rem; }
.ranking-score span { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stock-badge { display: inline-flex; margin-left: 0.35rem; padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: #374151; color: #f3f4f6; }
.stock-disponible { background: #14532d; color: #dcfce7; }
.stock-bajo_inventario { background: #78350f; color: #fef3c7; }
.stock-agotado { background: #7f1d1d; color: #fee2e2; }
.admin-login { max-width: 520px; margin: 0 auto; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.admin-toolbar .btn { width: auto; }
.admin-summary { margin-top: 1rem; }
.admin-summary .stat-box { min-height: 100px; }
.table-scroll { overflow-x: auto; margin-top: 1rem; }
.admin-table { min-width: 900px; width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 0.65rem; border-bottom: 1px solid var(--border); text-align: left; }
.admin-table input, .admin-table select { min-width: 105px; }
.admin-table .btn { width: auto; white-space: nowrap; }
.admin-user-form { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 0.65rem; margin: 1rem 0; }
@media (max-width: 900px) { .admin-user-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .admin-toolbar { align-items: flex-start; flex-direction: column; } .admin-user-form { grid-template-columns: 1fr; } }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.ai-suggestions .btn, .ai-error .btn { width: auto; }

@keyframes ai-spin { to { transform: rotate(360deg); } }

.footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

/* Print Styles */
@media print {
  body { background: #fff; color: #000; }
  .header, .nav-tabs, .btn, .connection-status, .footer { display: none !important; }
  .card { border: 1px solid #ccc; background: #fff; color: #000; box-shadow: none; }
  .stat-val, .cut-title { color: #000 !important; }
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .header { padding-inline: 1.25rem; }
  .nav-btn { padding-inline: 0.85rem; }
  .container { padding-inline: 1.25rem; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 64px;
    gap: 0.75rem;
    padding: 0.65rem max(1rem, env(safe-area-inset-right)) 0.65rem max(1rem, env(safe-area-inset-left));
  }
  .brand { min-width: 0; font-size: 1.15rem; }
  .brand-icon { font-size: 1.4rem; }
  .install-btn { margin-left: auto; }
  .nav-tabs {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    gap: 0.2rem;
    padding: 0.25rem;
    overflow: visible;
    border-width: 1px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.4);
  }
  .nav-btn {
    flex: 1 1 25%;
    justify-content: center;
    min-width: 0;
    padding: 0.6rem 0.2rem;
    font-size: 0.72rem;
    white-space: normal;
    text-align: center;
  }
  .container { padding: 1rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .recipe-grid { grid-template-columns: 1fr; }
  .hero { margin-bottom: 1rem; padding: 1.5rem 0.8rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 0.96rem; }
  .card { padding: 1rem; border-radius: var(--radius-md); }
  .form-control,
  .form-select { min-height: 46px; font-size: 16px; }
  textarea.form-control { min-height: 110px; }
  .btn { min-height: 46px; }
  .chef-profile summary { align-items: flex-start; }
  .footer { padding-bottom: 1rem; }
}

@media (max-width: 380px) {
  .brand span:last-child { max-width: 145px; line-height: 1.05; }
  .install-btn { padding-inline: 0.55rem; font-size: 0.76rem; }
  .container { padding-inline: 0.75rem; }
  .card { padding-inline: 0.8rem; }
  .cut-specs { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== POMELLI THEME — Asesor de Carnes ===========================
   Diseño inspirado en Google Pomelli Labs, 100% optimizado para:
   Android, iPhone (iOS Safari), Mac, iPad, tablets y pantallas de escritorio.
   ================================================================== */

/* Base override */
body.pg-body {
  background: #0d0d0d;
  color: #f1f1f1;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- HEADER (Mobile-first & Desktop) ---------- */
.pg-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.75rem, env(safe-area-inset-top)) 4% 0.75rem;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  box-sizing: border-box;
}

.pg-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.pg-brand-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.pg-brand-name {
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.pg-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.pg-nav-link {
  color: #d1d5db;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}
.pg-nav-link:hover { color: #f97316; }

.pg-header-side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pg-share-btn {
  background: #25D366;
  color: #ffffff;
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: opacity 0.2s;
  touch-action: manipulation;
}
.pg-share-btn:hover { opacity: 0.9; }
.pg-share-btn:active { transform: scale(0.97); }

/* ---------- HERO — Foto Brasas Full Width ---------- */
.pg-hero {
  width: 100%;
  height: 48vw;
  min-height: 240px;
  max-height: 560px;
  background: url('/images/hero_embers.jpg') center center/cover no-repeat;
  display: block;
}

/* ---------- ARSENAL DEL PARRILLERO ---------- */
.pg-arsenal {
  background: #111111;
  padding: 4.5rem 4% 5rem;
}

.pg-section-head {
  text-align: center;
  max-width: 660px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.pg-section-title {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.85rem;
  line-height: 1.2;
}

.pg-left { text-align: left; }

.pg-orange { color: #f97316; }

.pg-section-sub {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

/* 2x2 Grid */
.pg-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.pg-card {
  background: #181a1f;
  border: 1px solid #282b33;
  border-radius: 8px;
  padding: 1.85rem 1.65rem;
  cursor: pointer;
  transition: border-color 0.22s, transform 0.22s, box-shadow 0.22s;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
}

.pg-card:hover,
.pg-card:focus-visible {
  border-color: #f97316;
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  outline: none;
}

.pg-card:active {
  transform: scale(0.98);
  border-color: #f97316;
}

.pg-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 0.75rem;
}

.pg-card-desc {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

/* ---------- SEPARADOR FOTO PARRILLA ---------- */
.pg-separator {
  width: 100%;
  height: 35vw;
  min-height: 180px;
  max-height: 380px;
  background: url('/images/hero_embers.jpg') center 65%/cover no-repeat;
  display: block;
}

/* ---------- CIENCIA Y EXPERIENCIA ---------- */
.pg-ciencia {
  background: #151619;
  padding: 4.5rem 4%;
  border-top: 1px solid #202228;
}

.pg-ciencia-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.pg-ciencia-p {
  font-size: 0.95rem;
  color: #9ca3af;
  line-height: 1.7;
  margin: 0 0 1.1rem;
}

.pg-features {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pg-features li {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.pg-bullet {
  color: #f97316;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.pg-features li strong { color: #ffffff; }

.pg-ciencia-img-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #2a2a2e;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.pg-ciencia-img {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 380px;
}

/* ---------- HERRAMIENTAS INTERACTIVAS (App Suite) ---------- */
.pg-tools {
  background: #0a0c10;
  background-image: radial-gradient(circle at 50% 0%, #2a0a0a 0%, #0a0c10 70%);
  padding: 2.5rem 0 3.5rem;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
}

.pg-tools-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem 1.25rem;
  max-width: 1000px;
  margin: 0 auto;
}

.pg-tools-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.pg-back-link {
  color: #f97316;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  transition: all 0.2s;
}
.pg-back-link:hover {
  background: rgba(249, 115, 22, 0.15);
}

/* Nav Tabs centradas y touch-friendly */
.pg-tools .nav-tabs {
  margin: 0 auto 2rem auto;
  width: fit-content;
  max-width: 100%;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  padding: 0.35rem 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.pg-tools .nav-btn {
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  touch-action: manipulation;
}

/* Stat Box Grid */
.stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem 0.75rem;
  text-align: center;
}

.stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #f97316;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- FOOTER ---------- */
.pg-footer {
  background: #060608;
  border-top: 1px solid #18191d;
  padding: 3.5rem 1.5rem max(2rem, env(safe-area-inset-bottom));
  text-align: center;
}

.pg-footer-inner {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.pg-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.pg-footer-tag  { font-size: 0.88rem; color: #9ca3af; margin: 0; }
.pg-footer-sub  { font-size: 0.82rem; color: #6b7280; margin: 0; }
.pg-footer-copy { font-size: 0.73rem; letter-spacing: 0.07em; color: #4b5563; margin-top: 1rem; }

.pg-footer-links {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.82rem;
  margin-top: 0.5rem;
  color: #6b7280;
  flex-wrap: wrap;
  justify-content: center;
}
.pg-footer-links a {
  color: #9ca3af;
  text-decoration: underline;
  transition: color 0.2s;
  padding: 0.25rem;
}
.pg-footer-links a:hover { color: #f97316; }

/* ==========================================================================
   RESPONSIVE OPTIMIZATIONS (TABLETS, PHONES, ANDROID & iOS)
   ========================================================================== */

/* Tablets & Small Laptops (<= 992px) */
@media (max-width: 992px) {
  .pg-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .pg-ciencia-inner {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }
  .pg-ciencia-img-wrap {
    max-width: 500px;
    margin: 0 auto;
  }
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Mobile Devices (<= 768px - iPhones, Android phones) */
@media (max-width: 768px) {
  .pg-header {
    padding: max(0.6rem, env(safe-area-inset-top)) 3% 0.6rem;
  }
  .pg-brand-name {
    font-size: 0.88rem;
  }
  .pg-nav {
    display: none; /* Ocultar links de texto para evitar saturación */
  }
  .pg-share-btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
  }
  
  .pg-hero {
    height: 56vw;
    min-height: 220px;
  }
  
  .pg-arsenal {
    padding: 3rem 3% 3.5rem;
  }
  .pg-section-head {
    margin-bottom: 2rem;
  }
  .pg-section-title {
    font-size: 1.85rem;
  }
  .pg-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 0;
  }
  .pg-card {
    padding: 1.35rem 1.25rem;
  }
  
  .pg-separator {
    height: 42vw;
    min-height: 160px;
  }
  
  .pg-ciencia {
    padding: 3rem 3%;
  }
  .pg-ciencia-inner {
    padding: 0;
  }
  .pg-ciencia-img {
    max-height: 260px;
  }

  /* Herramientas - Mobile Tab Navigation con Swipe Horizontal */
  .pg-tools {
    padding: 1.5rem 0.5rem 2.5rem;
  }
  .pg-tools-header {
    padding: 0 0.5rem 1rem;
  }
  .pg-tools-title {
    font-size: 1.15rem;
  }
  
  .pg-tools .nav-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: calc(100% - 1rem);
    margin: 0 auto 1.5rem auto;
    padding: 0.35rem 0.4rem;
    border-radius: 10px;
    gap: 0.35rem;
  }
  .pg-tools .nav-tabs::-webkit-scrollbar {
    display: none;
  }
  .pg-tools .nav-btn {
    flex-shrink: 0;
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    min-height: 40px;
    border-radius: 6px;
  }

  /* Contenedores y Cards en móvil */
  .container {
    padding: 0 0.25rem;
  }
  .card {
    padding: 1.15rem 1rem;
    border-radius: 12px;
  }
  .card-title {
    font-size: 1.15rem;
  }

  /* Evitar zoom automático indeseado en iOS Safari */
  .form-control,
  .form-select,
  textarea.form-control {
    font-size: 16px !important;
    min-height: 46px;
    padding: 0.65rem 0.85rem;
  }

  /* Sliders táctiles */
  .slider-container {
    gap: 0.75rem;
  }
  .range-slider {
    height: 32px;
  }
  .slider-val {
    min-width: 36px;
    font-size: 1.15rem;
  }

  /* Grid de resultados 2x2 */
  .grid-2.cooking-dimensions {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Botones full touch */
  .btn {
    min-height: 46px;
    font-size: 0.92rem;
  }

  /* Grid 3 de Atlas y Sommelier a 1 columna */
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Extra Small Phones (<= 380px — iPhone SE, Galaxy A-series) */
@media (max-width: 380px) {
  .pg-brand-name {
    font-size: 0.8rem;
  }
  .pg-brand-icon {
    font-size: 1.1rem;
  }
  .pg-share-btn {
    font-size: 0.72rem;
    padding: 0.35rem 0.5rem;
  }
  .pg-section-title {
    font-size: 1.6rem;
  }
  .stat-val {
    font-size: 1.15rem;
  }
  .card {
    padding: 0.9rem 0.75rem;
  }
}

/* ---------- GOOGLE ADSENSE HARDENING ---------- */
.ad-banner {
  text-align: center;
  margin: 0 auto 1.25rem auto;
  max-width: 1000px;
  background: transparent !important;
  min-height: 0 !important;
  overflow: hidden;
}

ins.adsbygoogle {
  background: transparent !important;
  background-color: transparent !important;
}

ins.adsbygoogle iframe {
  background: transparent !important;
  background-color: transparent !important;
}

ins.adsbygoogle[data-ad-status="unfilled"],
ins.adsbygoogle[data-adsbygoogle-status="done"]:empty {
  display: none !important;
}

/* Botones de filtro rápido de cocina en Atlas */
.filter-cocina-btn {
  background: #1e222d !important;
  color: #cbd5e1 !important;
  border: 1px solid #334155 !important;
  border-radius: 6px !important;
  padding: 0.45rem 0.85rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
}

.filter-cocina-btn:hover {
  background: #2d3748 !important;
  color: #fff !important;
  border-color: #f97316 !important;
}

.filter-cocina-btn.active {
  background: #f97316 !important;
  color: #ffffff !important;
  border-color: #ea580c !important;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.4) !important;
}

