.woocommerce-page .ast-container,
.woocommerce .ast-container {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  gap: 2.5rem !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 0 1.5rem !important;
}

.kc-shop-sidebar {
  width: 260px;
  min-width: 240px;
  flex-shrink: 0;
  order: 1;
  font-family: inherit;
  color: #1a1a1a;
  margin-top: 60px;
  /* no border — sections use bottom rules instead */
}

#fkcart-checkout-button,
.fkcart-primary-button,
.fkcart-shop-button,
.fkcart-modal-close {
  background-color: #002d70 !important;
}

/* "Shopping Options" heading */
.kc-sidebar__heading {
  font-size: 1rem; /* ~16 px */
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: #1a1a1a;
  margin: 0 0 0.75rem 0;
  padding: 0;
  line-height: 1.3;
}

/* strip WC/theme default form margins */
#kc-sidebar-filter-form {
  margin: 0;
  padding: 0;
}

.kc-filter-section {
  border-top: 1px solid #d8d8d8;
}

/* last child also gets a bottom rule */
.kc-filter-section:last-child {
  border-bottom: 1px solid #d8d8d8;
}

/* Toggle button — the full-width clickable row */
.kc-filter-section__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0.85rem 0;
  cursor: pointer;
  text-align: left;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-shadow: none;
}

button.kc-filter-section__toggle:hover,
button.kc-filter-section__toggle:focus {
  background-color: transparent !important;
  color: #1a1a1a;
}

/* Chevron icon — pure CSS, no icon font needed */
.kc-filter-section__icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  position: relative;
  margin-left: 8px;
}

.kc-filter-section__icon::before,
.kc-filter-section__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease;
}

.kc-filter-section__icon::before {
  left: 1px;
  transform: translateY(-50%) rotate(45deg);
}

.kc-filter-section__icon::after {
  right: 1px;
  transform: translateY(-50%) rotate(-45deg);
}

/* Chevron points UP when section is open */
.kc-filter-section.is-open .kc-filter-section__icon::before {
  transform: translateY(-50%) rotate(-45deg);
}
.kc-filter-section.is-open .kc-filter-section__icon::after {
  transform: translateY(-50%) rotate(45deg);
}

.kc-filter-section__body {
  display: none; /* collapsed by default — jQuery slideDown/Up owns display */
  padding: 0 0 1rem 0;
}

.kc-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kc-filter-list__item {
  margin: 0;
  padding: 0;
}

/* Label row */
.kc-filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.875rem; /* 14 px */
  font-weight: 400;
  color: #1a1a1a;
  cursor: pointer;
  line-height: 1.4;
  user-select: none;
}

.kc-filter-label:hover {
  color: #000;
}

/* Native checkbox — keep it simple, override only what's needed */
.kc-filter-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: #1a1a1a; /* checked colour = near-black to match theme */
  cursor: pointer;
  margin: 0;
}

/* Count badge */
.kc-filter-label__count {
  color: #888;
  font-size: 0.8125rem;
  margin-left: 2px;
}

/* Parent label is slightly bolder */
.kc-filter-label strong {
  font-weight: 600;
  font-size: 0.875rem;
}

/* Sub-list (child terms) — indented */
.kc-filter-list--sub {
  padding-left: 24px;
  margin-top: 2px;
}

.kc-filter-clear {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8125rem;
  color: #555;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.kc-filter-clear:hover {
  color: #000;
}

.kc-sidebar__apply-btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
}

.kc-sidebar__apply-btn:hover {
  background: #333;
}

#primary.content-area {
  flex: 1 !important;
  min-width: 0 !important;
  order: 2 !important;
  padding: 0 !important;
}

#primary.content-area main {
  float: none !important;
  width: 100% !important;
}

/* Product grid — 4 columns */
ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 1.5rem !important;
  margin: 0 !important;
  padding: 0 !important;
}

ul.products li.product {
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  float: none !important;
}

/* Notices */
.woocommerce-info,
.woocommerce-message,
.woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-info {
  grid-column: 1 / -1 !important;
  text-align: center !important;
  width: 100% !important;
}

.woocommerce-info {
  background-color: #f8f8f8;
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  border-radius: 4px;
  font-size: 1rem;
  color: #333;
}

.woocommerce-notices-wrapper {
  width: 100%;
}

.woocommerce-notices-wrapper .woocommerce-info {
  width: 100%;
  text-align: center;
}

