/* ============================================================
   CraftyWorth v2 — Shop & Archive Page
   ============================================================ */

/* ── Shop Hero ── */
.cw-shop-hero {
  background: var(--off);
  padding: 32px 0;
  border-bottom: 1px solid var(--line-soft);
}
.cw-shop-hero__inner { max-width: var(--max); margin: 0 auto; padding: 0 var(--px); }
.cw-shop-hero__crumbs { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.cw-shop-hero__crumbs a { color: var(--p); font-weight: 600; }
.cw-shop-hero__crumbs a::after { content: ' /'; margin: 0 4px; color: var(--ink-3); }
.cw-shop-hero h1 { font-size: clamp(22px, 3vw, 36px); }
.cw-shop-hero p   { font-size: 14px; color: var(--ink-3); margin-top: 6px; }

/* ── Shop Layout ── */
.cw-shop { padding: 32px 0 80px; }
.cw-shop__inner { max-width: var(--max); margin: 0 auto; padding: 0 var(--px); }

/* ── Shop Bar ── */
.cw-shop__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.cw-shop__count { font-size: 13px; color: var(--ink-3); }
.cw-shop__right { display: flex; align-items: center; gap: 12px; }
.cw-sort {
  height: 40px;
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  padding: 0 36px 0 16px;
  font-family: var(--body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231A1208' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.cw-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
  transition: all var(--t);
}
.cw-filter-btn:hover { border-color: var(--p); color: var(--p); }

/* ── Filter Drawer ── */
.cw-filter-drawer {
  position: fixed;
  top: 0; left: 0;
  width: min(360px, 92vw); height: 100%;
  background: var(--white);
  z-index: 301;
  transform: translateX(-100%);
  transition: transform .26s ease;
  display: flex; flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,.12);
}
.cw-filter-drawer.open { transform: translateX(0); }
.cw-filter-drawer__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.cw-filter-drawer__top h3 { font-size: 20px; }
.cw-filter-drawer__body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.cw-filter-sec { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.cw-filter-sec h5 { margin-bottom: 12px; }
.cw-filter-sec label { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; font-size: 14px; }
.cw-filter-sec label input { accent-color: var(--p); width: 16px; height: 16px; }
.cw-filter-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--line-soft);
  display: flex; gap: 10px;
}
.cw-filter-foot button { flex: 1; }

/* ── Pagination ── */
.cw-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
}
.cw-pagination a,
.cw-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  border: 1.5px solid var(--line);
  transition: all var(--t);
}
.cw-pagination a:hover { border-color: var(--p); color: var(--p); }
.cw-pagination .current { background: var(--p); color: #fff; border-color: var(--p); }

/* WooCommerce pagination */
.woocommerce-pagination { margin-top: 48px; text-align: center; }
.woocommerce-pagination ul { display: flex; justify-content: center; gap: 6px; list-style: none; padding: 0; margin: 0; }
.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r);
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  border: 1.5px solid var(--line); transition: all var(--t);
}
.woocommerce-pagination ul li a:hover { border-color: var(--p); color: var(--p); }
.woocommerce-pagination ul li.active span,
.woocommerce-pagination ul li span.current { background: var(--p); color: #fff; border-color: var(--p); }

/* ── Empty state ── */
.cw-empty {
  text-align: center;
  padding: 64px 16px;
}
.cw-empty h3 { margin-bottom: var(--s4); }
.cw-empty p { color: var(--ink-3); margin-bottom: var(--s8); }

@media (max-width: 768px) {
  .cw-shop-hero { padding: 20px 0; }
  .cw-shop { padding: 20px 0 48px; }
  .cw-shop__bar {
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .cw-shop__bar::-webkit-scrollbar { display: none; }
  .cw-shop__count { flex-shrink: 0; }
  .cw-shop__right { flex-shrink: 0; gap: 8px; }
  .cw-sort, .cw-filter-btn {
    font-size: 12.5px;
    height: 38px;
    padding: 0 12px;
    min-height: 44px;
  }
  .cw-sort { padding: 0 30px 0 12px; }

  /* Product card mobile sizing */
  .woocommerce ul.products .product .woocommerce-loop-product__title,
  ul.products .product .woocommerce-loop-product__title {
    font-size: 13px !important;
    line-height: 1.35 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  .woocommerce ul.products .product .price,
  ul.products .product .price { font-size: 14px !important; }
  .cw-pagination, .woocommerce-pagination { margin-top: 32px; }
  .cw-pagination a, .cw-pagination span,
  .woocommerce-pagination ul li a,
  .woocommerce-pagination ul li span { width: 38px; height: 38px; font-size: 13px; }
}
