/*
 * Agropa Group - modern, minimal design in the original Agropa colours.
 * Lime is used as an accent; text uses darker greens for readable contrast.
 */

:root {
  --agr-lime: #8fbc03;
  --agr-lime-2: #a0c629;
  --agr-lime-soft: #eef6d6;
  --agr-cream: #f5f9ea;
  --agr-yellow: #ffe201;
  --agr-green-text: #4f7300;
  --agr-green-deep: #33490a;
  --agr-ink: #2b3320;
  --agr-muted: #6b7262;
  --agr-line: #e3ebcc;
  --agr-radius: 12px;
  --agr-shadow: 0 1px 2px rgba(51, 73, 10, .06), 0 4px 16px rgba(51, 73, 10, .06);
  --agr-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Cassiopeia component styling in Agropa colours */
  --cassiopeia-color-primary: var(--agr-green-text);
  --cassiopeia-color-link: var(--agr-green-text);
  --cassiopeia-color-hover: var(--agr-green-deep);
  --cassiopeia-font-family-body: var(--agr-font);
  --cassiopeia-font-family-headings: var(--agr-font);
  --link-color: var(--agr-green-text);
  --link-hover-color: var(--agr-green-deep);
}

body.agropa {
  margin: 0;
  color: var(--agr-ink);
  background: var(--agr-cream);
  font-family: var(--agr-font);
  font-size: 16px;
  line-height: 1.6;
}

.agr-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.agr-skip:focus {
  position: absolute;
  z-index: 100;
  padding: .5rem 1rem;
  background: #fff;
}

/* --- header ----------------------------------------------------------------- */
.agr-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-top: 4px solid var(--agr-lime);
  box-shadow: 0 1px 0 var(--agr-line);
}

/* two rows: brand + flags, then the full-width menu (fits long RU/EN labels) */
.agr-header-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
}

.agr-brand { order: 1; padding: 12px 0; }
.agr-lang { order: 2; margin-left: auto; }
.agr-nav-toggle { order: 3; }
.agr-nav { order: 4; }

.agr-brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  color: var(--agr-ink);
  text-decoration: none;
}

.agr-brand:hover {
  color: var(--agr-ink);
}

/* original "AGRO PA GROUP s.r.o." lettering (scripts/build-wordmark.py) */
.agr-brand-wordmark {
  display: block;
  width: auto;
  height: 40px;
}

/* main menu (horizontal) */
.agr-nav {
  flex-basis: 100%;
  border-top: 1px solid var(--agr-line);
}

.agr-nav .mod-menu {
  display: flex;
  flex-direction: row; /* Cassiopeia sets .mod-menu to column */
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 2px;
  margin-left: -10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agr-nav .mod-menu > li {
  padding: 0;
}

.agr-nav .mod-menu > li > a {
  display: block;
  padding: 12px 10px;
  color: var(--agr-ink);
  font-size: .93rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
}

.agr-nav .mod-menu > li > a:hover {
  color: var(--agr-green-deep);
  background: var(--agr-lime-soft);
}

.agr-nav .mod-menu > li.active > a,
.agr-nav .mod-menu > li.current > a {
  color: var(--agr-green-deep);
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--agr-lime);
  border-radius: 0;
}

/* language flags: no backgrounds, lime ring on the active one */
.agr-lang .mod-languages ul {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agr-lang .mod-languages li,
.agr-lang .mod-languages li.lang-active {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
}

.agr-lang .mod-languages a {
  display: block;
  padding: 2px;
  line-height: 0;
  border-radius: 4px;
  opacity: .6;
  transition: opacity .15s;
}

.agr-lang .mod-languages a:hover,
.agr-lang .mod-languages li.lang-active a {
  opacity: 1;
}

.agr-lang .mod-languages li.lang-active a {
  box-shadow: 0 0 0 2px var(--agr-lime);
}

.agr-lang .mod-languages img {
  width: 22px;
  height: auto;
  border-radius: 2px;
}

/* hamburger (narrow screens only) */
.agr-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  margin-left: auto;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--agr-line);
  border-radius: 8px;
}

.agr-nav-toggle span {
  display: block;
  height: 2px;
  background: var(--agr-ink);
  border-radius: 2px;
}

/* --- home hero ------------------------------------------------------------- */
/* photo strip from the old header; the top ~65 px (old lettering, duplicating
   the header logo) is cropped away */
.agr-hero {
  margin-top: 24px;
  overflow: hidden;
  aspect-ratio: 936 / 124;
  border-radius: var(--agr-radius);
  box-shadow: var(--agr-shadow);
}

.agr-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

/* --- layout ----------------------------------------------------------------- */
.agr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main" "left" "right";
  gap: 24px;
  padding-top: 24px;
  padding-bottom: 48px;
}

.agr-main { grid-area: main; min-width: 0; }
.agr-side-left { grid-area: left; }
.agr-side-right { grid-area: right; }

