/* ==========================================================================
   Fahavi Computers - shop/catalog page
   ========================================================================== */

/* container: wide, centered */
body.post-type-archive-product .ct-container[data-vertical-spacing],
body.tax-product_cat .ct-container[data-vertical-spacing],
body.tax-product_brand .ct-container[data-vertical-spacing],
body.tax-product_tag .ct-container[data-vertical-spacing] {
  max-width: 1700px; padding-top: 10px;
}

/* ------------------------------------------------------------- intro */
.fh-shopintro {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 6px 0 14px;
}
.fh-crumbs { font-size: 12.5px; color: var(--fh-muted); display: flex; gap: 7px; margin-bottom: 6px; }
.fh-crumbs a { color: var(--fh-muted); text-decoration: none; }
.fh-crumbs a:hover { color: var(--fh-navy); }
.fh-crumbs [aria-current] { color: var(--fh-ink); font-weight: 600; }
.fh-shopintro h1 { font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 800; color: var(--fh-ink); margin: 0 0 6px; letter-spacing: -.015em; }
.fh-shopintro__copy p { font-size: 13.5px; color: var(--fh-muted); margin: 0; }
.fh-shopintro__visual { flex: none; }
.fh-shopintro__visual img { height: 110px; width: auto; display: block; }
@media (max-width: 900px) { .fh-shopintro__visual { display: none; } }