.woocommerce-result-count {
  margin: 0 0 1rem 0 !important;
}

/* ── Shop toolbar: search (left) + sort (right) on one line ── */
.kc-shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem 0;
  flex-wrap: wrap;
}

.kc-shop-toolbar .woocommerce-ordering {
  margin: 0 !important;
  flex-shrink: 0;
}

.kc-shop-search {
  flex: 1;
  min-width: 180px;
  max-width: 360px;
  margin: 0;
}

.kc-shop-search__inner {
  display: flex;
  align-items: center;
  border: 1px solid #d0d8e4;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s;
}

.kc-shop-search__inner:focus-within {
  border-color: #005670;
}

.kc-shop-search__icon {
  padding: 0 10px;
  color: #5a6474;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.kc-shop-search__input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 7px 4px !important;
  flex: 1;
  min-width: 0;
  font-size: 0.875rem !important;
  color: #1a1e26;
}

.kc-shop-search__btn {
  background: #002d70;
  color: #fff;
  border: none;
  padding: 0 16px;
  height: 100%;
  min-height: 36px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.kc-shop-search__btn:hover {
  background: #002d70;
}

@media (max-width: 600px) {
  .kc-shop-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .kc-shop-search {
    max-width: 100%;
  }
}

@media (max-width: 1100px) {
  ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .woocommerce-page .ast-container,
  .woocommerce .ast-container {
    flex-direction: column !important;
    gap: 1.5rem !important;
  }

  .kc-shop-sidebar {
    width: 100%;
    min-width: unset;
  }

  #primary.content-area {
    width: 100% !important;
  }

  ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  ul.products {
    grid-template-columns: 1fr !important;
  }
}

/* Prescription CTA
   Sits below the filter sections. Styled as a card rather than another filter
   row on purpose: it navigates away instead of refining the grid, so it has to
   read as a different kind of thing. Kept to a low-saturation brand tint so it
   is findable without competing with the product grid — the filters are still
   the primary job of this column. Separated by the same 1px rule the filter
   sections use, so it still reads as part of the sidebar. */
.kc-rx-cta {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #d8d8d8;
}

/* Whole card is the target: one tab stop, and a hit area well past the 44px
   minimum rather than a small "click here" text link. */
.kc-rx-cta__link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #e6e8ec !important;
  border-left: 5px solid #f97316 !important;
  border-radius: 10px;
  text-align: left;
  text-decoration: none;
  color: #1a1a1a;
  transition: background-color 0.18s ease;
}

/* Warm tint on hover rather than a border change: the orange stripe is a
   constant marker, so leaving it untouched keeps it reading as identity rather
   than state. #fff7ed is the palest step of the same orange. */
.kc-rx-cta__link:hover,
.kc-rx-cta__link:focus-visible {
  background-color: #fff7ed;
}

/* Accent blue ring — sits clear of the orange stripe and the white card. */
.kc-rx-cta__link:focus-visible {
  outline: 2px solid #00aceb;
  outline-offset: 2px;
}

.kc-rx-cta__icon,
.kc-rx-cta__arrow {
  flex: 0 0 auto;
  color: #002d70;
}

.kc-rx-cta__icon {
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.kc-rx-cta__arrow {
  width: 15px;
  height: 15px;
  margin-top: 3px;
  transition: transform 0.18s ease;
}

.kc-rx-cta__icon svg,
.kc-rx-cta__arrow svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Nudge signals "you'll leave the grid" without needing a label. */
.kc-rx-cta__link:hover .kc-rx-cta__arrow,
.kc-rx-cta__link:focus-visible .kc-rx-cta__arrow {
  transform: translateX(2px);
}

.kc-rx-cta__text {
  min-width: 0;
}

/* Question first: it's the fastest way for a shopper to self-identify.
   14px/700 matches the filter labels, so the card sits in the existing scale. */
.kc-rx-cta__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  color: #002d70;
}

/* 13px/#555 is the sidebar's existing muted style. */
.kc-rx-cta__desc {
  display: block;
  margin-top: 3px;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
  color: #555;
}

@media (prefers-reduced-motion: reduce) {
  .kc-rx-cta__link,
  .kc-rx-cta__arrow {
    transition: none;
  }

  .kc-rx-cta__link:hover .kc-rx-cta__arrow,
  .kc-rx-cta__link:focus-visible .kc-rx-cta__arrow {
    transform: none;
  }
}
