/* Frontend note: Styles for category inline. */
:root {
  --container: 1240px;
  --pad-x: 24px;

  --accent: #77b255;
  --accent-weak: rgba(119, 178, 85, 0.35);

  --line: rgba(0, 0, 0, 0.08);
  --line-soft: rgba(0, 0, 0, 0.06);

  --bg: #ffffff;
  --card-bg: #ffffff;

  --radius: 16px;
  --gap-lg: 26px;

  --text: #1c1c1c;
  --muted: rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
}

.page {
  min-height: 100vh;
}
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* Top rows */
.catbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 26px 0 18px;
  border-bottom: 1px solid var(--line-soft);
}
.catbar__item {
  width: 88px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-radius: 14px;
}
.catbar__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.catbar__label {
  font-size: 12px;
  line-height: 1.1;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}
.catbar__item.is-active .catbar__icon {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.catbar__item.is-active .catbar__label {
  color: var(--accent);
}

.metarow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0 18px;
}
.metarow__right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.metarow__hint {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.metarow__links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.metarow__link {
  border: 0;
  background: transparent;
  padding: 6px 0;
  cursor: pointer;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
  text-decoration: none;
}
.metarow__link.is-current {
  color: var(--accent);
  font-weight: 600;
}
.metarow__count {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

/* Main: FILTERS on RIGHT, PRODUCTS on LEFT (RTL) */
.main {
  display: flex;
  align-items: stretch;
  gap: 26px;
  padding: 6px 0 44px;
  min-height: calc(100vh - 320px);
}

/* Sidebar */
.filters {
  width: 340px;
  flex: 0 0 auto;
}
.filters__card {
  background: #fff;
  border: 1px solid var(--accent-weak);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky;
  top: 22px;
}
.filters__head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}
.filters__title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.72);
}
.filters__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fitem {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.fitem__sum {
  list-style: none;
  cursor: pointer;
  padding: 12px 12px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fitem__sum::-webkit-details-marker {
  display: none;
}
.fitem__sum::after {
  content: "\\25BE";
  font-size: 12px;
  color: rgba(0, 0, 0, 0.35);
}
.fitem[open] .fitem__sum::after {
  content: "\\25B4";
}
.fitem__body {
  min-height: 52px;
  border-top: 1px solid var(--line-soft);
  background: #fafafa;
  padding: 8px 0;
}

.filters__toggles {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toggle__label {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
}
.toggle__pill {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #f3f3f3;
}

/* Products */
.products {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.category-feedback {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(162, 200, 79, 0.35);
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fdf2 0%, #ffffff 100%);
  box-shadow: 0 10px 22px rgba(29, 35, 22, 0.05);
}
.category-feedback__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  background: #a2c84f;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}
.category-feedback__body {
  min-width: 0;
}
.category-feedback__title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  color: #25301d;
}
.category-feedback__desc {
  margin: 0;
  color: #4b5c42;
  font-size: 12px;
  line-height: 1.9;
}
.category-feedback__slug {
  display: inline-block;
  margin: 0 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(162, 200, 79, 0.18);
  color: #2c4a11;
  font-weight: 700;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-lg);
  align-content: start;
}
.pcard {
  background: var(--card-bg);
  border: 1px solid var(--accent-weak);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 290px;
}
.pcard__link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
}
.pcard__media {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 6px 4px;
}
.pcard__img {
  width: 86px;
  height: 110px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f7f7f7;
}
.pcard__img.is-square {
  width: 110px;
  height: 110px;
  border-radius: 10px;
}
.pcard__body {
  text-align: center;
  padding: 0 6px;
  width: 100%;
  display: grid;
  justify-items: center;
}
.pcard__title {
  min-height: 42px;
  font-size: 13px;
  line-height: 1.7;
  color: #364152;
  font-weight: 700;
  text-align: center;
}
.pcard__meta {
  font-size: 11px;
  color: #98a2b3;
  margin-top: 6px;
  font-weight: 600;
  text-align: center;
}
.pcard__price {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  width: 100%;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(119, 178, 85, 0.14);
  text-align: center;
}
.pcard__priceMain {
  font-size: 18px;
  font-weight: 700;
  color: #101828;
  width: 100%;
  text-align: center;
}
.price-unavailable {
  color: #f57c00;
  font-weight: 700;
}
.pcard__actions {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 3;
}
.pcard__cart {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(119, 178, 85, 0.25);
}
.pcard__stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  background: #f2f3f5;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.stepper__btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: rgba(0, 0, 0, 0.55);
  padding: 2px 4px;
}
.stepper__val {
  min-width: 14px;
  text-align: center;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
}

