/* ═══════════════════════════════════════════════════════════════
   בודק כרטיסי היער השחור — עיצוב
   ═══════════════════════════════════════════════════════════════ */

:root {
  --forest: #2D6A4F;
  --forest-dark: #1F4D39;
  --forest-light: #379164;
  --leaf: #52B788;
  --leaf-soft: #52B78822;
  --leaf-bg: #E8F6EF;
  --leaf-text: #1E6E4E;
  --gold: #C9A961;
  --gold-soft: #C9A96122;
  --gold-border: #C9A96166;
  --orange: #C4622D;
  --orange-soft: #C4622D1f;
  --orange-strong: #A8501F;
  --paper: #F7F5F0;
  --card-bg: #FFFFFF;
  --red: #B23A3A;
  --red-soft: #B23A3A1a;
  --navy: #1B3A4B;
  --ink: #1B3A4B;
  --ink-muted: #5C7268;
  --border: #E5E1D8;
  --shadow: 0 2px 10px rgba(27, 58, 75, 0.08);
  --shadow-hover: 0 10px 26px rgba(27, 58, 75, 0.16);
  --radius: 14px;
  --transition: 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: linear-gradient(180deg, #F7F5F0 0%, #EAF3EC 100%);
  color: var(--ink);
  font-family: 'Assistant', sans-serif;
  line-height: 1.5;
  padding-bottom: 24px;
}

h1, h2, h3, .display {
  font-family: 'Frank Ruhl Libre', serif;
  color: var(--forest-dark);
  margin: 0;
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-sm { width: 16px; height: 16px; }

/* ── Header / hero ── */
.site-header {
  position: relative;
  min-height: clamp(216px, 29vh, 342px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  padding: 18px 20px 22px;
  text-align: center;
  background-image:
    linear-gradient(180deg, rgba(27,58,42,0.72) 0%, rgba(27,58,42,0.52) 55%, rgba(27,58,42,0.34) 100%),
    url('hero.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.header-top {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}

.header-logo-wrap {
  background: rgba(247, 245, 240, 0.92);
  border-radius: 14px;
  padding: 6px 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  display: inline-flex;
  align-items: center;
}

.header-logo {
  display: block;
  height: 42px;
  width: auto;
}

.header-buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(196, 98, 45, 0.4);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap;
}

.header-buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(196, 98, 45, 0.5);
  background: var(--orange-strong);
}

.header-buy-btn.disabled {
  background: #b8b3a8;
  color: #f0eee7;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.notes-toggle {
  background: rgba(20, 35, 45, 0.3);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 16px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.notes-toggle:hover {
  background: rgba(255, 255, 255, 0.92);
  color: var(--forest-dark);
}

.notes-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.notes-toggle.open {
  background: rgba(255, 255, 255, 0.92);
  color: var(--forest-dark);
}

.notes-toggle.open .info-chevron { transform: rotate(180deg); }

.notes-panel p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}

.site-header h1 {
  color: #fff;
  font-size: clamp(22px, 3.4vw, 32px);
  letter-spacing: 0.2px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.55);
  max-width: 900px;
}

.site-subtitle {
  margin: 12px 0 0;
  color: #FDF8EE;
  font-size: 15.5px;
  font-weight: 500;
  max-width: 720px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 18px rgba(0,0,0,0.35);
}

/* ── Info toggle / expandable panel ── */
.info-toggle-wrap {
  margin-top: 16px;
  width: 100%;
  max-width: 760px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.info-toggle {
  background: rgba(247, 245, 240, 0.9);
  border: none;
  color: var(--forest-dark);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 20px;
  border-radius: 16px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.info-toggle-text { line-height: 1.3; }

.info-chevron {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  transition: transform var(--transition);
}

.info-toggle.open .info-chevron { transform: rotate(180deg); }

.info-panel {
  margin-top: 12px;
  background: rgba(247, 245, 240, 0.95);
  border-radius: 14px;
  padding: 16px 18px;
  text-align: right;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.info-panel[hidden] { display: none; }

.info-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.info-tab {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.info-tab:hover { filter: brightness(1.1); }

.info-tab[data-tab="black"] { border-color: var(--navy); color: var(--navy); }
.info-tab[data-tab="black"].active { background: var(--navy); border-color: var(--navy); color: #fff; }

.info-tab[data-tab="red"] { border-color: var(--red); color: var(--red); }
.info-tab[data-tab="red"].active { background: var(--red); border-color: var(--red); color: #fff; }

.info-tab[data-tab="howto"] { border-color: var(--forest); color: var(--forest); }
.info-tab[data-tab="howto"].active { background: var(--forest); border-color: var(--forest); color: #fff; }

.info-tab-panel { color: var(--ink); }

.info-tab-panel[hidden] { display: none; }

.info-tab-panel h4 {
  font-family: 'Frank Ruhl Libre', serif;
  color: var(--forest-dark);
  font-size: 15.5px;
  margin: 0 0 8px;
}

.info-tab-panel ul,
.info-tab-panel ol {
  margin: 0 0 8px;
  padding-inline-start: 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}

.info-tab-panel li { margin-bottom: 5px; }

.info-tab-panel a {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tab-inline-buy-btn {
  display: inline-block;
  background: var(--orange);
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  text-decoration: none !important;
  transition: background var(--transition);
}

.tab-inline-buy-btn:hover { background: var(--orange-strong); }

.tab-inline-buy-btn.disabled {
  background: #b8b3a8;
  cursor: not-allowed;
  pointer-events: none;
}

.info-panel-buy-wrap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.info-panel-buy-wrap .header-buy-btn {
  font-size: 16px;
  padding: 15px 34px;
}

/* ── Filter bar ── */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  box-shadow: var(--shadow);
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto 10px;
}

.search-box {
  flex: 1;
  position: relative;
}

.search-box-short {
  flex: 0 1 auto;
  width: 100%;
  max-width: 260px;
  min-width: 150px;
}

.search-box input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
}

.search-box input:focus { border-color: var(--leaf); }

.search-box .icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.clear-btn {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  white-space: nowrap;
  transition: background var(--transition);
}

.clear-btn:hover { background: var(--red-soft); }
.clear-btn[hidden] { display: none; }

.family-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  padding: 6px 14px;
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.28);
}

.family-widget-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--forest-dark);
  white-space: nowrap;
}

.family-widget-steppers {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.fw-stepper {
  display: flex;
  align-items: center;
  gap: 5px;
}

.fw-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  font-size: 12.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.fw-age {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-muted);
  opacity: 0.8;
}

.fw-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fw-controls button {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--paper);
  font-size: 13px;
  line-height: 1;
  color: var(--forest-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.fw-controls button:hover { border-color: var(--leaf); }

.fw-count {
  min-width: 16px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}

.toolbar-buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(196, 98, 45, 0.35);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.toolbar-buy-btn:hover {
  background: var(--orange-strong);
  transform: translateY(-1px);
}

.toolbar-buy-btn.disabled {
  background: #b8b3a8;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.chip-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}

.chip-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-inline-end: 10px;
  border-inline-end: 1px solid var(--border);
}

.chip-group:last-child {
  border-inline-end: none;
  padding-inline-end: 0;
}

@media (max-width: 640px) {
  .chip-group { border-inline-end: none; padding-inline-end: 0; }
}

.chip-group-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--forest-dark);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.chip-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.chip .icon-sm { width: 15px; height: 15px; }

.chip:hover { border-color: var(--leaf); }

.chip.active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.chip.toggle.active {
  background: var(--orange-soft);
  border-color: var(--orange);
  color: var(--orange-strong);
}

.chip-popular .icon-star {
  color: var(--orange);
  fill: var(--orange);
}

.result-counter {
  max-width: 1200px;
  margin: 10px auto 0;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.result-counter b { color: var(--forest-dark); }

/* ── Grid ── */
.grid-wrap {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px;
  padding-right: 270px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

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

.empty-state .display { font-size: 22px; margin-bottom: 10px; }

.empty-state button {
  margin-top: 16px;
  background: var(--forest);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 14px;
}

/* ── Attraction card ── */
.attraction-card {
  position: relative;
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  perspective: 1400px;
}

.attraction-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* ── Card flip (front/back) ── */
.card-flip {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 550ms ease;
}

.card-flip.flipped { transform: rotateY(180deg); }

.card-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-face-front {
  position: relative;
  padding: 34px 14px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.card-select-corner {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--leaf-bg);
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  padding: 3px 9px 3px 6px;
  font-size: 11px;
  z-index: 2;
}

.card-select-corner input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--forest);
}

.card-select-corner label {
  cursor: pointer;
  font-weight: 700;
  color: var(--forest-dark);
  white-space: nowrap;
}

.card-select-corner.disabled { background: #f0eee7; }
.card-select-corner.disabled label { color: var(--ink-muted); cursor: not-allowed; }

.card-face-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  padding: 14px 14px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card-bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.back-header h4 {
  font-size: 13.5px;
  color: var(--forest-dark);
}

.back-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  flex: 1;
}

.card-face-back .back-btn { align-self: flex-start; flex: 0 0 auto; margin-top: auto; }

.card-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.cat-icon-circle {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

.cat-icon-circle .icon { width: 19px; height: 19px; }

.card-titles { flex: 1; min-width: 0; }

.card-titles h3 {
  font-size: 16px;
  line-height: 1.3;
  color: var(--navy);
}

.card-titles .de-name {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.card-city {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 3px;
}

.card-city .icon { width: 12px; height: 12px; color: var(--gold); }

.tag-row {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 3px;
  min-width: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  padding: 2.5px 6px;
  border-radius: 999px;
  background: #f0eee7;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.tag .icon { width: 9px; height: 9px; }

button.tag {
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.tag.tag-link {
  transition: filter var(--transition), transform var(--transition);
}

.tag.tag-link:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.tag.tag-black { background: var(--navy); color: #fff; }
.tag.tag-red { background: var(--red-soft); color: var(--red); }
.tag.tag-both { background: var(--navy); color: #fff; }
.tag.tag-popular { background: var(--orange-soft); color: var(--orange-strong); }

.tag.tag-inout { background: var(--leaf-soft); color: var(--forest-dark); }

.tag.tag-bonus {
  background: transparent;
  color: var(--orange-strong);
  border: 1px solid var(--gold);
}

.desc-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.details-toggle {
  background: none;
  border: none;
  color: var(--forest);
  font-size: 13.5px;
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  align-self: flex-start;
}

.benefit-price-block {
  background: var(--leaf-bg);
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bp-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}

.bp-label {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 500;
  white-space: nowrap;
}

.bp-value {
  font-size: 13px;
  font-weight: 700;
}

.bp-value.bp-value-benefit { color: var(--leaf-text); }
.bp-value.bp-value-price { color: var(--navy); }

.bp-value.bp-value-na {
  font-weight: 400;
  color: var(--ink-muted);
}

.btn {
  flex: 1;
  min-width: 100px;
  border: none;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
}

.btn-outline:hover { border-color: var(--leaf); }

.btn-nav { flex: 0 0 auto; }

.red-note {
  font-size: 12px;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 8px;
  padding: 6px 9px;
}

.back-content .detail-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.back-content .detail-row .icon { color: var(--gold); flex-shrink: 0; }
.back-content .detail-row span { flex: 1; min-width: 0; }
.back-content .detail-address { justify-content: space-between; }

.back-content .detail-website a {
  color: var(--forest);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back-content .detail-bonus {
  color: var(--orange-strong);
}

@media (prefers-reduced-motion: reduce) {
  .card-flip { transition: none; }
}

/* ── Pagination ── */
.pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 30px 0 10px;
}

.pagination[hidden] { display: none; }

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-btn {
  background: var(--forest);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
}

.page-btn[disabled] {
  background: #d8d4c9;
  color: #9a9a9a;
  cursor: not-allowed;
}

.page-btn-step {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 14px;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.page-num {
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-num:hover { border-color: var(--leaf); }

.page-num.active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
  font-weight: 700;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--ink-muted);
}

.page-indicator-text {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ── Floating side widget ── */
.side-widget {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 90;
  width: 240px;
  max-height: 74vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--gold-border);
  border-inline-end: none;
  border-radius: 16px 0 0 16px;
  box-shadow: -6px 0 24px rgba(27, 58, 75, 0.16);
  padding: 14px 16px;
  transition: width 260ms ease, opacity 260ms ease;
}

.side-widget.empty {
  width: 200px;
  opacity: 0.94;
}

.side-widget.minimized {
  width: 150px;
  padding: 10px 12px;
}

.side-widget.minimized .sw-header-label,
.side-widget.minimized .sw-list,
.side-widget.minimized .sw-divider,
.side-widget.minimized .sw-reco-line {
  display: none;
}

.side-widget.minimized .sw-header { justify-content: center; margin-bottom: 8px; }
.side-widget.minimized .sw-cost-line { font-size: 12.5px; text-align: center; }
.side-widget.minimized .sw-cta { font-size: 12px; padding: 10px 8px; }

.sw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 700;
  color: var(--forest-dark);
  font-size: 15px;
  margin-bottom: 10px;
}

.sw-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sw-count-badge {
  background: var(--forest);
  color: #fff;
  font-family: 'Assistant', sans-serif;
  font-size: 12px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  flex-shrink: 0;
}

.sw-toggle-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--forest-dark);
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: border-color var(--transition);
}

.sw-toggle-btn:hover { border-color: var(--leaf); }

.sw-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 220px;
  margin-bottom: 10px;
}

.sw-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  transform: translateX(0);
  opacity: 1;
  max-height: 40px;
  transition: transform 320ms ease, opacity 320ms ease, max-height 320ms ease, padding 320ms ease, margin 320ms ease;
}

.sw-item.entering { transform: translateX(24px); opacity: 0; }

.sw-item.leaving {
  transform: translateX(24px);
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: -6px;
  border-width: 0;
}

.sw-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-item .value { color: var(--forest-dark); font-weight: 700; white-space: nowrap; }

.sw-item-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
}

.sw-item-remove:hover { opacity: 0.7; }

.sw-empty {
  font-size: 12.5px;
  color: var(--ink-muted);
  text-align: center;
  padding: 14px 4px;
  margin: 0;
}

.sw-divider { height: 1px; background: var(--border); margin: 4px 0 10px; }

.sw-summary { margin-bottom: 12px; }

.sw-cost-line { font-size: 15.5px; color: var(--ink); margin-bottom: 4px; }
.sw-cost-line b { color: var(--forest-dark); font-family: 'Frank Ruhl Libre', serif; }

.sw-reco-line { font-size: 14px; font-weight: 700; min-height: 1.2em; }
.sw-reco-line.positive { color: var(--leaf-text); }
.sw-reco-line.negative { color: var(--orange-strong); }

.sw-cta {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--forest);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 13px 14px;
  font-size: 14.5px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.35);
  transition: background var(--transition), transform var(--transition);
}

.sw-cta:hover { background: var(--forest-light); transform: translateY(-2px); }

.sw-fullscreen-link {
  display: block;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-bottom: 8px;
  transition: color var(--transition);
}

.sw-fullscreen-link:hover { color: var(--forest); }

.side-widget.minimized .sw-fullscreen-link { display: none; }

/* ── Sticky calculator panel ── */
.calc-container {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  pointer-events: none;
}

.calc-container.visible { display: block; }

.calc-panel { pointer-events: auto; }

.calc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 45, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.calc-overlay.open { opacity: 1; pointer-events: auto; }

.calc-panel {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  max-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
  transition: max-height 280ms ease;
}

.calc-panel.open { max-height: 86vh; }

.calc-panel-inner { position: relative; padding: 62px 20px 16px; max-width: 900px; margin: 0 auto; }

.calc-close-btn {
  position: absolute;
  top: 12px;
  left: 20px;
  background: var(--forest);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(45, 106, 79, 0.35);
  transition: background var(--transition), transform var(--transition);
}

.calc-close-btn:hover { background: var(--forest-light); transform: translateY(-1px); }

.calc-back-link {
  position: absolute;
  top: 22px;
  right: 20px;
  font-size: 12.5px;
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}

.calc-back-link:hover { color: var(--forest); }

.calc-section { margin-bottom: 22px; }

.calc-section h3 {
  font-size: 17px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.buy-indicator {
  font-size: 14px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.buy-indicator.indicator-yes { background: var(--leaf-bg); color: var(--leaf-text); }
.buy-indicator.indicator-no { background: var(--orange-soft); color: var(--orange-strong); }

.encourage-note {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.55;
}

.note-highlight {
  color: var(--leaf-text);
  font-weight: 800;
}

.steppers { display: flex; flex-direction: column; gap: 10px; }

.family-under4-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
}

.stepper-row .label { font-size: 14px; }
.stepper-row .sub { font-size: 12px; color: var(--ink-muted); display: block; }

.stepper-controls { display: flex; align-items: center; gap: 12px; }

.stepper-controls button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--paper);
  font-size: 16px;
  color: var(--forest-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-controls button:hover { border-color: var(--leaf); }
.stepper-controls .count { min-width: 22px; text-align: center; font-weight: 600; }

.selected-list { display: flex; flex-direction: column; gap: 8px; }

.selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  font-size: 13.5px;
}

.selected-item .name { flex: 1; min-width: 0; }
.selected-item .flat-note { font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; }
.selected-item .value { color: var(--forest-dark); font-weight: 600; white-space: nowrap; }
.selected-item .value.na { color: var(--ink-muted); font-weight: 400; }

.selected-item .remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 16px;
  padding: 2px 6px;
}

.no-selection { font-size: 13.5px; color: var(--ink-muted); }

.result-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 0;
}