@media (min-width: 992px) {
  .agr-layout.has-left { grid-template-columns: 240px minmax(0, 1fr); grid-template-areas: "left main" "left right"; }
  .agr-layout.has-right { grid-template-columns: minmax(0, 1fr) 260px; grid-template-areas: "main right"; }
  .agr-layout.has-left.has-right { grid-template-columns: 240px minmax(0, 1fr); grid-template-areas: "left main" "left right"; }
  .agr-layout.has-left.has-right .agr-side-right { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; align-items: start; }
}

@media (min-width: 1200px) {
  .agr-layout.has-left.has-right { grid-template-columns: 230px minmax(0, 1fr) 250px; grid-template-areas: "left main right"; }
  .agr-layout.has-left.has-right .agr-side-right { display: block; }
}

.agr-card {
  background: #fff;
  border: 1px solid var(--agr-line);
  border-radius: var(--agr-radius);
  box-shadow: var(--agr-shadow);
}

.agr-content {
  display: flow-root; /* contain floated images from article/blog layouts */
  padding: 32px clamp(20px, 4vw, 40px);
}

/* breadcrumbs: quiet, single line of muted links */
.agr-main .mod-breadcrumbs {
  margin: 0 0 12px;
  padding: 0 4px;
  color: var(--agr-muted);
  background: none;
  font-size: .85rem;
}

.agr-main .mod-breadcrumbs__here {
  display: none;
}

.agr-main .mod-breadcrumbs a {
  color: var(--agr-muted);
  text-decoration: none;
}

.agr-main .mod-breadcrumbs a:hover {
  color: var(--agr-green-deep);
  text-decoration: underline;
}

.agr-main .mod-breadcrumbs .active {
  color: var(--agr-ink);
}

/* --- side cards --------------------------------------------------------------- */
.agr-side .moduletable {
  margin: 0 0 24px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--agr-line);
  border-radius: var(--agr-radius);
  box-shadow: var(--agr-shadow);
  font-size: .9rem;
}

.agr-side .moduletable > h3 {
  margin: 0 0 12px;
  padding-bottom: 10px;
  color: var(--agr-green-deep);
  border-bottom: 2px solid var(--agr-lime);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.agr-side ul {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agr-side li {
  margin: 0;
  padding: 0;
}

.agr-side li a {
  display: block;
  padding: 6px 8px;
  margin: 0 -8px;
  color: var(--agr-ink);
  text-decoration: none;
  border-radius: 6px;
  line-height: 1.35;
}

.agr-side li a:hover {
  color: var(--agr-green-deep);
  background: var(--agr-lime-soft);
}

.agr-side li.active > a,
.agr-side li.current > a {
  color: var(--agr-green-deep);
  font-weight: 700;
  background: var(--agr-lime-soft);
}

.agr-side a {
  color: var(--agr-green-text);
}

.agr-side img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.agr-side p,
.agr-side address {
  margin: 0 0 .6rem;
  font-style: normal;
}

.agr-side .mod-randomimage {
  text-align: center;
}

/* --- content typography ---------------------------------------------------- */
.agr-content h1, .agr-content h2, .agr-content h3,
.agr-content h4, .agr-content h5, .agr-content h6 {
  margin: 1.4em 0 .5em;
  color: var(--agr-green-deep);
  font-weight: 700;
  line-height: 1.25;
}

.agr-content h1 { font-size: 1.75rem; }
.agr-content h2 { font-size: 1.4rem; }
.agr-content h3 { font-size: 1.2rem; }
.agr-content h4, .agr-content h5, .agr-content h6 { font-size: 1.05rem; }

.agr-content > :first-child,
.agr-content .page-header h1,
.agr-content .page-header h2 {
  margin-top: 0;
}

.agr-content .page-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--agr-line);
}

.agr-content p {
  margin: 0 0 1em;
}

.agr-content a:not(.btn) {
  color: var(--agr-green-text);
  text-decoration: underline;
  text-decoration-color: var(--agr-lime);
  text-underline-offset: 3px;
}

.agr-content a:not(.btn):hover {
  color: var(--agr-green-deep);
}

.agr-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.agr-content ul:not([class]) {
  padding-left: 1.2em;
}

.agr-content ul:not([class]) li::marker {
  color: var(--agr-lime);
}

.agr-content table {
  max-width: 100%;
}

.agr-content .btn-primary,
.agr-content .btn-secondary {
  color: #fff;
  background: var(--agr-green-text);
  border-color: var(--agr-green-text);
  border-radius: 8px;
}

/* the home page shows the hero instead of the article title */
.agr-home .agr-content .page-header {
  display: none;
}

/* --- catalogue and listings -------------------------------------------------- */
.agr-content .blog-items {
  gap: 16px;
}

.agr-content .blog-item {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--agr-line);
  border-radius: 10px;
  transition: box-shadow .15s, border-color .15s;
}

.agr-content .blog-item:hover {
  border-color: var(--agr-lime-2);
  box-shadow: var(--agr-shadow);
}

.agr-content .blog-item .item-image {
  margin: 0 0 10px;
}

.agr-content .blog-item .item-image img,
.agr-content .item-page .item-image img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  background: #fff;
}