/* Footer placeholders */
.foot {
  border-top: 1px solid var(--line-soft);
  padding: 26px 0 44px;
}
.foot__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.foot__col {
  height: 150px;
  border-radius: var(--radius);
  border: 1px dashed rgba(0, 0, 0, 0.12);
  background: #fff;
}

/* Responsive */
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters {
    width: 320px;
  }
  .foot__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .catbar {
    justify-content: flex-start;
    overflow-x: auto;
    gap: 6px;
  }
  .catbar__item {
    width: 84px;
    flex: 0 0 auto;
  }

  .main {
    flex-direction: column;
    min-height: calc(100vh - 280px);
  }
  .filters {
    width: 100%;
  }
  .filters__card {
    position: static;
  }

  .grid {
    grid-template-columns: 1fr;
  }
  .pcard__body,
  .pcard__price {
    text-align: center;
    justify-content: center;
  }
  .foot__grid {
    grid-template-columns: 1fr;
  }
}

/* --- Category page sync with store cards --- */
.metarow {
  padding: 28px 0 18px;
}
.main {
  padding: 22px 0 44px;
}

.pcard__img {
  width: 110px;
  height: 110px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.pcard__actions {
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  direction: ltr;
}
.pcard__cart {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: #a2c84f;
  box-shadow: none;
  display: grid;
  place-items: center;
}
.pcard__cart::before {
  content: "";
  width: 18px;
  height: 18px;
  background: url("/static/images/icons/cart.png") center/contain no-repeat;
  filter: brightness(0) invert(1);
}
.pcard__stepper {
  width: 100px;
  height: 28px;
  border-radius: 7px;
  background: #ececec;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}
.stepper__btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #8d8d8d;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.stepper__val {
  min-width: 14px;
  text-align: center;
  font-size: 13px;
  color: #4a4a4a;
  font-weight: 600;
}

.cat-pagination {
  margin: 38px auto 12px;
  max-width: 420px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: transparent;
  box-shadow: none;
  margin-top: auto;
}
.cat-pagination__item {
  width: 36px;
  height: 36px;
  min-width: 36px; /* prevents stretching */
  min-height: 36px;
  border-radius: 50%;
  padding: 0;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #2c2c2c;
  font-size: 15px;
  font-weight: 200;
  line-height: 1;
  background: transparent;
}
.cat-pagination__item.is-current {
  background: #a2c84f;
  color: #fff;
}
.cat-pagination__arrow {
  border: 0;
  background: transparent;
  color: #2c2c2c;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

/* proper control visuals for filter section */
.fitem__sum::after {
  content: "\25BE";
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
}
.fitem[open] .fitem__sum::after {
  content: "\25B4";
}
.toggle__pill {
  position: relative;
  cursor: pointer;
}
.toggle__pill::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.filter-link {
  display: block;
  padding: 6px 10px;
  color: rgba(0, 0, 0, 0.7);
  text-decoration: none;
  font-size: 12px;
}
.filter-link.is-current {
  color: var(--accent);
  font-weight: 600;
}
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.7);
}
.filter-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}
.filter-range input {
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 8px;
  font-size: 12px;
}
.filters__apply {
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}
.toggle input {
  display: none;
}
.toggle input:checked + .toggle__label + .toggle__pill {
  border-color: var(--accent);
  background: rgba(119, 178, 85, 0.2);
}
.toggle input:checked + .toggle__label + .toggle__pill::after {
  right: 18px;
}

