:root {
  --radius: 14px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Header ---- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 8px 16px;
}
.elp-logo { display: flex; align-items: center; gap: 10px; }
.elp-logo-word { font-size: 1.15rem; font-weight: 600; color: var(--text); }
.elp-logo-word strong { color: var(--primary); }

.main-nav {
  order: 3;
  flex: 1 1 100%;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding-top: 12px;
  margin-top: 2px;
  border-top: 1px solid var(--border);
}
.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.header-tools { order: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.switcher {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.82rem;
}
.switcher a,
.switcher button {
  padding: 6px 12px;
  color: var(--text-muted);
}
.switcher button {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  line-height: inherit;
  margin: 0;
  cursor: pointer;
}
.switcher a.active,
.switcher button.active { background: var(--accent); color: var(--text); font-weight: 600; }
.switcher a.disabled { opacity: 0.4; pointer-events: none; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 72px 0 86px;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  margin: 0 0 18px;
  max-width: 820px;
  font-weight: 700;
}
.hero p {
  font-size: 1.15rem;
  max-width: 620px;
  opacity: 0.92;
  margin: 0 0 30px;
}
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 2px solid transparent;
}
.btn-primary { background: var(--accent-strong); color: #0B1120; }
.btn-secondary { background: transparent; border-color: rgba(255,255,255,0.55); color: #fff; }

.stats-row {
  display: flex;
  gap: 40px;
  margin-top: 46px;
  flex-wrap: wrap;
}
.stat b { display: block; font-size: 2rem; }
.stat span { font-size: 0.9rem; opacity: 0.8; }

/* ---- Sections ---- */
section.block { padding: 56px 0; }
section.block.alt { background: var(--surface); }
.block-head { max-width: 640px; margin-bottom: 32px; }
.block-head h2 { font-size: 1.8rem; margin: 0 0 8px; color: var(--text); }
.block-head p { color: var(--text-muted); margin: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card .price-old { text-decoration: line-through; color: var(--text-muted); font-size: 0.9rem; }
.card .price-new { font-size: 1.3rem; font-weight: 700; color: var(--primary-dark); }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.badge.down { background: #DCF8E8; color: #0A7A43; }
.badge.up { background: #FDE7E7; color: #B3261E; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.tool-card {
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.tool-card .icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--accent);
  margin-bottom: 14px;
}

.newsletter {
  background: var(--primary-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.newsletter form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter input[type=email] {
  padding: 12px 16px;
  border-radius: 999px;
  border: none;
  min-width: 240px;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 50px 0 24px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}
.footer-grid h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 0.9rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 18px;
  font-size: 0.8rem;
  opacity: 0.75;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.legal-content { max-width: 760px; }
.legal-content h2 { font-size: 1.2rem; margin: 32px 0 10px; color: var(--text); }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { color: var(--text-muted); margin: 0 0 6px; }
.legal-content a { text-decoration: underline; }
.legal-content .legal-updated { margin-top: 28px; font-size: 0.85rem; opacity: 0.75; }

.coming-soon {
  text-align: center;
  padding: 110px 20px;
}
.coming-soon h1 { font-size: 2rem; }
.coming-soon p { color: var(--text-muted); }

/* ---- Page head (inner pages) ---- */
.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
}
.page-head h1 { margin: 0 0 8px; font-size: 1.9rem; }
.page-head p { margin: 0; color: var(--text-muted); }

/* ---- Prices filters ---- */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--text); font-weight: 600; }

.filter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-form select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
}

/* ---- Price table ---- */
.price-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.price-table-head, .price-row {
  display: grid;
  grid-template-columns: 2.4fr 0.9fr 0.9fr 0.9fr 0.7fr 0.5fr;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
}
.p-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg);
  margin-right: 10px;
  flex-shrink: 0;
}
.card-thumb {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
  margin: 0 0 10px;
  background: var(--bg);
  border-radius: 10px;
}
.flyer-link {
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: underline;
}
.meta-line { color: var(--text-muted); font-size: 0.85rem; }
.crumb { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 8px; }
.crumb a { text-decoration: underline; }
.flyer-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.flyer-note { color: var(--text-muted); font-size: 0.9rem; }

/* Catalog index (covers) */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 22px;
}
.catalog-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  position: relative;
  transition: transform 0.2s ease;
}
.catalog-card:hover { transform: translateY(-3px); }
.catalog-cover {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #f3f5f7, #e7ebef);
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}
.catalog-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.catalog-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
  padding: 16px;
  text-align: center;
}
.catalog-card h2 { margin: 4px 0 0; font-size: 1.05rem; }
.catalog-card p { margin: 0; color: var(--text-muted); font-size: 0.85rem; }
.catalog-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary-dark);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.catalog-card.is-empty .catalog-cover { opacity: 0.85; }

/* Flyer viewer */
.flyer-viewer { margin-top: 8px; }
.flyer-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}
.flyer-book {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 980px;
  margin: 0 auto;
  perspective: 1800px;
  background: linear-gradient(90deg, #d9dde2 0 50%, #cfd5db 50% 100%);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
  overflow: hidden;
  min-height: 420px;
}
.flyer-viewer.is-desktop .flyer-book { display: grid; }
.flyer-viewer.is-desktop .flyer-slider { display: none; }
.flyer-viewer.is-mobile .flyer-book { display: none; }
.flyer-viewer.is-mobile .flyer-slider { display: block; }

.flyer-page-side {
  position: relative;
  background: #fff;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform-origin: left center;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.flyer-page-side[data-side="left"] { transform-origin: right center; border-right: 1px solid #c8ced4; }
.flyer-page-side.is-empty { background: #eef1f4; cursor: default; }
.flyer-page-side img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}
.flyer-book.flip-next .flyer-page-side[data-side="right"] {
  transform: rotateY(-18deg);
  opacity: 0.55;
}
.flyer-book.flip-prev .flyer-page-side[data-side="left"] {
  transform: rotateY(18deg);
  opacity: 0.55;
}

.flyer-slider { width: 100%; }
.flyer-slider-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #111;
}
.flyer-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  background: #1a1a1a;
}
.flyer-slide img {
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
}
.price-table-head {
  background: var(--bg);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.price-row { border-top: 1px solid var(--border); }
.price-row .price-old { text-decoration: line-through; color: var(--text-muted); font-size: 0.85rem; margin-right: 6px; }
.price-row .price-new { font-weight: 700; color: var(--primary-dark); }
.badge.flat { background: var(--bg); color: var(--text-muted); }

.results-count { margin-top: 14px; color: var(--text-muted); font-size: 0.85rem; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* ---- Category icons ---- */
.cat-icon {
  vertical-align: middle;
  margin-right: 8px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.card h3 .cat-icon { color: var(--primary-dark); }
.p-name { display: inline-flex; align-items: center; }

/* ---- Recipes ---- */
.recipe-meta { color: var(--text-muted); font-size: 0.85rem; margin: 8px 0; }
.recipe-ingredients { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

/* ---- Contact page ---- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.contact-form { display: flex; flex-direction: column; gap: 6px; }
.contact-form label { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-top: 10px; }
.contact-form input,
.contact-form textarea {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.contact-form button { margin-top: 18px; align-self: flex-start; }

@media (max-width: 760px) {
  .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .main-nav { display: none; }
  .hero { padding: 48px 0 56px; }
  .newsletter { flex-direction: column; align-items: flex-start; }

  .price-table-head { display: none; }
  .price-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .price-row span[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--text-muted);
  }
}
