/* =========================
   RESET BÁSICO
   ========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =========================
   BODY / BASE
   ========================= */
body {
  font-family: system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: #f4f4f4;
  color: #222;
  overflow-x: hidden;

  /* espacio para la cabecera fija */
  padding-top: 130px;
  /* ajusta 120–150px si cambias el hero */
}

/* =========================
   HERO (CABECERA GLOBAL)
   ========================= */
header.hero {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
}

/* contenedor interno */
.hero-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 16px 16px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* =========================
   MARCA
   ========================= */
.brand-title {
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1.1;
  letter-spacing: .3px;
}

/* =========================
   NAVEGACIÓN
   ========================= */
.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: .95rem;
  transition: background .15s ease, color .15s ease;
}

.nav-links a:hover {
  background: #007bff;
  color: #fff;
}

/* =========================
   FRASE MOTIVADORA
   ========================= */
.hero-phrase {
  margin-top: 8px;
  font-size: .95rem;
  color: #666;
  font-style: italic;
  text-align: center;
  max-width: 720px;
}

/* =========================
   CONTENIDO PRINCIPAL
   ========================= */
main.container {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 80px 16px;
}


/* ===== CARD DE SECCIÓN (TÍTULO INTEGRADO) ===== */
.card-section {
  grid-column: span 3;
  background: linear-gradient(135deg, #f8f9fb, #ffffff);
  border: 1px solid rgba(0, 0, 0, .06);
  box-shadow: none;
}

.card-section h3 {
  font-size: 1.4rem;
  font-weight: 800;
}

.card-section p {
  margin-top: 4px;
  color: #666;
}

.card-section a {
  margin-top: 10px;
  font-weight: 600;
}

/* responsive */
@media (max-width: 768px) {
  .card-section {
    grid-column: span 2;
  }
}

@media (max-width: 480px) {
  .card-section {
    grid-column: span 1;
  }
}

/* =========================
   TARJETAS
   ========================= */

.section-title {
  margin: 40px 0 16px;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
}

.section-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  /*margin-bottom: 60px; /* ← separación entre bloques */
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  padding: 20px;
  text-align: center;
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.card p {
  font-size: .95rem;
  color: #555;
  padding-top: 10px;
  padding-bottom: 10px;
}

.card a {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  background: #28a745;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: .8rem;
}

.card a:hover {
  background: #218838;
}

.card.card-section {
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 2px solid rgba(0, 0, 0, .06);
}

.card.card-section h3 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.card.card-section p {
  color: #666;
}

.card.card-section a {
  align-self: flex-start;
}

.home-block {
  margin-bottom: 28px;
}

.home-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .7);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
  margin-bottom: 14px;
}

.home-block-head h2 {
  font-size: 1.2rem;
  font-weight: 800;
}

.home-block-head a {
  text-decoration: none;
  color: #ffffff;
}




/* ===== GRID DASHBOARD ===== */
.section-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ===== CARD BASE ===== */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.card p {
  font-size: .95rem;
  color: #555;
  flex-grow: 1;
}

.card a {
  align-self: flex-start;
  margin-top: 12px;
  font-size: .9rem;
  color: #ffffff;
  /*color: #007bff;*/
  text-decoration: none;
}

.card a:hover {
  text-decoration: underline;
}

/* ===== CARD DE SECCIÓN (dashboard style) ===== */
.card-section {
  grid-column: span 3;
  /* ocupa toda la fila */
  background: linear-gradient(135deg,
      #f8f9fb,
      #ffffff);
  border: 1px solid rgba(0, 0, 0, .06);
  box-shadow: none;
}

.card-section h3 {
  font-size: 1.4rem;
  font-weight: 800;
}

.card-section p {
  margin-top: 4px;
  color: #666;
}

.card-section a {
  margin-top: 10px;
  font-weight: 600;
}

/* ===== SECTION DIVIDER: integrado y compacto ===== */
.section-divider {
  grid-column: 1 / -1;
  /* ocupa toda la fila del grid */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0px 0px;
  /* muy poco alto */
  margin-top: 25px;
}

.section-title {
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: .2px;
  padding: 6px 10px;
  border-radius: 100px;
  background: rgba(0, 0, 0, .04);
}

.section-line {
  height: 1px;
  flex: 1;
  background: rgba(0, 0, 0, .10);
}

.section-link {
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  color: #007bff;
  padding: 6px 8px;
  border-radius: 8px;
}

.section-link:hover {
  background: rgba(0, 123, 255, .10);
}


.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  font-size: .8rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 151, 151, 0.09);
  color: #444;
}


/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .section-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-section {
    grid-column: span 2;
  }
}

@media (max-width: 480px) {
  .section-cards {
    grid-template-columns: 1fr;
  }

  .card-section {
    grid-column: span 1;
  }
}

.section-title {
  border: 1px solid rgba(0, 0, 0, .06);
}

/* =========================
   FOOTER
   ========================= */
footer {
  margin: 40px 0 20px;
  text-align: center;
  font-size: .85rem;
  color: #666;
}

/* =========================
   Admin UI (cervezolog0)
   ========================= */
