/* ==========================================================================
   /tools/feeding-schedule
   Inherits hero/FAQ base from maternity-bag.css
   ========================================================================== */
@import url("/assets/css/maternity-bag.css");

:root {
  --fs-green: #7fbf6a;
  --fs-orange: #e8a661;
  --fs-soft-bg: #faf7f0;
}

/* ---------- Page & Hero ---------- */
.fs-page {
  background: #faf8f1 !important;
}

.fs-hero {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(245, 230, 195, 0.5) 100%),
    url("/assets/images/feeding-schedule-hero-bg.webp") center / cover no-repeat,
    linear-gradient(180deg, #ffffff 0%, #f3e6c3 100%) !important;
  border-bottom-color: #e8d8a8 !important;
}

.fs-hero .mb-hero-title span::after {
  background: linear-gradient(90deg, rgba(127, 191, 106, 0.55), rgba(232, 166, 97, 0.45));
}

.fs-form-section { margin-bottom: 0 !important; }

/* ==========================================================================
   FORM
   ========================================================================== */
.fs-form-card {
  background: #fff;
  border: 1px solid #ece5d0;
  border-radius: 20px;
  padding: 32px 36px;
  margin: 0 0 12px;
  box-shadow: 0 4px 20px rgba(17, 17, 17, 0.04);
}

.fs-form-title {
  font-family: "Montserrat", sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 22px !important;
  color: var(--main-bg-color);
}

.fs-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.fs-field { min-width: 0; }

.fs-field label {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--main-bg-color);
  margin-bottom: 8px;
}

.fs-field input[type="date"],
.fs-field select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #ece5d0;
  border-radius: 12px;
  font-family: "Nunito", sans-serif;
  font-size: 16px;
  color: var(--main-bg-color);
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.fs-field select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.fs-field input:focus,
.fs-field select:focus {
  outline: none;
  border-color: var(--fs-green);
  box-shadow: 0 0 0 3px rgba(127, 191, 106, 0.18);
}

.fs-field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: #777;
  line-height: 1.4;
}

