/* Fensgarden Category Archive Layout 1.0.3
   Scoped to body.fg-cat-archive only.
   Do NOT override Blocksy display/grid/flex on #main, .hero-section, or
   .ct-container — only widen via theme/sidebar CSS variables and style
   Department / masthead / product columns. */

body.fg-cat-archive {
  --fg-ink: #192c27;
  --fg-muted: #434f58;
  --fg-line: rgba(25, 44, 39, 0.12);
  --fg-wash: #f4f6f5;
  --fg-green: #5a8139;
  --fg-dept-width: 15rem;
  --fg-archive-header-gap: 12.5rem;
}

/* Clear sticky header; keep hero box for spacing (never display:contents). */
body.fg-cat-archive .hero-section {
  min-height: 0 !important;
  background: none !important;
  margin: 0 !important;
  padding: var(--fg-archive-header-gap) 0 0.35rem !important;
}
body.fg-cat-archive .hero-section > figure {
  display: none !important;
}
body.fg-cat-archive .hero-section .page-title,
body.fg-cat-archive .hero-section .page-description {
  display: none !important;
}
body.fg-cat-archive .entry-header {
  padding-top: 0 !important;
  padding-bottom: 0.35rem !important;
  margin: 0 auto !important;
}
body.fg-cat-archive .ct-breadcrumbs {
  margin: 0;
  font-size: 0.9rem;
  color: var(--fg-muted);
}
body.fg-cat-archive .ct-breadcrumbs a {
  color: var(--fg-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (min-width: 1000px) {
  body.fg-cat-archive {
    --theme-normal-container-max-width: 1600px;
    --theme-narrow-container-max-width: 1600px;
    --theme-container-edge-spacing: 1.5rem;
    --fg-archive-header-gap: 13.5rem;
    /* Drive Blocksy sidebar.min.css — do not redeclare display/grid. */
    --sidebar-width: var(--fg-dept-width);
    --sidebar-gap: 1.5rem;
    --sidebar-order: -1;
  }

  body.fg-cat-archive .ct-container[data-sidebar="left"] {
    max-width: 1600px;
    width: calc(100% - 3rem);
    margin-inline: auto;
    padding-top: 0.35rem;
    padding-bottom: 2.5rem;
  }

  body.fg-cat-archive .ct-container[data-sidebar="left"] > #sidebar,
  body.fg-cat-archive .ct-container[data-sidebar="left"] > aside#sidebar {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.fg-cat-archive .ct-container[data-sidebar="left"] > section {
    min-width: 0;
  }

  body.fg-cat-archive .entry-header.ct-container-narrow {
    max-width: 1600px;
    width: calc(100% - 3rem);
  }

  /* Never show the mobile-cloned Department list in the main column on desktop. */
  body.fg-cat-archive .fg-dept-slot--main {
    display: none !important;
  }
}

/* Department directory */
.fg-dept__title {
  margin: 0 0 0.7rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--fg-ink);
}
.fg-dept__toggle {
  display: none;
}
.fg-dept__list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}
.fg-dept__item {
  margin: 0;
}
.fg-dept__link {
  display: block;
  padding: 0.38rem 0.7rem;
  border-radius: 0.4rem;
  color: var(--fg-ink);
  text-decoration: none;
  line-height: 1.35;
  font-size: 0.95rem;
}
a.fg-dept__link:hover {
  background: var(--fg-wash);
}
.fg-dept__item.is-current .fg-dept__link {
  background: var(--fg-wash);
  font-weight: 700;
}
.fg-dept__item--depth-1 .fg-dept__link { padding-left: 1.35rem; }
.fg-dept__item--depth-2 .fg-dept__link { padding-left: 2.1rem; }
.fg-dept__item--depth-3 .fg-dept__link { padding-left: 2.85rem; }

/* Masthead: category title + subcategory cards */
.fg-cat-masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.85rem 1.25rem;
  margin: 0 0 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--fg-line);
}
.fg-cat-masthead__title {
  margin: 0;
  flex: 0 0 auto;
  max-width: 12.5rem;
  font-size: clamp(1.35rem, 1.7vw, 1.7rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--fg-ink);
}
.fg-cat-cards {
  list-style: none;
  display: flex;
  flex: 1 1 16rem;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.fg-cat-card {
  flex: 0 0 auto;
  width: 8.6rem;
  margin: 0;
}
.fg-cat-card__link {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--fg-ink);
  text-decoration: none;
}
.fg-cat-card__media {
  display: block;
  width: 8.6rem;
  height: 6.5rem;
  overflow: hidden;
  border-radius: 0.2rem;
  background: #f0f2f1;
}
.fg-cat-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fg-cat-card__fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: #e6ebe9;
}
.fg-cat-card__name {
  display: block;
  font-size: 0.82rem;
  line-height: 1.3;
  text-align: center;
  color: var(--fg-muted);
}
.fg-cat-card__link:hover .fg-cat-card__name {
  color: var(--fg-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.fg-cat-archive .woo-listing-top {
  margin-top: 0.15rem;
  margin-bottom: 0.9rem;
}

@media (min-width: 1000px) {
  body.fg-cat-archive ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem 1rem;
  }
  body.fg-cat-archive ul.products > li.product {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }
}
@media (min-width: 1280px) {
  body.fg-cat-archive ul.products {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

body.fg-cat-archive ul.products > li.product-category {
  display: none !important;
}

/* Mobile / tablet */
@media (max-width: 999.98px) {
  body.fg-cat-archive {
    --fg-archive-header-gap: 7.25rem;
  }
  body.fg-cat-archive .hero-section {
    padding-top: var(--fg-archive-header-gap) !important;
    padding-bottom: 0 !important;
  }
  body.fg-cat-archive .ct-breadcrumbs {
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
  }

  .fg-dept__title { display: none; }
  .fg-dept__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 0 0.5rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--fg-line);
    border-radius: 0.4rem;
    background: #fff;
    color: var(--fg-ink);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
  }
  .fg-dept__toggle::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid var(--fg-ink);
    border-bottom: 2px solid var(--fg-ink);
    transform: rotate(45deg);
    margin-left: 0.5rem;
  }
  .fg-dept.is-open .fg-dept__toggle::after {
    transform: rotate(-135deg);
    margin-top: 0.3rem;
  }
  .fg-dept__list {
    display: none;
    margin-bottom: 0.85rem;
    padding: 0.2rem 0 0.4rem;
    border-bottom: 1px solid var(--fg-line);
  }
  .fg-dept.is-open .fg-dept__list { display: block; }

  body.fg-cat-archive .fg-dept-slot--sidebar { display: none; }
  body.fg-cat-archive .fg-dept-slot--main {
    display: block;
    margin: 0 0 0.75rem;
  }

  .fg-cat-masthead {
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
  }
  .fg-cat-masthead__title {
    max-width: none;
    font-size: 1.35rem;
  }
  .fg-cat-cards {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2rem;
  }
  .fg-cat-card { width: 7.4rem; }
  .fg-cat-card__media {
    width: 7.4rem;
    height: 5.6rem;
  }

  body.fg-cat-archive ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 0.7rem;
  }
  body.fg-cat-archive ul.products > li.product {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }
}
