/* Bake Decor — shop & category archive layout */
:root {
  --bd-green: #7cc90d;
  --bd-green-dark: #5fa105;
  --bd-teal: #283937;
  --bd-ink: #2d3544;
  --bd-text: #5f6a68;
  --bd-muted: #8d9693;
  --bd-line: #e6e8e3;
  --bd-panel: #ffffff;
  --bd-ground: #f7f8f5;
  --bd-butter: #f2c94c;
}

.bd-shop-layout .woocommerce-breadcrumb { font-size: 13px; color: var(--bd-muted); margin: 0 0 14px; }
.bd-shop-layout .woocommerce-breadcrumb a { color: var(--bd-text); text-decoration: none; }
.bd-shop-layout .woocommerce-breadcrumb a:hover { color: var(--bd-green-dark); }

.bd-shop {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 40px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--bd-text);
}

/* ---------- Sidebar ---------- */
.bd-shop__side { align-self: start; position: sticky; top: 96px; display: grid; gap: 20px; }
.bd-side { background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 10px; overflow: hidden; }
.bd-side__title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; margin: 0;
  font-family: "Playfair Display", Georgia, serif; font-size: 20px; font-weight: 700; color: var(--bd-ink);
  list-style: none; cursor: pointer; border-bottom: 1px solid var(--bd-line);
}
.bd-side__title::-webkit-details-marker { display: none; }
.bd-side__chev { color: var(--bd-muted); transition: transform .2s ease; }
.bd-side[open] .bd-side__chev { transform: rotate(180deg); }
.bd-side__body { max-height: min(70vh, 720px); overflow-y: auto; scrollbar-width: thin; }

