/* Nutriplan — estilos compartidos (dirección "cálido y apetecible") */

* { box-sizing: border-box; }

:root {
  --cream: #fbf6ef;
  --cream-2: #f3e9db;
  --ink: #3a2d22;
  --ink-soft: #6b5a48;
  --ink-faint: #8f7d69;
  --terracotta: #c1602f;
  --terracotta-dark: #7f4423;
  --terracotta-tint: #f3ddc9;
  --line: #e7dccb;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(90, 60, 30, 0.08);
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Karla', system-ui, -apple-system, sans-serif;
}

h1, h2, h3, .serif {
  font-family: 'Domine', Georgia, serif;
}

a { color: var(--terracotta); text-decoration: none; }
a:hover { color: var(--terracotta-dark); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.site-header .brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.site-header .brand strong {
  font-family: 'Domine', serif;
  font-weight: 600;
  font-size: 24px;
  color: var(--terracotta-dark);
}
.site-header .brand span {
  font-size: 14px;
  color: var(--ink-faint);
}
.site-header nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  font-weight: 600;
}
.site-header nav a.active { color: var(--terracotta-dark); border-bottom: 2px solid var(--terracotta); padding-bottom: 3px; }

main { padding: 28px 0 60px; }

/* Filter bar */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.filters input[type=text] {
  flex-grow: 1;
  min-width: 220px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
}
.filters select {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
}
.filters button.toggle {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
}
.filters button.toggle.active {
  background: var(--terracotta-tint);
  border-color: #d9a97c;
  color: var(--terracotta-dark);
  font-weight: 600;
}
.filters button.buscar {
  border: none;
  background: var(--terracotta);
  color: white;
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.chips a {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}
.chips a.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: white;
  font-weight: 600;
}

.result-count {
  font-size: 13px;
  color: var(--ink-faint);
  margin: -8px 0 18px;
}

/* Recipe grid + cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.card {
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: block;
  color: inherit;
  position: relative;
}
.card:hover { color: inherit; }
.card .thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d99a6c, #b8562f);
}
.card .thumb svg { opacity: 0.9; }
.card .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  background: rgba(58, 45, 34, 0.75);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.card .body { padding: 16px 18px 18px; }
.card .title {
  font-family: 'Domine', serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
}
.card .meta {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.card .cat-tag {
  font-size: 12px;
  color: var(--terracotta-dark);
  background: var(--terracotta-tint);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-faint);
}

/* Recipe detail */
.recipe-detail .hero {
  height: 220px;
  border-radius: 20px;
  background: linear-gradient(135deg, #d99a6c, #b8562f);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.recipe-detail h1 { font-size: 30px; margin: 0 0 6px; }
.recipe-detail .meta-row {
  display: flex;
  gap: 18px;
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.recipe-detail .columns {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 40px;
}
.recipe-detail h2 { font-size: 18px; margin: 0 0 14px; }
.recipe-detail ul.ingredients { list-style: none; padding: 0; margin: 0; }
.recipe-detail ul.ingredients li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.recipe-detail ol.steps { padding-left: 20px; margin: 0; }
.recipe-detail ol.steps li {
  padding: 8px 0;
  font-size: 14.5px;
  line-height: 1.55;
}
.back-link { display: inline-block; margin-bottom: 20px; font-size: 14px; font-weight: 600; }

/* Weekly planner */
.plan-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-radius: 14px;
  padding: 14px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  font-size: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.plan-summary-bar strong { color: var(--terracotta-dark); }
.plan-summary-bar .target { color: var(--ink-faint); }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 12px;
  overflow-x: auto;
}
.plan-day {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 150px;
}
.plan-day .day-head {
  text-align: center;
  padding-bottom: 4px;
}
.plan-day .day-head .name {
  font-family: 'Domine', serif;
  font-weight: 600;
  font-size: 15px;
}
.plan-day .day-head .target {
  font-size: 12px;
  color: var(--terracotta-dark);
  font-weight: 600;
  margin-top: 2px;
}
.slot-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: -4px;
}
.slot-filled {
  background: var(--white);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  position: relative;
}
.slot-filled.libre { background: var(--terracotta-tint); }
.slot-filled .title { font-size: 12.5px; font-weight: 600; line-height: 1.3; display: block; padding-right: 16px; }
.slot-filled .meta { font-size: 11px; color: var(--ink-soft); margin-top: 3px; }
.slot-filled form.remove { position: absolute; top: 6px; right: 6px; }
.slot-filled form.remove button {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
}
.slot-filled form.remove button:hover { color: var(--terracotta-dark); }

.slot-empty {
  border: 1.5px dashed #d9c9ae;
  border-radius: 10px;
  padding: 4px;
}
.slot-empty form { display: flex; gap: 4px; }
.slot-empty select {
  flex-grow: 1;
  border: none;
  background: transparent;
  font-size: 11.5px;
  color: var(--ink-faint);
  font-family: inherit;
  padding: 6px 4px;
}
.slot-empty button {
  border: none;
  background: transparent;
  color: var(--terracotta-dark);
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  padding: 0 6px;
}

.day-total {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--terracotta-dark);
}

@media (max-width: 900px) {
  .plan-grid { grid-template-columns: repeat(7, minmax(150px, 1fr)); }
  .recipe-detail .columns { grid-template-columns: 1fr; }
}