.result-row .result-value {
  font-size: 21px;
  font-weight: 700;
  color: var(--forest-dark);
  font-family: 'Frank Ruhl Libre', serif;
  white-space: nowrap;
}

.result-config-name {
  font-size: 12px;
  color: var(--ink-muted);
  text-align: left;
  margin-top: -2px;
}

.result-divider { height: 1px; background: var(--border); margin: 12px 0; }

.verdict-box {
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.verdict-box.positive { background: var(--leaf-bg); color: var(--leaf-text); }
.verdict-box.negative { background: var(--orange-soft); color: var(--orange-strong); }

.calc-buy-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 16px;
  border-radius: 999px;
  text-decoration: none;
  margin-top: 12px;
  box-shadow: 0 4px 14px rgba(196, 98, 45, 0.35);
  transition: background var(--transition), transform var(--transition);
}

.calc-buy-btn:hover {
  background: var(--orange-strong);
  transform: translateY(-2px);
}

.calc-buy-btn.disabled {
  background: #b8b3a8;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.red-card-block {
  margin-top: 10px;
  background: var(--red-soft);
  border: 1px solid #B23A3A44;
  border-radius: 10px;
  padding: 12px 14px;
}

.red-card-block[hidden] { display: none; }

.red-card-line {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 6px;
}