:root {
  --bg: #0b0f14;
  --card: rgba(255, 255, 255, .04);
  --card2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .10);
  --text: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .68);
  --accent: #7c5cff;
  --good: #2bd576;
  --warn: #ffcc66;
  --bad: #ff5c7a;
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
  --r: 16px;
}

.admin-wrap {
  margin: 18px 0 48px;
}

.admin-top {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-title h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: .2px;
}

.admin-sub {
  color: var(--muted);
  font-size: 13px;
}

.admin-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-nav a {
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.admin-nav a:hover {
  background: var(--card2);
  border-color: rgba(255, 255, 255, .18);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.admin-card {
  grid-column: span 4;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 980px) {
  .admin-card {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .admin-card {
    grid-column: span 12;
  }
}

.admin-card h3 {
  margin: 0;
  font-size: 15px;
}

.admin-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.admin-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}

.btn:hover {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .20);
}

.btn-primary {
  background: rgba(124, 92, 255, .20);
  border-color: rgba(124, 92, 255, .35);
}

.btn-primary:hover {
  background: rgba(124, 92, 255, .28);
}

.btn-danger {
  background: rgba(255, 92, 122, .18);
  border-color: rgba(255, 92, 122, .35);
}

.btn-danger:hover {
  background: rgba(255, 92, 122, .26);
}

.kpi {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.kpi strong {
  font-size: 28px;
  letter-spacing: .3px;
}

.kpi span {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-top: 14px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-align: left;
  font-size: 13px;
}

.table th {
  color: rgba(255, 255, 255, .85);
  font-weight: 600;
  background: rgba(255, 255, 255, .04);
}

.table tr:hover td {
  background: rgba(255, 255, 255, .03);
}

.muted {
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, .82);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.input {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  padding: 9px 10px;
  font-size: 13px;
}

.input::placeholder {
  color: rgba(255, 255, 255, .45);
}

.notice {
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  border-radius: 14px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
}

.notice-good {
  border-color: rgba(43, 213, 118, .28);
  background: rgba(43, 213, 118, .08);
}

.notice-warn {
  border-color: rgba(255, 204, 102, .28);
  background: rgba(255, 204, 102, .08);
}

.notice-bad {
  border-color: rgba(255, 92, 122, .28);
  background: rgba(255, 92, 122, .08);
}

/* =========================
   Admin UI (LIGHT + TURQUESA)
   ========================= */
.admin-wrap {
  --bg: #f6f7fb;
  --card: #ffffff;
  --card2: #f3f5fb;
  --line: rgba(15, 23, 42, .10);
  --text: rgba(15, 23, 42, .92);
  --muted: rgba(15, 23, 42, .62);

  --accent: #20c997;
  /* turquesa */
  --accent2: rgba(32, 201, 151, .18);

  --good: #20c997;
  --warn: #f4b740;
  --bad: #ef476f;

  --shadow: 0 14px 40px rgba(15, 23, 42, .10);
  --r: 16px;
}

/* Ajuste general dentro de admin */
.admin-wrap,
.admin-wrap * {
  color: var(--text);
}

.admin-card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* Texto secundario */
.admin-card p,
.admin-sub,
.muted {
  color: var(--muted) !important;
}

/* Nav pills */
.admin-nav a {
  background: var(--card2);
  border-color: var(--line);
  color: var(--text);
}

.admin-nav a:hover {
  background: #eef2ff;
}

/* Botones */
.btn {
  background: var(--card2);
  border-color: var(--line);
  color: var(--text);
}

.btn:hover {
  background: #eef2ff;
}

.btn-primary {
  background: var(--accent2);
  border-color: rgba(32, 201, 151, .35);
  color: rgba(10, 40, 35, .95);
}

.btn-primary:hover {
  background: rgba(32, 201, 151, .26);
}

/* Botón peligro */
.btn-danger {
  background: rgba(239, 71, 111, .14);
  border-color: rgba(239, 71, 111, .28);
  color: rgba(90, 10, 30, .95);
}

.btn-danger:hover {
  background: rgba(239, 71, 111, .20);
}

/* Chips */
.chip {
  border-color: rgba(15, 23, 42, .16);
  background: rgba(15, 23, 42, .04);
  color: rgba(15, 23, 42, .75);
}

/* Tabla */
.table {
  border-color: var(--line);
}

.table th {
  background: rgba(15, 23, 42, .03);
  color: rgba(15, 23, 42, .78);
}

.table td {
  color: rgba(15, 23, 42, .90);
}

.table tr:hover td {
  background: rgba(32, 201, 151, .06);
}

/* Admin: page /admin/recetas/nueva */
.admin-card--wide {
  grid-column: span 8;
}

@media (max-width: 980px) {
  .admin-card--wide {
    grid-column: span 12;
  }
}

.admin-form {
  margin-top: 6px;
}

.dropzone {
  display: block;
  border: 1px dashed var(--line);
  background: var(--card2);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: transform .06s ease, background .12s ease, border-color .12s ease;
}

.dropzone:hover {
  background: rgba(32, 201, 151, .06);
  border-color: rgba(32, 201, 151, .35);
}

.dropzone:active {
  transform: scale(.995);
}

.dropzone-inner {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(32, 201, 151, .14);
  border: 1px solid rgba(32, 201, 151, .25);
  font-size: 16px;
}

.dropzone-title {
  font-weight: 650;
  font-size: 14px;
}

.dropzone-link {
  text-decoration: underline;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 980px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
}

.field-help {
  font-size: 12px;
  color: var(--muted);
}

.field-compact .admin-actions {
  justify-content: flex-end;
}

.admin-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-list li {
  margin: 6px 0;
}

.dropzone-hasfile {
  border-color: rgba(32, 201, 151, .45);
  background: rgba(32, 201, 151, .06);
}

.dropzone-drag {
  border-color: rgba(32, 201, 151, .65);
  background: rgba(32, 201, 151, .10);
}


/* ===== Recipe view upgrades (non-breaking) ===== */

.recipe-hero {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.recipe-hero .title {
  margin: 0 0 8px 0;
}

.recipe-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.recipe-subnav {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 4px 2px;
  margin-top: 12px;
}

.recipe-subnav a {
  text-decoration: none;
  white-space: nowrap;
}

.recipe-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 1100px) {
  .recipe-stats {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 700px) {
  .recipe-stats {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

.stat {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: rgba(0, 0, 0, .02);
}

.stat .label {
  font-size: 12px;
  opacity: .75;
}

.stat .value {
  font-size: 18px;
  font-weight: 800;
  margin-top: 2px;
}

.stat .sub {
  font-size: 12px;
  opacity: .8;
  margin-top: 2px;
}

.recipe-notes {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: rgba(0, 0, 0, .02);
}

.recipe-notes .label {
  font-size: 12px;
  opacity: .75;
  margin-bottom: 6px;
}

.data-table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, .08);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0, 0, 0, .10);
  font-size: 12px;
  opacity: .9;
}

.data-table tbody tr:hover {
  background: rgba(0, 0, 0, .03);
}

.data-table tbody td {
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.recipe-section h3 {
  margin-top: 0;
}

@media print {
  .no-print {
    display: none !important;
  }

  .card {
    box-shadow: none !important;
  }
}

/* ===== Fix: recipe cards clipped by grid layout ===== */

/* En la página de receta, que las filas del grid se adapten al contenido */
.recipe-page .section-cards,
.recipe-page .section-cards-2 {
  align-items: start;
  grid-auto-rows: auto !important;
}

/* Evita alturas fijas o recortes heredados */
.recipe-page .card,
.recipe-page .recipe-section {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* Si tu CSS general usa "contain" o "overflow hidden", esto ayuda */
.recipe-page .recipe-section * {
  max-width: 100%;
}

/* ===== FIX definitivo: stats del hero no deben desbordar el card ===== */

/* que el flex pueda encoger de verdad */
.recipe-hero>div {
  min-width: 0;
}

/* grid inteligente: se auto-ajusta al ancho del contenedor */
.recipe-stats {
  width: 100%;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
}

/* evita que un contenido largo fuerce el ancho */
.stat {
  min-width: 0;
}

.stat .value,
.stat .label,
.stat .sub {
  overflow-wrap: anywhere;
}

/* por si algo aún empuja horizontalmente */
.recipe-page {
  overflow-x: hidden;
}

/* ===== Logo in header ===== */
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 14px;
}

.brand-text {
  min-width: 0;
}

.brand-subtitle {
  font-size: 12px;
  opacity: .75;
  margin-top: 2px;
}

/* ===== Site footer ===== */
.site-footer {
  margin-top: 26px;
  padding: 20px 0 26px;
  border-top: 1px solid rgba(0, 0, 0, .10);
  background: rgba(0, 0, 0, .015);
}

.footer-inner {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.footer-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 260px;
}

.footer-logo {
  width: 256px;
  height: 256px;
  object-fit: contain;
  border-radius: 14px;
}

.footer-title {
  font-weight: 800;
}

.footer-desc {
  opacity: .75;
  font-size: 12px;
  margin-top: 2px;
}

.footer-cols {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 16px;
}

@media (max-width: 820px) {
  .footer-cols {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 520px) {
  .footer-cols {
    grid-template-columns: 1fr;
  }
}

.footer-head {
  font-weight: 800;
  margin-bottom: 10px;
}

.footer-col a {
  display: block;
  text-decoration: none;
  margin: 6px 0;
}

.footer-col a:hover {
  text-decoration: underline;
}

.footer-note {
  opacity: .75;
  font-size: 12px;
  margin: 6px 0;
}

.tool-frame {
  width: 100%;
  height: calc(100vh - 280px);
  min-height: 720px;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 14px;
  background: rgba(0, 0, 0, .02);
}

/* ===== Tools embed: que el iframe NO se quede en 1 columna del grid ===== */
.tool-wrap {
  grid-column: 1 / -1;
  /* ocupa toda la fila del grid */
}

/* iframe grande y usable */
.tool-frame {
  width: 100%;
  display: block;
  border: 0;
  height: calc(100vh - 260px);
  min-height: 900px;
  border-radius: 14px;
  background: #fff;
}