.bd-cats { list-style: none; margin: 0; padding: 8px 0; }
.bd-cats__item a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 18px 9px 16px; border-left: 3px solid transparent;
  color: var(--bd-ink); text-decoration: none; font-size: 14px; line-height: 1.35;
  transition: background .15s ease, border-color .15s ease;
}
.bd-cats__item a:hover { background: var(--bd-ground); border-left-color: var(--bd-butter); }
.bd-cats__item.is-active a { background: #f1f9e6; border-left-color: var(--bd-green); font-weight: 600; color: var(--bd-teal); }
.bd-cats__count {
  flex: none; min-width: 28px; text-align: center;
  font-size: 11.5px; font-weight: 600; color: var(--bd-muted);
  background: var(--bd-ground); border-radius: 999px; padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}
.bd-cats__item.is-active .bd-cats__count { background: var(--bd-green); color: #fff; }
.bd-cats__item:first-child a { font-weight: 600; }
.bd-cats__item:first-child { border-bottom: 1px solid var(--bd-line); margin-bottom: 4px; padding-bottom: 4px; }

.bd-side__help {
  background: var(--bd-teal); color: #dfe7e3; border-radius: 10px; padding: 18px 20px; font-size: 13.5px; line-height: 1.55;
}
.bd-side__help p { margin: 0 0 8px; }
.bd-side__help-title { font-family: "Playfair Display", Georgia, serif; font-size: 18px; font-weight: 700; color: #fff; }
.bd-side__help-link { display: inline-block; margin-top: 4px; color: var(--bd-butter); font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.bd-side__help-link:hover { text-decoration: underline; }

/* ---------- Main column ---------- */
.bd-shop__main { min-width: 0; }
.bd-shop-layout .site-main { margin: 0; padding: 0; max-width: none; }

.bd-shop__head { margin-bottom: 20px; }
.bd-shop__title {
  font-family: "Playfair Display", Georgia, serif; font-size: clamp(28px, 3.2vw, 38px); font-weight: 700;
  color: var(--bd-ink); margin: 0 0 8px; line-height: 1.15; text-wrap: balance;
}
.bd-shop__head .term-description, .bd-shop__head .page-description { max-width: 70ch; font-size: 15px; color: var(--bd-text); }
.bd-shop__head .term-description p, .bd-shop__head .page-description p { margin: 0 0 .6em; }

.bd-shop__toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px;
  padding: 12px 16px; margin-bottom: 22px;
  background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 10px;
}
.bd-shop__toolbar .woocommerce-result-count { margin: 0; font-size: 14px; color: var(--bd-text); float: none; }
.bd-shop__toolbar .woocommerce-ordering { margin: 0; float: none; }
.bd-shop__toolbar .woocommerce-ordering select {
  font: inherit; font-size: 14px; color: var(--bd-ink); background: var(--bd-ground);
  border: 1px solid var(--bd-line); border-radius: 8px; padding: 8px 34px 8px 12px; cursor: pointer;
}
.bd-shop__toolbar .woocommerce-notices-wrapper:empty { display: none; }

/* ---------- Product grid & cards ---------- */
.bd-shop-layout ul.products {
  display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0 0 36px; padding: 0;
}
.bd-shop-layout ul.products::before, .bd-shop-layout ul.products::after,
.bd-shop-layout .woocommerce ul.products::before, .bd-shop-layout .woocommerce ul.products::after,
.woocommerce.bd-shop-layout ul.products::before, .woocommerce.bd-shop-layout ul.products::after { content: none !important; display: none !important; }

.bd-shop-layout ul.products li.product {
  position: relative; width: auto !important; margin: 0 !important; float: none !important; padding: 0 !important;
  background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; text-align: left;
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
.bd-shop-layout ul.products li.product:hover,
.bd-shop-layout ul.products li.product:focus-within {
  box-shadow: 0 14px 34px rgba(40, 57, 55, .12); transform: translateY(-3px); border-color: transparent;
}

/* media */
.bd-card__media {
  position: relative; display: block; aspect-ratio: 1 / 1; background: #f4f5f1; overflow: hidden;
}
.bd-card__media img {
  display: block; width: 100% !important; height: 100% !important; object-fit: contain; padding: 18px; margin: 0 !important;
  transition: transform .35s ease;
}
.bd-shop-layout ul.products li.product:hover .bd-card__media img { transform: scale(1.05); }
.bd-card__badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--bd-butter); color: var(--bd-ink);
  font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1; padding: 6px 9px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.bd-card__soldout {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  background: rgba(45, 53, 68, .85); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 9px; border-radius: 999px;
}
.bd-shop-layout ul.products li.product .onsale { display: none; }

/* body */
.bd-card__body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 4px; flex: 1; }
.bd-card__cat {
  align-self: flex-start; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--bd-green-dark); text-decoration: none;
}
.bd-card__cat:hover { text-decoration: underline; }
.bd-shop-layout ul.products li.product .bd-card__title {
  margin: 0 !important; padding: 0 !important; font-size: 15px; line-height: 1.4; font-weight: 600; min-height: 2.8em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bd-card__title a { color: var(--bd-ink); text-decoration: none; }
.bd-card__title a:hover { color: var(--bd-teal); }
.bd-card__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: auto; padding-top: 6px; }
.bd-card__now, .bd-card__now .amount, .bd-card__now ins, .bd-card__now bdi { font-size: 18px; font-weight: 700; color: var(--bd-teal); text-decoration: none; }
.bd-card__now del, .bd-card__now del .amount { font-size: 13px; font-weight: 400; color: var(--bd-muted); }
.bd-card__was, .bd-card__was .amount { font-size: 13px; color: var(--bd-muted); text-decoration: line-through; }
.bd-card__save { font-size: 12px; font-weight: 600; color: var(--bd-green-dark); background: #eef8df; padding: 2px 7px; border-radius: 6px; }

/* footer */
.bd-card__foot { padding: 10px 16px 16px; }
.bd-shop-layout ul.products li.product .bd-card__foot .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 0;
  background: var(--bd-teal); color: #fff; border: 0; border-radius: 10px; padding: 12px 14px;
  font-size: 13.5px; font-weight: 600; line-height: 1; letter-spacing: .01em; cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.bd-shop-layout ul.products li.product .bd-card__foot .button::before {
  content: ""; width: 16px; height: 16px; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.bd-shop-layout ul.products li.product .bd-card__foot .button:hover { background: var(--bd-green-dark); color: #fff; }
.bd-shop-layout ul.products li.product .bd-card__foot .button:active { transform: scale(.98); }
.bd-shop-layout ul.products li.product .bd-card__foot .button.loading { opacity: .7; }
.bd-shop-layout ul.products li.product .bd-card__foot .button.added::after { content: none; }
.bd-shop-layout ul.products li.product .bd-card__foot .added_to_cart {
  display: block; margin-top: 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--bd-green-dark); text-decoration: none;
}
/* Pagination */
.bd-shop-layout .woocommerce-pagination { text-align: center; }
.bd-shop-layout .woocommerce-pagination ul.page-numbers {
  display: inline-flex; gap: 6px; border: 0; margin: 8px 0 0; padding: 0; list-style: none;
}
.bd-shop-layout .woocommerce-pagination ul.page-numbers li { border: 0; }
.bd-shop-layout .woocommerce-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--bd-line); border-radius: 8px; background: var(--bd-panel); color: var(--bd-ink);
  font-size: 14px; font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums;
}
.bd-shop-layout .woocommerce-pagination a.page-numbers:hover { border-color: var(--bd-green); color: var(--bd-green-dark); }
.bd-shop-layout .woocommerce-pagination .page-numbers.current { background: var(--bd-teal); border-color: var(--bd-teal); color: #fff; }
.bd-shop-layout .woocommerce-pagination .page-numbers.dots { border: 0; background: transparent; color: var(--bd-muted); }

/* No products */
.bd-shop-layout .woocommerce-no-products-found { padding: 40px; text-align: center; background: var(--bd-panel); border: 1px dashed var(--bd-line); border-radius: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .bd-shop { grid-template-columns: 232px minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 900px) {
  .bd-shop { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px 16px 48px; }
  .bd-shop__side { position: static; }
  .bd-side { border-radius: 10px; }
  .bd-side:not([open]) .bd-side__title { border-bottom: 0; }
  .bd-side__body { max-height: 320px; }
  .bd-side__help { display: none; }
  .bd-side__title { font-size: 17px; padding: 13px 16px; }
  .bd-side__title span::after { content: ' \00b7 tap to browse'; font-family: 'Open Sans', sans-serif; font-size: 12px; font-weight: 400; color: var(--bd-muted); }
  .bd-side[open] .bd-side__title span::after { content: ''; }
  .bd-shop-layout ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
}
@media (max-width: 480px) {
  .bd-card__body { padding: 12px 12px 2px; gap: 4px; }
  .bd-shop-layout ul.products li.product .bd-card__title { font-size: 13.5px; }
  .bd-card__now, .bd-card__now .amount, .bd-card__now bdi { font-size: 16px; }
  .bd-card__save { display: none; }
  .bd-card__foot { padding: 8px 12px 12px; }
  .bd-shop-layout ul.products li.product .bd-card__foot .button { padding: 11px 10px; font-size: 13px; }
  .bd-shop__toolbar { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .bd-shop-layout ul.products li.product, .bd-side__chev, .bd-card__media img { transition: none; }
  .bd-shop-layout ul.products li.product:hover { transform: none; } .bd-shop-layout ul.products li.product:hover .bd-card__media img { transform: none; }
}