/* ---------- Кастомный select ---------- */
.fs-select {
  position: relative;
}
.fs-select .fs-select-native {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  opacity: 0;
  pointer-events: none;
}
.fs-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid #ece5d0;
  border-radius: 12px;
  font-family: "Nunito", sans-serif;
  font-size: 16px;
  color: var(--main-bg-color);
  background: #fafbfc;
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fs-select-trigger:hover {
  border-color: #d9c98a;
}
.fs-select-trigger:focus-visible,
.fs-select[data-open="true"] .fs-select-trigger {
  outline: none;
  border-color: var(--fs-green);
  box-shadow: 0 0 0 3px rgba(127, 191, 106, 0.18);
}
.fs-select-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fs-select-caret {
  flex-shrink: 0;
  color: #999;
  transition: transform 0.22s ease, color 0.18s;
}
.fs-select[data-open="true"] .fs-select-caret {
  transform: rotate(180deg);
  color: var(--fs-green);
}
.fs-select-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #ece5d0;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.12);
  padding: 6px;
  margin: 0;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.fs-select[data-open="true"] .fs-select-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.fs-select-option {
  padding: 11px 14px;
  border-radius: 8px;
  font-family: "Nunito", sans-serif;
  font-size: 15px;
  color: var(--main-bg-color);
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.fs-select-option:hover,
.fs-select-option.is-focused {
  background: #f0f8ea;
}
.fs-select-option[aria-selected="true"] {
  background: var(--fs-green);
  color: #fff;
  font-weight: 600;
}
.fs-select-option[aria-selected="true"]:hover,
.fs-select-option[aria-selected="true"].is-focused {
  background: #6aa554;
}

/* Адаптив для select на мобильном */
@media (max-width: 576px) {
  .fs-select-trigger {
    padding: 12px 14px;
    font-size: 15px;
  }
  .fs-select-option {
    padding: 10px 12px;
    font-size: 14px;
  }
}

.fs-calc-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  background: var(--main-bg-color);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.fs-calc-btn:hover { background: #000; }
.fs-calc-btn:active { transform: scale(0.99); }

/* ==========================================================================
   RESULTS
   ========================================================================== */
.fs-results { margin: 28px 0 36px; }

/* ---------- Summary ---------- */
.fs-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.fs-summary-item {
  padding: 16px 20px;
  background: linear-gradient(135deg, #fff 0%, var(--fs-soft-bg) 100%);
  border: 1px solid #ece5d0;
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(17, 17, 17, 0.04);
}

.fs-summary-label {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.fs-summary-value {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--main-bg-color);
  line-height: 1.2;
}

/* ---------- Filters ---------- */
.fs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.fs-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid #ece5d0;
  border-radius: 999px;
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--main-bg-color);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fs-filter:hover {
  border-color: var(--fs-green);
  background: #f5fbf2;
}

.fs-filter.is-active {
  background: var(--main-bg-color);
  color: #fff;
  border-color: var(--main-bg-color);
}

.fs-filter-icon {
  font-size: 15px;
  line-height: 1;
}

/* ---------- Timeline ---------- */
.fs-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fs-tl-item {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #ece5d0;
  border-radius: 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.fs-tl-item:hover {
  border-color: #d9c98a;
  transform: translateY(-1px);
}

.fs-tl-item.is-done {
  background: linear-gradient(135deg, #fff 0%, #eaf6e2 100%);
  border-color: #c3e0ad;
}

.fs-tl-item.is-current {
  background: linear-gradient(135deg, #fff 0%, #fff0d8 100%);
  border-color: #e8d39a;
  border-width: 2px;
  padding: 13px 17px;
}

.fs-tl-item.is-late {
  background: linear-gradient(135deg, #fff 0%, #ffe5e3 100%);
  border-color: #f0c7c4;
}

.fs-tl-item.is-hidden {
  display: none;
}

.fs-tl-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid #ece5d0;
}

.fs-tl-item.is-done .fs-tl-icon {
  background: var(--fs-green);
  border-color: #6aa554;
  color: #fff;
  font-size: 0;
}
.fs-tl-item.is-done .fs-tl-icon::after {
  content: "✓";
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.fs-tl-item.is-current .fs-tl-icon {
  background: var(--fs-orange);
  border-color: #d18d4a;
}

.fs-tl-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.fs-tl-name {
  font-family: "Montserrat", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--main-bg-color);
  line-height: 1.3;
}

.fs-tl-tip {
  font-family: "Nunito", sans-serif;
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

.fs-tl-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  text-align: right;
  white-space: nowrap;
}

.fs-tl-date {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--main-bg-color);
}

.fs-tl-portion {
  font-family: "Nunito", sans-serif;
  font-size: 12px;
  color: #888;
}

.fs-tl-portion strong {
  color: var(--fs-green);
}

.fs-tl-toggle {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 2px solid #d8d3d0;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}

.fs-tl-toggle:hover {
  border-color: var(--fs-green);
}

.fs-tl-item.is-done .fs-tl-toggle {
  background: var(--fs-green);
  border-color: #6aa554;
}

.fs-tl-item.is-done .fs-tl-toggle::before {
  content: "✓";
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

/* ==========================================================================
   REFERENCE TABLE
   ========================================================================== */
.fs-ref-section { margin: 36px 0; }

.fs-ref-title {
  font-family: "Montserrat", sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px !important;
  color: var(--main-bg-color);
}

.fs-ref-wrap {
  background: #fff;
  border: 1px solid #ece5d0;
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: 0 4px 16px rgba(17, 17, 17, 0.04);
}

.fs-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Nunito", sans-serif;
  min-width: 560px;
}

.fs-ref-table th,
.fs-ref-table td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid #f5ebd5;
  font-size: 14px;
}

.fs-ref-table th {
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #777;
  background: var(--fs-soft-bg);
}

.fs-ref-table tbody tr:last-child td { border-bottom: none; }
.fs-ref-table tbody tr:hover { background: #fdfaf0; }

/* ==========================================================================
   FORBIDDEN BLOCKS
   ========================================================================== */
.fs-forbidden-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}

.fs-forbidden-card {
  --accent: #c25656;
  --accent-bg: #fdf2f2;
  background: #fff;
  border: 1px solid #f0d8d6;
  border-radius: 18px;
  padding: 22px 24px 20px;
  box-shadow: 0 4px 16px rgba(17, 17, 17, 0.04);
  overflow: hidden;
}

.fs-forbidden-card:nth-child(2) {
  --accent: #d18d4a;
  --accent-bg: #fdf5e8;
  border-color: #f0d9b5;
}

.fs-forbidden-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 16px !important;
  color: var(--main-bg-color);
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--accent);
  letter-spacing: -0.01em;
}

.fs-forbidden-card h3::first-letter {
  /* Эмодзи в заголовке — отдельный визуальный bullet */
  font-size: 1.15em;
}

.fs-forbidden-card ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.fs-forbidden-card li {
  position: relative;
  padding: 8px 12px 8px 30px !important;
  margin: 0 !important;
  font-family: "Nunito", sans-serif;
  font-size: 13.5px;
  color: #3a2727;
  line-height: 1.4;
  background: var(--accent-bg);
  border-radius: 8px;
  transition: background 0.15s;
}

.fs-forbidden-card:nth-child(2) li {
  color: #3a2c0f;
}

.fs-forbidden-card li:hover {
  background: color-mix(in srgb, var(--accent-bg) 80%, var(--accent) 20%);
}

.fs-forbidden-card li::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 10px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateY(-50%);
}

/* ==========================================================================
   SOURCES (shared pattern)
   ========================================================================== */
.sr-sources-block {
  margin: 32px 0 8px;
  padding: 26px 30px 22px !important;
  background: linear-gradient(180deg, #ffffff 0%, #faf8f1 100%);
  border: 1px solid #ece5cf;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(189, 160, 0, 0.05);
}
.sr-sources-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px dashed #e3dcc2;
}
.sr-sources-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; background: var(--gold-color); color: #fff;
  border-radius: 10px; flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(189, 160, 0, 0.25);
}
.sr-sources-head h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 20px !important; font-weight: 800 !important;
  margin: 0 !important; letter-spacing: -0.02em;
  color: var(--main-bg-color);
}
.sr-sources {
  counter-reset: sr-source;
  list-style: none !important; margin: 0 !important; padding: 0 !important;
  font-size: 13.5px !important; line-height: 1.6 !important;
  color: var(--main-bg-color);
}
.sr-sources li {
  position: relative; counter-increment: sr-source;
  padding: 10px 12px 10px 42px !important; margin: 0 !important;
  border-radius: 10px; transition: background 0.2s ease;
}
.sr-sources li:hover { background: rgba(189, 160, 0, 0.04); }
.sr-sources li::before {
  content: counter(sr-source);
  position: absolute; left: 8px; top: 9px;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid #e3dcc2; border-radius: 50%;
  font-family: "Montserrat", sans-serif;
  font-size: 11px; font-weight: 800; color: var(--gold-color);
}
.sr-sources-authors { font-weight: 700; color: var(--main-bg-color); margin-right: 4px; }
.sr-sources cite { font-style: italic; color: var(--main-bg-color); }
.sr-sources a {
  color: var(--main-bg-color); text-decoration: underline;
  text-decoration-color: rgba(189, 160, 0, 0.5);
  text-decoration-thickness: 1.5px; text-underline-offset: 2px;
  transition: text-decoration-color 0.2s, color 0.2s;
}
.sr-sources a:hover { color: #8a7600; text-decoration-color: var(--gold-color); }
.sr-sources a[target="_blank"]::after {
  content: "\2197"; display: inline-block; margin-left: 3px;
  font-size: 0.85em; color: var(--gold-color);
  text-decoration: none; vertical-align: middle;
}
.sr-sources-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  background: rgba(189, 160, 0, 0.12); color: #8a7600;
  border-radius: 999px;
  font-family: "Montserrat", sans-serif;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  vertical-align: middle; white-space: nowrap;
}
.sr-sources-note {
  margin: 16px 0 0 !important; padding: 10px 14px !important;
  background: rgba(255, 255, 255, 0.6);
  border-left: 3px solid var(--gold-color);
  border-radius: 8px;
  font-size: 12.5px !important; line-height: 1.5 !important;
  color: #444; font-style: italic;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 700px) {
  /* Источники — переделка под мобильный без выпирающих цифр */
  .sr-sources-block {
    padding: 20px 18px 18px !important;
    border-radius: 14px;
  }
  .sr-sources-head {
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }
  .sr-sources-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }
  .sr-sources-head h2 {
    font-size: 17px !important;
  }
  .sr-sources li {
    padding: 12px 14px !important;
    margin: 0 0 8px !important;
    background: #fff;
    border: 1px solid #f0e7d1;
    border-radius: 12px;
    font-size: 13px !important;
    line-height: 1.55 !important;
  }
  .sr-sources li:last-child { margin-bottom: 0 !important; }
  .sr-sources li:hover { background: #fffaee; }
  /* Цифра внутри строки текста, не выпирает */
  .sr-sources li::before {
    position: static;
    display: inline-flex;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    vertical-align: -5px;
    background: var(--gold-color);
    color: #fff;
    border: none;
    font-size: 11.5px;
    box-shadow: 0 2px 4px rgba(189, 160, 0, 0.25);
  }
  .sr-sources-note {
    margin-top: 14px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 768px) {
  .fs-form-card { padding: 22px 18px; }
  .fs-form-grid { grid-template-columns: 1fr; gap: 14px; }
  .fs-summary { grid-template-columns: 1fr; }
  .fs-summary-item { padding: 12px 16px; }
  .fs-summary-value { font-size: 16px; }
  .fs-forbidden-section { grid-template-columns: 1fr; }
  .fs-tl-item {
    grid-template-columns: 42px 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px;
  }
  .fs-tl-icon { grid-row: 1 / 3; width: 42px; height: 42px; font-size: 18px; }
  .fs-tl-content { grid-column: 2; grid-row: 1; }
  .fs-tl-meta { grid-column: 2; grid-row: 2; align-items: flex-start; text-align: left; }
  .fs-tl-toggle { grid-column: 3; grid-row: 1 / 3; align-self: center; }
}

@media (max-width: 576px) {
  .fs-form-card { padding: 18px 14px; }
  .fs-form-title { font-size: 19px; }
  .fs-filter { font-size: 12px; padding: 7px 11px; }
  .fs-tl-item { padding: 12px 14px; }
  .fs-tl-name { font-size: 14px; }
  .fs-tl-tip { font-size: 12px; }

  /* Справочная таблица превращается в карточки — без горизонтального скролла */
  .fs-ref-wrap { overflow-x: visible; }
  .fs-ref-table { min-width: 0; }
  .fs-ref-table thead { display: none; }
  .fs-ref-table,
  .fs-ref-table tbody,
  .fs-ref-table tr { display: block; width: 100%; }
  .fs-ref-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid #f5ebd5;
  }
  .fs-ref-table tbody tr:last-child { border-bottom: none; }
  .fs-ref-table tbody tr:hover { background: transparent; }
  .fs-ref-table td {
    display: inline-flex;
    align-items: baseline;
    padding: 0;
    border: none;
    font-size: 13px;
  }
  .fs-ref-table td:first-child {
    display: block;
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--main-bg-color);
    margin-bottom: 10px;
  }
  .fs-ref-table td:not(:first-child) {
    margin: 4px 8px 0 0;
    padding: 3px 10px;
    background: #fafbfc;
    border: 1px solid #ece5d0;
    border-radius: 999px;
    color: #444;
    line-height: 1.4;
    white-space: nowrap;
  }
  .fs-ref-table td:nth-child(2)::before { content: "ГВ: "; color: #8a7a4a; font-weight: 700; margin-right: 4px; }
  .fs-ref-table td:nth-child(3)::before { content: "ИВ: "; color: #8a7a4a; font-weight: 700; margin-right: 4px; }
  .fs-ref-table td:nth-child(4)::before { content: "старт: "; color: #8a7a4a; font-weight: 700; margin-right: 4px; }
  .fs-ref-table td:nth-child(5)::before { content: "к году: "; color: #4a7a3d; font-weight: 700; margin-right: 4px; }
  .fs-ref-table td:nth-child(5) {
    background: #eaf6e2;
    border-color: #c3e0ad;
  }
}

/* ==========================================================================
   WIDGET
   ========================================================================== */
.tool-widget-fs {
  background: linear-gradient(135deg, #eaf6e2 0%, #fff0d8 100%);
  border: 1px solid #c3e0ad;
}

.tool-widget-fs .tool-widget-tag {
  background: var(--fs-green);
  color: #fff;
}

.tool-widget-fs .tool-widget-bag em {
  color: #4a7a3d;
}