/* ------------------------------------------------------ category pills */
.fh-catpills {
  display: flex; gap: 8px; padding: 2px 0 16px;
  overflow-x: auto; scrollbar-width: none;
}
.fh-catpills::-webkit-scrollbar { display: none; }
.fh-catpill {
  flex: none; padding: 9px 18px; border-radius: 22px; text-decoration: none;
  border: 1px solid var(--fh-border); background: #fff; color: var(--fh-ink);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: border-color .14s, color .14s, background .14s;
}
.fh-catpill:hover { border-color: var(--fh-navy); color: var(--fh-navy); }
.fh-catpill.is-active { background: var(--fh-navy); border-color: var(--fh-navy); color: #fff; }

/* ------------------------------------------------------------- layout */
.fh-shop { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(16px, 1.8vw, 28px); align-items: start; }
@media (max-width: 1024px) { .fh-shop { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ sidebar */
.fh-shop__side {
  background: #fff; border: 1px solid var(--fh-border); border-radius: 14px;
  padding: 16px; position: sticky; top: calc(var(--fh-header-offset, 114px) + 12px);
  max-height: calc(100vh - var(--fh-header-offset, 114px) - 24px);
  overflow-y: auto; overscroll-behavior: contain;
}
.fh-shop__sidehead { display: none; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fh-shop__sidehead b { font-size: 15px; font-weight: 800; color: var(--fh-ink); }
.fh-shop__sideclose { width: 32px; height: 32px; border: 1px solid var(--fh-border); border-radius: 50%; background: #F6F7FA; font-size: 17px; cursor: pointer; color: var(--fh-ink); }

.fh-fgroup { padding: 11px 0; border-top: 1px solid #EFF1F6; }
.fh-fgroup:first-of-type { border-top: 0; padding-top: 0; }
/* collapsible group heading */
.fh-fgroup__title {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  font-size: 13.5px; font-weight: 800; color: var(--fh-ink); margin-bottom: 10px;
  background: none; border: 0; padding: 4px 2px; cursor: pointer; font-family: inherit;
  border-radius: 7px; text-align: left;
}
.fh-fgroup__title:hover { color: var(--fh-navy); }
.fh-fgroup__title:focus-visible { outline: 2px solid var(--fh-navy); outline-offset: 2px; }
.fh-fgroup__title::after {
  content: ""; width: 8px; height: 8px; flex: none; margin-left: 10px;
  border-right: 2px solid #9AA3BC; border-bottom: 2px solid #9AA3BC;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease;
}
.fh-fgroup.is-collapsed .fh-fgroup__title { margin-bottom: 0; }
.fh-fgroup.is-collapsed .fh-fgroup__title::after { transform: rotate(-45deg) translateY(1px); }
.fh-fgroup.is-collapsed .fh-fgroup__body { display: none; }
@media (prefers-reduced-motion: reduce) { .fh-fgroup__title::after { transition: none; } }

.fh-fcats { list-style: none; margin: 0; padding: 0; max-height: 262px; overflow-y: auto; scrollbar-width: thin; }
.fh-fcats a {
  display: block; padding: 6px 8px; border-radius: 7px; font-size: 12.5px;
  color: var(--fh-muted); text-decoration: none; line-height: 1.35;
}
.fh-fcats a:hover { color: var(--fh-navy); background: #F3F6FE; }
.fh-fcats a.is-active { color: var(--fh-navy); background: #EAF0FE; font-weight: 700; }

.fh-fprice { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.fh-fprice input {
  width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--fh-border);
  border-radius: 8px; font-size: 12.5px; font-family: inherit;
}
.fh-fprice span { color: var(--fh-muted); flex: none; }
.fh-fquick { display: flex; gap: 6px; flex-wrap: wrap; }
.fh-fquick a {
  padding: 5px 11px; border: 1px solid var(--fh-border); border-radius: 14px;
  font-size: 11.5px; font-weight: 700; color: var(--fh-muted); text-decoration: none;
}
.fh-fquick a:hover { border-color: var(--fh-navy); color: var(--fh-navy); }

.fh-fchecks { display: flex; flex-direction: column; gap: 2px; }
.fh-fcheck { display: flex; align-items: center; gap: 9px; padding: 5px 4px; font-size: 12.5px; color: var(--fh-ink); cursor: pointer; border-radius: 6px; }
.fh-fcheck:hover { background: #F6F8FD; }
.fh-fcheck input { width: 15px; height: 15px; accent-color: var(--fh-navy); flex: none; }
.fh-fcheck span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-fcheck--more { display: none; }
.fh-fchecks.is-expanded .fh-fcheck--more { display: flex; }
.fh-fmore { border: 0; background: none; color: var(--fh-navy); font-size: 12px; font-weight: 700; cursor: pointer; padding: 6px 4px 0; text-align: left; font-family: inherit; }

.fh-fapply { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid #EFF1F6; }
.fh-fapply__btn { min-height: 42px; border: 0; border-radius: 10px; background: var(--fh-navy); color: #fff; font-size: 13.5px; font-weight: 800; cursor: pointer; font-family: inherit; }
.fh-fapply__btn:hover { filter: brightness(1.1); }
.fh-fapply__clear { text-align: center; font-size: 12.5px; font-weight: 700; color: var(--fh-muted); text-decoration: none; }
.fh-fapply__clear:hover { color: var(--fh-red); }

/* ------------------------------------------------------------ toolbar */
.fh-shoptool {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: #fff; border: 1px solid var(--fh-border); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.fh-shoptool__left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.fh-shoptool__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.fh-shoptool__label { font-size: 12.5px; font-weight: 700; color: var(--fh-muted); white-space: nowrap; }
.fh-fchip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  background: #EAF0FE; color: var(--fh-navy); border-radius: 16px;
  font-size: 12px; font-weight: 700; text-decoration: none;
}
.fh-fchip b { font-weight: 800; }
.fh-fchip:hover { background: var(--fh-navy); color: #fff; }
.fh-fclear { font-size: 12.5px; font-weight: 700; color: var(--fh-muted); text-decoration: none; }
.fh-fclear:hover { color: var(--fh-red); }

.woocommerce-ordering select, .fh-shoptool select {
  padding: 9px 30px 9px 12px; border: 1px solid var(--fh-border); border-radius: 9px;
  font-size: 13px; font-family: inherit; color: var(--fh-ink); background: #fff; cursor: pointer;
}
.woocommerce-ordering { margin: 0; }

.fh-filterbtn {
  display: none; align-items: center; gap: 7px; padding: 9px 18px;
  border: 1px solid var(--fh-border); border-radius: 9px; background: #fff;
  font-size: 13px; font-weight: 700; color: var(--fh-ink); cursor: pointer; font-family: inherit;
}
.fh-filterbtn b {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  border-radius: 9px; background: var(--fh-navy); color: #fff; font-size: 11px;
}

/* -------------------------------------------------------- product grid */
/* Woo renders ul.products; our cards live inside the li wrappers. */
.fh-shop__main ul.products {
  display: grid !important; gap: clamp(12px, 1.3vw, 20px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0; padding: 0; list-style: none;
}
.fh-shop__main ul.products::before, .fh-shop__main ul.products::after { display: none; }
.fh-shop__main ul.products li.product { width: auto !important; margin: 0 !important; padding: 0 !important; float: none !important; display: flex; }
.fh-shop__main ul.products li.product .fh-card { width: 100%; }
@media (max-width: 1359px) { .fh-shop__main ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1079px) { .fh-shop__main ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px)  { .fh-shop__main ul.products { grid-template-columns: 1fr; } }

/* --------------------------------------------------------- pagination */
.ct-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; }
.ct-pagination .page-numbers {
  min-width: 38px; height: 38px; display: inline-grid; place-items: center;
  padding: 0 10px; border: 1px solid var(--fh-border); border-radius: 10px;
  background: #fff; color: var(--fh-ink); font-size: 13.5px; font-weight: 700; text-decoration: none;
}
.ct-pagination .page-numbers:hover { border-color: var(--fh-navy); color: var(--fh-navy); }
.ct-pagination .page-numbers.current { background: var(--fh-navy); border-color: var(--fh-navy); color: #fff; }
.ct-pagination .page-numbers.dots { border: 0; background: none; }

/* --------------------------------------------------------- no results */
.fh-noresults { text-align: center; padding: 60px 20px; }
.fh-noresults b { display: block; font-size: 19px; font-weight: 800; color: var(--fh-ink); margin-bottom: 8px; }
.fh-noresults p { font-size: 13.5px; color: var(--fh-muted); margin: 0 0 18px; }
.fh-noresults a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 24px; border-radius: 11px; background: var(--fh-navy); color: #fff; font-size: 13.5px; font-weight: 800; text-decoration: none; }

/* ------------------------------------------------------ mobile drawer */
.fh-shop__backdrop {
  position: fixed; inset: 0; z-index: 990; background: rgba(4,9,26,.55);
  backdrop-filter: blur(3px); opacity: 0; transition: opacity .28s ease;
}
.fh-shop__backdrop.is-open { opacity: 1; }
@media (max-width: 1024px) {
  .fh-filterbtn { display: inline-flex; }
  .fh-shop__side {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto; z-index: 1000;
    width: min(330px, 88vw); max-height: none; border-radius: 16px 0 0 16px;
    transform: translateX(105%); transition: transform .3s cubic-bezier(.32,.72,.28,1);
  }
  .fh-shop__side.is-open { transform: none; }
  .fh-shop__sidehead { display: flex; }
}
@media (min-width: 1025px) { .fh-shop__backdrop { display: none; } }

@media (max-width: 700px) {
  .fh-shoptool { padding: 9px 11px; }
  .fh-shoptool__right { margin-left: 0; width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .fh-shop__side, .fh-shop__backdrop { transition: none; }
}