.agr-content .blog-item h2 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.agr-content .blog-item h2 a {
  text-decoration: none;
}

.agr-content .blog-item p {
  margin-bottom: .3em;
  color: var(--agr-muted);
  font-size: .9rem;
}

.agr-content .com-content-category-blog__children,
.agr-content .com-content-categories__items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.agr-content .com-content-category-blog__children > div,
.agr-content .com-content-categories__items > div {
  padding: 12px 14px;
  background: var(--agr-cream);
  border: 1px solid var(--agr-line);
  border-radius: 10px;
}

.agr-content .com-content-category-blog__children h3,
.agr-content .com-content-categories__items h3 {
  margin: 0;
  font-size: 1rem;
}

.agr-content .com-content-category-blog__children a,
.agr-content .com-content-categories__items a {
  text-decoration: none;
}

/* --- product pages: photo box + spec table -------------------------------------- */
.agr-content .item-page:has(> figure.item-image) {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 0 32px;
  align-items: start;
}

.agr-content .item-page:has(> figure.item-image) > :not(figure):not(.com-content-article__body) {
  grid-column: 1 / -1;
}

.agr-content .item-page > figure.item-image {
  display: flex;
  justify-content: center;
  float: none;
  margin: 0 0 20px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--agr-line);
  border-radius: 10px;
}

.agr-content .item-page > figure.item-image img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 0;
}

@media (max-width: 640px) {
  .agr-content .item-page:has(> figure.item-image) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.agr-content dl.agr-specs {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0 0 1em;
  overflow: hidden;
  border: 1px solid var(--agr-line);
  border-radius: 10px;
}

.agr-specs dt,
.agr-specs dd {
  margin: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--agr-line);
}

.agr-specs dt {
  color: var(--agr-muted);
  background: var(--agr-cream);
  font-weight: 600;
}

.agr-specs dd {
  color: var(--agr-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.agr-specs dt:nth-last-of-type(1),
.agr-specs dd:last-of-type {
  border-bottom: 0;
}

/* product cards in category listings */
.agr-content .blog-item {
  display: flex;
  flex-direction: column;
}

.agr-content .blog-item > figure.item-image {
  float: none;
  width: 100%;
  margin: 0 0 12px;
}

.agr-content .blog-item > figure.item-image a,
.agr-content .blog-item > figure.item-image > img {
  display: flex;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: #fff;
}

.agr-content .blog-item .item-image img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.agr-content .blog-item .page-header {
  margin: 0;
  padding: 0;
  border: 0;
}

.agr-content .blog-item dl.agr-specs {
  display: block;
  margin: 6px 0 0;
  border: 0;
  border-radius: 0;
  font-size: .82rem;
}

.agr-content .blog-item .agr-specs dt,
.agr-content .blog-item .agr-specs dd {
  display: inline;
  padding: 0;
  background: none;
  border: 0;
}

.agr-content .blog-item .agr-specs dd {
  margin-right: 10px;
}

.agr-content .blog-item .agr-specs dd::after {
  content: "";
  display: block;
}

/* --- photo albums -------------------------------------------------------------- */
.agr-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.agr-gallery a {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
}

.agr-content .agr-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform .2s;
}

.agr-gallery a:hover img {
  transform: scale(1.04);
}

.agr-lightbox {
  max-width: min(95vw, 1100px);
  padding: 10px;
  border: 0;
  border-radius: var(--agr-radius);
}

.agr-lightbox::backdrop { background: rgba(20, 28, 5, .85); }
.agr-lightbox img { display: block; max-width: 100%; max-height: 82vh; margin: 0 auto; border-radius: 6px; }
.agr-lightbox-caption { margin: 6px 0 0; color: var(--agr-muted); text-align: center; }

.agr-lightbox-close {
  position: absolute;
  top: 6px;
  right: 10px;
  color: var(--agr-ink);
  background: rgba(255, 255, 255, .9);
  border: 0;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
}

.agr-map iframe {
  border-radius: var(--agr-radius);
}

/* --- footer -------------------------------------------------------------------- */
.agr-footer {
  color: #e8f2c8;
  background: var(--agr-green-deep);
  border-top: 4px solid var(--agr-lime);
}

.agr-footer-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding-top: 28px;
  padding-bottom: 28px;
  font-size: .9rem;
}

.agr-footer-emblem {
  width: auto;
  height: 32px;
  padding: 4px 8px;
  background: #fff;
  border-radius: 8px;
}

.agr-footer p {
  margin: 0;
}

.agr-footer a {
  color: #fff;
}

/* --- narrow screens -------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .agr-header-in {
    gap: 0 12px;
  }

  .agr-nav-toggle {
    display: flex;
    margin-left: 0;
  }

  .agr-nav {
    display: none;
    padding-bottom: 12px;
  }

  .agr-nav.is-open {
    display: block;
  }

  .agr-nav .mod-menu {
    flex-direction: column;
    gap: 0;
  }

  .agr-nav .mod-menu > li > a {
    padding: 10px 8px;
  }

  .agr-brand-wordmark {
    height: 30px;
  }
}