.red-card-disclaimer {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.red-card-disclaimer a {
  color: var(--forest);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.disclaimer {
  font-size: 11.5px;
  color: var(--ink-muted);
  text-align: center;
  padding: 10px 0 4px;
}

.pdf-btn {
  display: block;
  width: 100%;
  background: var(--forest);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
}

.pdf-btn:hover { background: var(--forest-light); }

/* ── Print / PDF summary ── */
#printArea { display: none; }

@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea {
    display: block;
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 100%;
    padding: 20px;
    direction: rtl;
    font-family: 'Assistant', sans-serif;
    color: #000;
  }
  #printArea .print-logo {
    display: block;
    height: 46px;
    width: auto;
    margin: 0 auto 6px;
  }
  #printArea .print-logo-bottom { margin: 24px auto 0; }
  #printArea .print-credit {
    text-align: center;
    font-size: 12px;
    color: #555;
    margin-bottom: 16px;
  }
  #printArea .print-credit a { color: #2D6A4F; text-decoration: underline; }
  #printArea h1 {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 24px;
    margin: 0 0 4px;
  }
  #printArea .print-sub { color: #555; font-size: 13px; margin-bottom: 18px; }
  #printArea h2 { font-size: 16px; margin: 18px 0 8px; border-bottom: 1px solid #ccc; padding-bottom: 4px; }
  #printArea table { width: 100%; border-collapse: collapse; font-size: 13px; }
  #printArea th, #printArea td { text-align: right; padding: 6px 4px; border-bottom: 1px solid #eee; }
  #printArea .print-total { font-size: 15px; font-weight: 700; margin-top: 10px; }
  #printArea .print-verdict { margin-top: 6px; font-size: 14px; }
  #printArea .print-footer { margin-top: 30px; font-size: 11px; color: #777; border-top: 1px solid #ccc; padding-top: 8px; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .search-row { flex-wrap: wrap; }
  .search-box-short { max-width: none; }
  .header-top { flex-wrap: wrap; justify-content: center; }

  .grid-wrap { padding-right: 210px; }
  body { padding-bottom: 24px; }

  .side-widget {
    top: auto;
    bottom: 14px;
    transform: none;
    max-height: 60vh;
    width: 200px;
    padding: 12px 14px;
    border-radius: 14px 0 0 14px;
  }

  .side-widget .sw-list { max-height: 160px; }

  .side-widget:not(.minimized) .sw-cost-line { font-size: 13px; }
  .side-widget:not(.minimized) .sw-reco-line { font-size: 12px; }
  .side-widget:not(.minimized) .sw-cta { font-size: 12.5px; padding: 11px 8px; }
  .side-widget:not(.minimized) .sw-fullscreen-link { font-size: 11px; margin-bottom: 7px; }

  /* keep the back link clear of the close button on narrow screens */
  .calc-back-link {
    position: static;
    display: block;
    text-align: right;
    margin-bottom: 14px;
    font-size: 12px;
  }

  .side-widget.empty { width: 170px; }

  .side-widget.minimized {
    width: 140px;
    padding: 10px 10px;
  }
}

@media (max-width: 400px) {
  .site-header { padding: 16px 14px 16px; }
  .filter-bar { padding: 12px 14px; }
  .grid-wrap { padding-left: 14px; }
}