/* Mobile category controls */
.mobile-shop-tools,
.mobile-sort-panel,
.mobile-category-backdrop,
.filters__close {
  display: none;
}

@media (max-width: 820px) {
  .container {
    padding-inline: 14px;
  }

  .metarow {
    display: none;
  }

  .mobile-shop-tools {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: center;
    gap: 8px;
    margin: 12px 0 16px;
    padding: 8px;
    border: 1px solid rgba(119, 178, 85, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(29, 35, 22, 0.06);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .mobile-shop-tools__btn {
    height: 38px;
    border: 1px solid rgba(119, 178, 85, 0.28);
    border-radius: 12px;
    background: #f8fbf0;
    color: #405135;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .mobile-shop-tools__count {
    padding-inline: 4px;
    color: rgba(0, 0, 0, 0.52);
    font-size: 11px;
    white-space: nowrap;
  }

  .main {
    display: block;
    padding-top: 0;
  }

  .filters {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    width: 100%;
    max-height: 82vh;
    padding: 10px 12px 14px;
    transform: translateY(110%);
    transition: transform 240ms ease;
  }

  body.category-panel-open-filters .filters {
    transform: translateY(0);
  }

  .filters__card {
    position: static;
    max-height: calc(82vh - 24px);
    overflow: auto;
    border-radius: 24px 24px 18px 18px;
    box-shadow: 0 -18px 44px rgba(18, 24, 18, 0.18);
  }

  .filters__head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
  }

  .filters__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f2f4ed;
    color: #27311f;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-category-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(11, 16, 10, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  body.category-panel-open-filters .mobile-category-backdrop,
  body.category-panel-open-sort .mobile-category-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-sort-panel {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: block;
    padding: 10px 12px 14px;
    transform: translateY(110%);
    transition: transform 240ms ease;
  }

  body.category-panel-open-sort .mobile-sort-panel {
    transform: translateY(0);
  }

  .mobile-sort-panel__card {
    border: 1px solid rgba(119, 178, 85, 0.22);
    border-radius: 24px 24px 18px 18px;
    background: #fff;
    box-shadow: 0 -18px 44px rgba(18, 24, 18, 0.18);
    padding: 16px;
  }

  .mobile-sort-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 14px;
  }

  .mobile-sort-panel__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #f2f4ed;
    color: #27311f;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-sort-panel__links {
    display: grid;
    gap: 8px;
    padding-top: 12px;
  }

  .mobile-sort-panel__link {
    min-height: 42px;
    padding: 11px 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    background: #fff;
    color: rgba(0, 0, 0, 0.68);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
  }

  .mobile-sort-panel__link.is-current {
    border-color: rgba(119, 178, 85, 0.35);
    background: rgba(119, 178, 85, 0.1);
    color: var(--accent);
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .pcard {
    min-height: 244px;
    padding: 12px 10px;
    border-radius: 14px;
    gap: 8px;
  }

  .pcard__media {
    padding: 8px 4px 2px;
  }

  .pcard__img {
    width: 92px;
    height: 92px;
  }

  .pcard__body {
    padding: 0;
    text-align: center;
    justify-items: center;
  }

  .pcard__title {
    min-height: 40px;
    font-size: 11.5px;
    line-height: 1.7;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .pcard__meta {
    margin-top: 4px;
    font-size: 10px;
    text-align: center;
  }

  .pcard__price {
    justify-content: center;
    padding-top: 9px;
    text-align: center;
  }

  .pcard__priceMain {
    font-size: 13px;
  }

  .price-unavailable {
    font-size: 12px;
  }

  body.category-panel-open-filters,
  body.category-panel-open-sort {
    overflow: hidden;
  }
}

@media (max-width: 380px) {
  .grid {
    gap: 10px;
  }

  .pcard {
    min-height: 232px;
    padding-inline: 8px;
  }

  .pcard__img {
    width: 82px;
    height: 82px;
  }
}
