/*
Theme Name: NilaBook
*/

/* Small-screen defaults; desktop enhancements follow below. */
* {
  box-sizing: border-box;
}

:root :where(.wp-element-button, .wp-block-button__link) {
  padding: 4px;
}

.wp-site-blocks > * + * {
  margin-block-start: 0;
}
.wp-site-blocks main {
  padding-block: 20px 48px;
  min-height: calc(100vh - 260px);
}

@media (min-width: 781px) {
  .wp-site-blocks main {
    min-height: calc(100vh - 294px);
  }
}

.woocommerce a.button.disabled,
.woocommerce a.button.disabled:hover,
.woocommerce a.button:disabled,
.woocommerce a.button:disabled:hover,
.woocommerce a.button:disabled[disabled],
.woocommerce a.button:disabled[disabled]:hover,
.woocommerce button.button.disabled,
.woocommerce button.button.disabled:hover,
.woocommerce button.button:disabled,
.woocommerce button.button:disabled:hover,
.woocommerce button.button:disabled[disabled],
.woocommerce button.button:disabled[disabled]:hover {
  opacity: 1;
  background-color: var(--wp--preset--color--muted) !important;
}
.wc-block-components-button:not(.is-link),
button,
.woocommerce button,
.woocommerce a.button,
.woocommerce button.button {
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
  font: inherit;
  box-shadow: none;
}

.wc-block-components-form .wc-block-components-text-input label,
.wc-block-components-text-input label {
  top: 20px;
}

.wc-block-components-form
  .wc-block-components-text-input
  input:-webkit-autofill
  + label,
.wc-block-components-form .wc-block-components-text-input.is-active label,
.wc-block-components-text-input input:-webkit-autofill + label,
.wc-block-components-text-input.is-active label,
.wc-blocks-components-select .wc-blocks-components-select__label {
  top: -6px;
  background-color: var(--wp--preset--color--surface);
  line-height: 1;
  padding: 0px 6px;
  border-radius: 2px;
}

.wc-block-components-form .wc-block-components-text-input input[type="date"],
.wc-block-components-form .wc-block-components-text-input input[type="email"],
.wc-block-components-form .wc-block-components-text-input input[type="number"],
.wc-block-components-form
  .wc-block-components-text-input
  input[type="password"],
.wc-block-components-form .wc-block-components-text-input input[type="tel"],
.wc-block-components-form .wc-block-components-text-input input[type="text"],
.wc-block-components-form .wc-block-components-text-input input[type="url"],
.wc-block-components-text-input input[type="date"],
.wc-block-components-text-input input[type="email"],
.wc-block-components-text-input input[type="number"],
.wc-block-components-text-input input[type="password"],
.wc-block-components-text-input input[type="tel"],
.wc-block-components-text-input input[type="text"],
.wc-block-components-text-input input[type="url"] {
  height: 36px;
  padding: 0px 12px;
}

.wc-block-components-form
  .wc-block-components-text-input
  input:-webkit-autofill,
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="date"],
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="email"],
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="number"],
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="password"],
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="tel"],
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="text"],
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="url"],
.wc-block-components-text-input input:-webkit-autofill,
.wc-block-components-text-input.is-active input[type="date"],
.wc-block-components-text-input.is-active input[type="email"],
.wc-block-components-text-input.is-active input[type="number"],
.wc-block-components-text-input.is-active input[type="password"],
.wc-block-components-text-input.is-active input[type="tel"],
.wc-block-components-text-input.is-active input[type="text"],
.wc-block-components-text-input.is-active input[type="url"] {
  padding: 0px 12px 0px 12px;
}

input {
  display: flex;
  align-items: center;
}

.wc-block-components-form
  .wc-block-components-text-input
  input:-webkit-autofill:focus-within,
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="date"]:focus-within,
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="email"]:focus-within,
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="number"]:focus-within,
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="password"]:focus-within,
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="tel"]:focus-within,
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="text"]:focus-within,
.wc-block-components-form
  .wc-block-components-text-input.is-active
  input[type="url"]:focus-within,
.wc-block-components-text-input input:-webkit-autofill:focus-within,
.wc-block-components-text-input.is-active input[type="date"]:focus-within,
.wc-block-components-text-input.is-active input[type="email"]:focus-within,
.wc-block-components-text-input.is-active input[type="number"]:focus-within,
.wc-block-components-text-input.is-active input[type="password"]:focus-within,
.wc-block-components-text-input.is-active input[type="tel"]:focus-within,
.wc-block-components-text-input.is-active input[type="text"]:focus-within,
.wc-block-components-text-input.is-active input[type="url"]:focus-within {
  padding: 0px 12px;
}

.wp-site-blocks main.is-flush {
  padding-block: 0;
}
img {
  max-width: 100%;
}
a,
button,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
input {
  font: inherit;
}
a:focus-visible,
button:focus-visible,
summary:focus-visible,
.shelf-carousel:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 3px;
}
.wp-site-blocks > header {
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header {
  background: var(--wp--preset--color--surface);
  border-bottom: 1px solid var(--wp--preset--color--border);
  position: relative;
  z-index: 20;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center;
  gap: 12px;
  padding-block: 12px;
}
.utility-links {
  font-size: 12px;
  margin: 0;
  white-space: normal;
}
.brand-logo {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  justify-self: center;
}
.brand-logo img {
  display: block;
  width: 48px;
  height: auto;
}
.header-tools {
  grid-column: 1 / -1;
  display: flex;
  direction: ltr;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.header-tools > * {
  margin: 0;
}
/* WooCommerce hides this control on the cart page but otherwise reserves space. */
.woocommerce-cart .header-tools .wc-block-mini-cart {
  display: none;
}
.woocommerce-cart
  main
  .wc-block-store-notices:has(.woocommerce-notices-wrapper:empty)
  + .wp-block-post-title {
  margin-block-start: 0;
}
.book-search {
  flex: 1;
  min-width: 0;
}
.book-search .wp-block-search__inside-wrapper {
  padding: 0;
  border: 1px solid var(--wp--preset--color--border);
  height: 36px;
  border-radius: 4px;
}
.book-search .wp-block-search__input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 4px 8px;
  font-size: 16px;
  direction: rtl;
}
.book-search .wp-block-search__button {
  color: var(--wp--preset--color--ink);
  background: transparent;
  padding: 0 8px;
  margin: 0;
  border: 0;
}

.wp-block-search__button-outside .wp-block-search__inside-wrapper {
  padding: 0;
  height: 36px;
  border-radius: 4px;
}

.wp-block-search__button-outside .wp-block-search__input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 16px;
  direction: rtl;
}
.wp-block-search__button-outside .wp-block-search__button {
  padding: 4px 12px;
  border-radius: 4px;
}

.search-toggle {
  display: none;
}
.wishlist-toggle {
  line-height: 1;
}
.wishlist-toggle a,
.header-tools .wc-block-mini-cart__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--wp--preset--color--ink-light);
  background-color: transparent;
}
.header-tools .wc-block-mini-cart__badge {
  font-size: 10px;
}
.book-search .wp-block-search__button svg,
.header-tools .wc-block-mini-cart__icon {
  display: none;
}
.book-search .wp-block-search__button::before,
.search-toggle::before,
.wishlist-toggle a::before,
.header-tools .wc-block-mini-cart__quantity-badge::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  vertical-align: middle;
  background-color: currentColor;
  -webkit-mask: var(--nilabook-icon) center / contain no-repeat;
  mask: var(--nilabook-icon) center / contain no-repeat;
}
.book-search .wp-block-search__button::before,
.search-toggle::before {
  --nilabook-icon: url("assets/icons/phosphor/magnifying-glass.svg");
}
.wishlist-toggle a {
  font-size: 0;
}
.wishlist-toggle a::before {
  --nilabook-icon: url("assets/icons/phosphor/star.svg");
}
.header-tools .wc-block-mini-cart__quantity-badge::before {
  --nilabook-icon: url("assets/icons/cart-bag.svg");
}
.site-header .category-nav {
  margin-block-start: 0;
  position: relative;
}
.mobile-categories > summary,
.category-shop-link,
.category-menu > summary,
.category-branch > summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 8px;
}
.category-shop-link {
  display: block;
  border-top: 1px solid var(--wp--preset--color--border);
}
.category-menu {
  margin: 0;
  border-top: 1px solid var(--wp--preset--color--border);
}
.category-menu[open] > summary,
summary:hover {
  color: var(--wp--preset--color--primary);
}
.mega-panel {
  background: var(--wp--preset--color--background);
  border: 1px solid var(--wp--preset--color--border);
  padding: 12px;
  margin: 0;
}

.category-all a {
  display: block;
  padding: 10px 8px;
  min-height: 44px;
  font-size: var(--wp--preset--font-size--body);
  color: var(--wp--preset--color--ink-light);
}

.category-all a:hover {
  color: var(--wp--preset--color--primary);
}

.category-tree,
.category-tree ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.category-tree ul {
  padding-inline-start: 16px;
}
.category-tree a {
  display: block;
  padding: 10px 8px;
  min-height: 44px;
}
.category-tree li {
  min-width: 0;
}
.home-catalog {
  max-width: 900px;
  margin-inline: auto;
  padding-block: 24px 42px;
}
.entry-content > .home-catalog {
  margin-block-start: 0;
}
.book-shelf + .book-shelf {
  margin-block-start: 36px;
}
.book-shelf h2 {
  text-align: center;
  color: var(--wp--preset--color--primary);
  font-size: 19px;
  margin: 0 0 20px;
}
.carousel-frame {
  position: relative;
}
.shelf-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 16px) / 2);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding-block: 4px 12px;
}
.shelf-carousel::-webkit-scrollbar {
  display: none;
}
.book-card {
  position: relative;
  min-width: 0;
  margin: 0;
  scroll-snap-align: start;
}
.book-card .wc-block-components-product-image {
  margin: 0;
}
.book-card .wc-block-components-product-image a {
  display: block;
  border: 2px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--surface);
}
.book-card .wc-block-components-product-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  display: block;
  margin: 0;
}
.book-card .wc-block-components-product-image a:hover {
  border-color: var(--wp--preset--color--primary);
}
.nilabook-product-cover {
  position: relative;
  min-width: 0;
}
.nilabook-product-cover .wc-block-components-product-image img,
.nilabook-product-cover .woocommerce-product-gallery__image img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3 !important;
  object-fit: contain !important;
}
button.book-favorite {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--wp--preset--color--background);
  cursor: pointer;
  z-index: 2;
}
button.book-favorite svg {
  width: 24px;
  height: 24px;
  display: block;
  filter: drop-shadow(0px 0px 1px #000);
}

button.book-favorite .star-fill {
  fill: transparent;
}
button.book-favorite[aria-pressed="true"] {
  color: var(--wp--preset--color--gold);
}
button.book-favorite[aria-pressed="true"] .star-fill {
  fill: currentColor;
}
.carousel-arrows[hidden],
.carousel-controls[hidden] {
  display: none;
}
.carousel-arrows button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 19px;
  height: 44px;
  padding: 0;
  border: 0;
  background-color: color-mix(
    in srgb,
    var(--wp--preset--color--surface) 60%,
    transparent
  );
  color: var(--wp--preset--color--ink);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}
.carousel-arrows [data-direction="previous"] {
  right: 2px;
  padding-right: 4px;
}
.carousel-arrows [data-direction="next"] {
  left: 2px;
  padding-left: 4px;
}
.carousel-arrows button span {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  font-size: 0;
}
.carousel-arrows [data-direction="next"] span {
  transform: rotate(-135deg);
}
.carousel-arrows button:disabled {
  cursor: default;
  opacity: 0.4;
}
.carousel-controls {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}
.carousel-indicators {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.carousel-indicators button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.carousel-indicators button::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--wp--preset--color--ink);
}
.carousel-indicators button[aria-current]::before {
  background: var(--wp--preset--color--primary);
}
.shelf-empty {
  grid-column: 1 / -1;
  font-size: 13px;
}
.site-footer {
  background: var(--wp--preset--color--surface);
  border-top: 1px solid var(--wp--preset--color--border);
  padding-block: 14px 24px;
  text-align: center;
  min-height: 110px;
}
.footer-links {
  margin: 0;
  font-size: 12px;
}
.footer-links a {
  display: inline-block;
  padding-block: 10px;
}
.copyright {
  font-size: 12px;
  margin: 20px 0 0;
}
.wishlist-reminder {
  clear: both;
  border-block: 1px solid var(--wp--preset--color--border);
  padding: 10px 0;
  font-size: var(--wp--preset--font-size--body);
}
.wishlist-reminder:empty,
.wishlist-status:empty {
  display: none;
}
.wishlist-notice {
  position: fixed;
  inset-inline: 16px;
  bottom: 16px;
  z-index: 100;
  max-width: 420px;
  padding: 14px;
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--ink);
  box-shadow: 0 2px 10px
    color-mix(in srgb, var(--wp--preset--color--ink) 20%, transparent);
}
.wishlist-notice button {
  float: left;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.wishlist-notice a,
.wishlist-reminder a {
  color: var(--wp--preset--color--primary);
  text-decoration: underline;
}
.wishlist-dialog {
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--surface);
  padding: 8px 16px;
  width: min(760px, calc(100vw - 32px));
  max-height: 80vh;
  color: var(--wp--preset--color--ink);
  font-family: inherit;
}
.wishlist-dialog::backdrop {
  background: color-mix(
    in srgb,
    var(--wp--preset--color--ink) 65%,
    transparent
  );
}

.wishlist-dialog h2 {
  font-size: var(--wp--preset--font-size--headline);
  margin-block: 8px;
}

button.wishlist-close {
  float: left;
  background: transparent;
  color: inherit;
  border: 0;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  height: 44px;
  width: 44px;
}

.wishlist-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  clear: both;
  padding-top: 15px;
  font-size: var(--wp--preset--font-size--body);
}

.wishlist-items.wishlist-no-item {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.wishlist-items img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: contain;
}
.wishlist-items a {
  font-size: var(--wp--preset--font-size--body);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}
/* Keep legacy single-product blocks usable in editorial page content. */
.book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px;
}

@media (min-width: 781px) {
  .masthead {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    min-height: 126px;
  }
  .brand-logo {
    grid-column: 2;
    grid-row: 1;
  }
  .brand-logo img {
    width: 72px;
  }
  .utility-links {
    grid-column: 1;
    grid-row: 1;
  }
  .header-tools {
    grid-column: 3;
    grid-row: 1;
    justify-content: flex-start;
    gap: 8px;
    position: relative;
  }
  button.search-toggle {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--wp--preset--color--ink);
    cursor: pointer;
  }
  .book-search {
    position: absolute;
    top: 100%;
    left: 0;
    width: 230px;
    background: var(--wp--preset--color--surface);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition:
      opacity 0.18s ease,
      transform 0.18s ease,
      visibility 0.18s;
    z-index: 2;
  }
  .book-search.is-open,
  .book-search:focus-within {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }
  .mobile-categories > summary {
    display: none;
  }
  .mobile-categories::details-content {
    display: contents;
    content-visibility: visible;
  }
  .category-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .category-menu {
    border: 0;
  }
  .category-menu > summary,
  .category-shop-link {
    font-size: var(--wp--preset--font-size--body);
    list-style: none;
  }
  .category-shop-link {
    border: 0;
  }
  .category-menu > summary::-webkit-details-marker {
    display: none;
  }
  .category-menu::details-content {
    display: contents;
    content-visibility: visible;
  }
  .mega-panel {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    max-height: 65vh;
    overflow-y: auto;
    padding: 16px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      visibility 0.2s;
  }
  .category-menu[open] .mega-panel {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .category-tree {
    display: flex;
    gap: 8px;
  }
  .home-catalog {
    padding-block: 24px 66px;
  }
  .shelf-carousel {
    grid-auto-columns: calc((100% - 60px) / 4);
    gap: 20px;
  }
  .book-shelf + .book-shelf {
    margin-block-start: 52px;
  }
  .book-shelf h2 {
    font-size: 21px;
    margin-bottom: 24px;
  }
  .book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px;
  }
  .wishlist-items {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .mega-panel,
  .book-search {
    transition: none;
    transform: none;
  }
}
.category-art {
  display: none;
}

/* Keep catalog purchase controls consistent across product states. */
.wp-block-woocommerce-product-collection
  .wp-block-woocommerce-product-button
  .wp-block-button__link {
  box-sizing: border-box;
  width: 128px;
  height: 32px;
  padding: 0;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 781px) {
  .category-all a {
    font-size: var(--wp--preset--font-size--small);
  }

  .category-tree > li > a {
    font-size: var(--wp--preset--font-size--small);
    text-align: center;
  }

  .category-tree > li > a > .category-art,
  .category-tree > li > details > summary > .category-art {
    display: block;
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    margin-top: 8px;
  }
}
@media (min-width: 781px) {
  #shelf-coming_soon-books {
    direction: ltr;
  }
  #shelf-coming_soon-books .book-card {
    direction: rtl;
  }
  #shelf-coming_soon-books + .carousel-arrows [data-direction="previous"] {
    right: auto;
    left: 2px;
    padding: 0 0 0 4px;
  }
  #shelf-coming_soon-books + .carousel-arrows [data-direction="next"] {
    left: auto;
    right: 2px;
    padding: 0 4px 0 0;
  }
  #shelf-coming_soon-books + .carousel-arrows [data-direction="previous"] span {
    transform: rotate(-135deg);
  }
  #shelf-coming_soon-books + .carousel-arrows [data-direction="next"] span {
    transform: rotate(45deg);
  }
}
.wp-block-woocommerce-catalog-sorting .woocommerce-ordering select {
  height: 32px;
  font-family: inherit;
  font-size: 14px;
}

.wp-block-woocommerce-catalog-sorting .woocommerce-ordering .orderby {
  width: 128px;
  background-color: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 4px;
  padding: 2px;
}

/* Catalog view selection and horizontal product rows. */
.nilabook-view-switch:not([hidden]) {
  display: flex;
  align-items: center;
}
.nilabook-view-switch button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--wp--preset--color--ink);
  cursor: pointer;
}
.nilabook-view-switch button[aria-pressed="true"] {
  color: var(--wp--preset--color--primary);
}
.nilabook-view-switch svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.nilabook-catalog-excerpt {
  display: none;
}

/* Keep product names within their card in both grid and list views. */
.wc-block-product-template .wp-block-post-title a,
.woocommerce ul.products li.product .woocommerce-loop-product__title a {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nilabook-list-view
  .wp-block-woocommerce-product-collection
  .wc-block-product-template {
  display: flex;
  flex-direction: column;
}

.nilabook-list-view
  .wp-block-woocommerce-product-collection
  .wc-block-product-template
  > li {
  display: grid;
  grid-template-columns: minmax(100px, 40%) minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  column-gap: 16px;
  row-gap: 12px;
  width: 100%;
  align-items: start;
}
.nilabook-list-view .wc-block-product-template .nilabook-product-cover {
  grid-column: 1;
  grid-row: 1 / 6;
}
.nilabook-list-view .wc-block-product-template .wp-block-post-title,
.nilabook-list-view .wc-block-product-template .nilabook-catalog-excerpt,
.nilabook-list-view
  .wc-block-product-template
  .wp-block-woocommerce-product-price,
.nilabook-list-view
  .wc-block-product-template
  .wp-block-woocommerce-product-button {
  grid-column: 2;
  text-align: start;
  margin: 0 0 10px;
}
.nilabook-list-view .wc-block-product-template .wp-block-post-title {
  grid-row: 1;
}
.nilabook-list-view .wc-block-product-template .nilabook-catalog-excerpt {
  grid-row: 2;
  display: block;
  font-size: var(--wp--preset--font-size--small);
  line-height: 1.6;
}
.nilabook-list-view
  .wc-block-product-template
  .wp-block-woocommerce-product-price {
  grid-row: 3;
}
.nilabook-list-view .nilabook-catalog-excerpt p {
  margin: 0;
}

.woocommerce-Price-amount.amount {
  color: var(--wp--preset--color--ink-dark);
}

.nilabook-list-view
  .wc-block-product-template
  .wc-block-components-product-price {
  text-align: start;
}
.nilabook-list-view
  .wc-block-product-template
  .wp-block-woocommerce-product-button {
  grid-row: 4;
  align-items: flex-start;
  align-self: end;
  margin-bottom: 0;
}
.nilabook-list-view
  .wc-block-product-template
  .wp-block-woocommerce-product-button
  .wp-block-button__link {
  margin-bottom: 0 !important;
}
@media (min-width: 600px) {
  .nilabook-list-view
    .wp-block-woocommerce-product-collection
    .wc-block-product-template
    > li {
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: 20px;
  }
}
/* Keep the toolbar above the collection even when WooCommerce floats its forms. */
.wp-site-blocks main .wp-block-group:has(> .nilabook-catalog-controls) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  clear: both;
}
.wp-block-woocommerce-product-collection .wc-block-product-results-count,
.wp-block-woocommerce-product-collection .woocommerce-result-count {
  float: none;
  text-align: center;
}
.wp-block-woocommerce-catalog-sorting .woocommerce-ordering {
  float: none;
  margin: 0;
}
.wp-block-woocommerce-product-collection {
  clear: both;
}

.nilabook-load-more {
  display: block;
  width: fit-content;
  margin: 1.5rem auto;
  padding: 0.75rem 1rem;
  color: var(--wp--preset--color--ink);
}

.wp-block-query-pagination-numbers span,
.wp-block-query-pagination-numbers a {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border: 1px solid var(--wp--preset--color--border);
  justify-content: center;
  line-height: 2;
}

.wp-block-query-pagination-numbers span:not(.dots) {
  background-color: var(--wp--preset--color--surface);
}

.breadcrumb-separator {
  color: var(--wp--preset--color--primary);
  margin: 0px 4px;
}

.mobile-account,
.mobile-menu-close,
.mobile-menu-backdrop,
.mobile-menu-links {
  display: none;
}
@media (max-width: 780px) {
  .masthead {
    grid-template-columns: 1fr auto !important;
    gap: 8px;
    padding: 8px 0 12px;
    direction: ltr;
  }
  .utility-links {
    display: none;
  }
  .brand-logo {
    grid-column: 2;
    grid-row: 1;
  }
  .header-tools {
    display: contents !important;
  }
  .mobile-account,
  .wishlist-toggle,
  .header-tools .wc-block-mini-cart {
    grid-row: 1;
  }
  .mobile-account {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--wp--preset--color--ink);
  }
  .mobile-account svg {
    width: 24px;
    height: 24px;
  }
  .masthead {
    grid-template-columns: 1fr 44px 44px 44px !important;
  }
  .woocommerce-cart .masthead {
    grid-template-columns: 1fr 44px 44px !important;
  }
  .brand-logo {
    grid-column: 1;
    justify-self: start;
  }
  .mobile-account {
    grid-column: 2;
  }
  .wishlist-toggle {
    grid-column: 3;
  }
  .header-tools .wc-block-mini-cart {
    grid-column: 4;
  }
  .book-search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: calc(100% - 52px);
    justify-self: end;
  }
  .site-header .category-nav {
    position: static;
  }
  .mobile-categories.is-drawer-enhanced > summary {
    position: absolute;
    bottom: 12px;
    left: 16px;
    width: 36px;
    height: 36px;
    font-size: 0;
    list-style: none;
  }
  .mobile-categories.is-drawer-enhanced > summary::-webkit-details-marker {
    display: none;
  }
  .mobile-categories.is-drawer-enhanced > summary::before {
    content: "☰";
    font-size: 32px;
    line-height: 1;
    color: var(--wp--preset--color--ink);
    display: inline-block;
  }
  .mobile-categories.is-drawer-enhanced[open] .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--wp--preset--color--ink);
    opacity: 0;
    z-index: 100;
    transition: opacity 250ms ease;
  }
  .mobile-categories.is-drawer-enhanced[open] .category-items {
    position: fixed;
    z-index: 101;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(320px, 85vw);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--wp--preset--color--surface);
    padding: 16px 20px 32px;
    transform: translateX(100%);
    transition: transform 250ms ease;
  }
  .mobile-categories[open].is-drawer-open .mobile-menu-backdrop {
    opacity: 0.55;
  }
  .mobile-categories[open].is-drawer-open .category-items {
    transform: translateX(0);
  }
  .mobile-menu-open {
    overflow: hidden;
  }
  button.mobile-menu-close {
    display: block;
    border: 0;
    background: transparent;
    color: var(--wp--preset--color--ink);
    font-size: 30px;
    line-height: 1;
    width: 44px;
    height: 44px;
    cursor: pointer;
    margin: 0 auto 12px 0;
  }
  .mobile-menu-links {
    display: grid;
    border-top: 1px solid var(--wp--preset--color--border);
    margin-top: 16px;
    padding-top: 12px;
  }
  .mobile-menu-links a {
    padding: 10px 8px;
    min-height: 44px;
  }
  .category-menu {
    border: 0;
  }
  .category-menu > summary,
  .category-shop-link {
    font-weight: 700;
  }
  .category-menu > summary,
  .category-branch > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    list-style: none;
  }
  .category-menu > summary::-webkit-details-marker,
  .category-branch > summary::-webkit-details-marker {
    display: none;
  }
  .category-menu > summary::after,
  .category-branch > summary::after {
    content: "";
    flex: 0 0 7px;
    height: 7px;
    border-left: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(135deg);
    transition: transform 250ms ease;
  }
  .category-menu[open] > summary::after,
  .category-branch[open] > summary::after {
    transform: rotate(-45deg);
  }
  @supports (block-size: calc-size(auto, size)) and
    (transition-behavior: allow-discrete) {
    .category-menu::details-content,
    .category-branch::details-content {
      block-size: 0;
      overflow: clip;
      transition:
        block-size 250ms ease,
        content-visibility 250ms allow-discrete;
    }
    .category-menu[open]::details-content,
    .category-branch[open]::details-content {
      block-size: calc-size(auto, size);
    }
  }
  .mega-panel {
    background: transparent;
    border: 0;
    padding: 0 8px 12px;
  }
  .category-art {
    display: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .category-menu::details-content,
  .category-branch::details-content,
  .category-menu > summary::after,
  .category-branch > summary::after {
    transition: none;
  }
  .mobile-categories.is-drawer-enhanced[open] .mobile-menu-backdrop,
  .mobile-categories.is-drawer-enhanced[open] .category-items {
    transition: none;
  }
}

/* Reuse the desktop header's controls in a single compact bar after scrolling. */
@media (min-width: 781px) {
  .wp-site-blocks > header.has-compact-header {
    position: relative;
    z-index: 1000;
  }
  .has-compact-header .site-header {
    position: fixed;
    inset: 0 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto 32px;
    align-items: center;
    gap: 16px;
    min-height: 56px;
    padding-inline: 20px;
  }
  .admin-bar .has-compact-header .site-header {
    top: var(--wp-admin--admin-bar--height, 32px);
  }
  .has-compact-header .masthead {
    display: contents;
  }
  .has-compact-header .utility-links {
    grid-column: 1;
    grid-row: 1;
    white-space: nowrap;
    font-size: 12px;
  }

  .utility-links a {
    color: var(--wp--preset--color--ink-light);
  }

  .utility-links a:hover {
    color: var(--wp--preset--color--primary);
  }

  .has-compact-header .category-nav {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .has-compact-header .category-menu > summary,
  .has-compact-header .category-shop-link {
    padding-inline: 4px;
    white-space: nowrap;
    font-size: 14px;
    color: var(--wp--preset--color--ink);
  }
  .has-compact-header .header-tools {
    grid-column: 3;
    grid-row: 1;
    gap: 0;
    margin: 0;
  }
  .has-compact-header .brand-logo {
    grid-column: 4;
    grid-row: 1;
    margin: 0;
    display: flex;
  }
  .has-compact-header .brand-logo img {
    width: 48px;
  }
}

/* Cast options use WooCommerce's native attribute filtering and route counts. */
.nilabook-cast-filters:not(
  :has(
    .wc-block-product-filters__overlay-content
      > :not(.wc-block-product-filter--hidden)
  )
) {
  display: none;
}
.nilabook-cast-filter {
  box-sizing: border-box;
  width: 100%;
  max-width: 280px;
  padding: 16px;
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--ink);
}
.nilabook-cast-filter h3 {
  margin: 0 0 20px;
  font-size: var(--wp--preset--font-size--small);
}
.nilabook-cast-search {
  position: relative;
  margin-bottom: 20px;
}
.nilabook-cast-search input {
  box-sizing: border-box;
  width: 100%;
  height: 36px;
  padding: 4px 38px 4px 10px;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 4px;
  font: inherit;
  font-size: var(--wp--preset--font-size--small);
  color: inherit;
  background: var(--wp--preset--color--surface);
}
.nilabook-cast-search svg {
  position: absolute;
  inset-inline-start: 12px;
  top: 8px;
  width: 20px;
  height: 20px;
  pointer-events: none;
}
.nilabook-cast-filter .wc-block-product-filter-checkbox-list__items {
  max-height: 285px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.nilabook-cast-filter .wc-block-product-filter-checkbox-list__label {
  min-height: 56px;
  border-bottom: 1px solid var(--wp--preset--color--border);
  align-items: center;
}
.nilabook-cast-filter .wc-block-product-filter-checkbox-list__show-more,
.nilabook-cast-filter .nilabook-cast-no-match {
  display: none !important;
}
.nilabook-cast-filter input:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}
.nilabook-cast-empty {
  font-size: var(--wp--preset--font-size--small);
}
.nilabook-cast-filter .wc-block-product-filter-checkbox-list__label {
  width: 100%;
}
.nilabook-cast-filter input.wc-block-product-filter-checkbox-list__input {
  border-color: var(--wp--preset--color--ink);
}

/* The first desktop grid track is the right sidebar in RTL. */
.nilabook-catalog-content {
  min-width: 0;
}
.nilabook-catalog-layout > .nilabook-cast-filters {
  margin-block-start: 0;
}
.nilabook-catalog-layout .nilabook-cast-filter {
  max-width: none;
}
@media (min-width: 783px) {
  .nilabook-catalog-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  .nilabook-catalog-layout > .nilabook-catalog-content {
    margin-block-start: 0;
  }
  .nilabook-catalog-layout:not(
    :has(
      .wc-block-product-filters__overlay-content
        > :not(.wc-block-product-filter--hidden)
    )
  ) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.nilabook-cast-filters {
  --wc-product-filters-background-color: var(--wp--preset--color--surface);
  --wc-product-filters-text-color: var(--wp--preset--color--ink);
}
@media (max-width: 782px) {
  /* Share one toolbar row while keeping WooCommerce's drawer in its own block. */
  .nilabook-catalog-layout {
    display: grid;
    grid-template-columns: minmax(72px, 1fr) auto minmax(0, 128px);
    column-gap: 8px;
    align-items: center;
  }
  .nilabook-catalog-layout > .nilabook-catalog-content,
  .nilabook-catalog-content > .wp-block-group:has(> .nilabook-view-switch) {
    display: contents;
  }
  .nilabook-catalog-layout > .nilabook-cast-filters {
    display: flex;
  }
  .nilabook-catalog-content .nilabook-view-switch {
    grid-column: 1;
    grid-row: 1;
  }
  .nilabook-catalog-content .wp-block-woocommerce-catalog-sorting {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
    margin: 0;
  }
  .wp-block-woocommerce-catalog-sorting .woocommerce-ordering .orderby {
    max-width: 100%;
  }
  .nilabook-catalog-content > .wp-block-woocommerce-product-collection {
    grid-column: 1 / -1;
  }
  .nilabook-cast-filters .wc-block-product-filters__open-overlay {
    height: 32px;
    padding: 0px 4px;
    border: 1px solid var(--wp--preset--color--border);
    background: var(--wp--preset--color--surface);
    font: inherit;
    color: var(--wp--preset--color--ink-dark);
    border-radius: 4px;
  }
  .nilabook-cast-filters .wc-block-product-filters__overlay-dialog {
    width: min(88vw, 360px);
  }
  .nilabook-cast-filters .wc-block-product-filters__overlay-header {
    padding: 16px;
  }
  .nilabook-cast-filters .wc-block-product-filters__close-overlay {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    background-color: transparent;
    font-size: 30px;
    line-height: 1;
    color: var(--wp--preset--color--ink);
  }
  .nilabook-cast-filters .wc-block-product-filters__close-overlay svg {
    display: none;
  }
  .nilabook-cast-filters .wc-block-product-filters__close-overlay::before {
    content: "×";
  }
  .nilabook-cast-filters .wc-block-product-filters__overlay-content {
    padding: 0;
    gap: 2px;
  }
  .nilabook-cast-filters .wc-block-product-filters__overlay-footer {
    padding: 16px;
  }

  .nilabook-cast-filters .wc-block-product-filters__overlay-footer button {
    height: 32px;
    border-radius: 4px;
    padding: 4px;
  }

  .nilabook-cast-filters .wc-block-product-filters__open-overlay:focus-visible,
  .nilabook-cast-filters
    .wc-block-product-filters__close-overlay:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 2px;
  }
}

.wp-block-button__link.wp-element-button:disabled {
  background-color: var(--wp--preset--color--muted);
  cursor: default;
}

button.nilabook-back-to-top {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 6px 0px 0px;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 50%;
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--ink);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1.5;
  cursor: pointer;
}
button.nilabook-back-to-top[hidden] {
  display: none;
}
button.nilabook-back-to-top:hover {
  border-color: var(--wp--preset--color--primary);
}
button.nilabook-back-to-top:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 3px;
}

/* Keep the full cover visible in cart and checkout summaries. */
table.wc-block-cart-items
  .wc-block-cart-items__row
  .wc-block-cart-item__image
  img,
.wc-block-components-order-summary
  .wc-block-components-order-summary-item__image
  > img {
  aspect-ratio: 2 / 3;
  height: auto;
  object-fit: contain;
}

.wc-block-mini-cart__footer-actions a {
  height: 32px;
  font-size: var(--wp--preset--font-size--body);
  border-radius: 4px;
}

.wc-block-components-quantity-selector
  button.wc-block-components-quantity-selector__button {
  font-size: 1.5rem;
  line-height: 1rem;
  font-weight: 700;
  color: var(--wp--preset--color--ink);
  height: 32px;
  width: 32px;
}

.wc-block-components-quantity-selector
  input.wc-block-components-quantity-selector__input {
  font-size: var(--wp--preset--font-size--body);
  line-height: 1rem;
}

table.wc-block-cart-items
  .wc-block-cart-items__row
  .wc-block-cart-item__quantity
  .wc-block-cart-item__remove-link {
  width: 32px;
  height: 32px;
  padding: 4px;
}

.wc-block-components-quantity-selector:where(:has(input:not([type="hidden"]))) {
  max-width: 128px;
}

table.wc-block-cart-items
  .wc-block-cart-items__row
  .wc-block-cart-item__quantity {
  align-items: center;
}

/* WPForms contact form: stacked on phones, right-hand labels on desktop. */
#wpforms-1833 {
  margin-block: 32px;
}
#wpforms-1833 .wpforms-field {
  padding: 0;
  margin-block-end: 16px;
}
#wpforms-1833 .wpforms-field-label {
  font-size: var(--wp--preset--font-size--small);
  font-weight: 400;
}
#wpforms-1833 input,
#wpforms-1833 textarea {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 0;
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--ink);
  font: inherit;
}
#wpforms-1833 textarea {
  height: 150px;
  resize: vertical;
}
#wpforms-1833 input[type="email"] {
  direction: ltr;
  text-align: left;
}
#wpforms-1833 :is(input, textarea):focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}
#wpforms-1833 .wpforms-required-label {
  color: var(--wp--preset--color--error);
}
#wpforms-1833 .wpforms-recaptcha-container {
  margin-block: 20px 32px;
  direction: ltr;
  width: fit-content;
}
#wpforms-1833 button[type="submit"] {
  min-height: 44px;
  height: auto;
  padding: 6px 16px;
  border: 0;
  border-radius: 4px;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
  font-family: inherit;
  font-size: var(--wp--preset--font-size--small);
  box-shadow: none;
}
@media (min-width: 782px) {
  #wpforms-1833 {
    max-width: 660px;
    margin-inline-start: max(
      0px,
      calc((100% - var(--wp--style--global--content-size)) / 2)
    ) !important;
  }
  #wpforms-1833 .wpforms-field {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
  }
  #wpforms-1833 .wpforms-field-label {
    grid-column: 1;
    padding-block-start: 8px;
  }
  #wpforms-1833 .wpforms-field :is(input, textarea) {
    grid-column: 2;
    grid-row: 1;
  }
  #wpforms-1833 .wpforms-field label.wpforms-error {
    grid-column: 2;
  }
  #wpforms-1833 :is(.wpforms-recaptcha-container, .wpforms-submit-container) {
    margin-inline-start: 146px;
  }
}

/* Guest account forms share the contact form's controls. */
.woocommerce-account:not(.logged-in) .woocommerce form.login,
.woocommerce-account:not(.logged-in) .woocommerce form.register {
  border: 0;
  padding: 0;
  margin: 20px 0 0;
}
.woocommerce-account:not(.logged-in) #customer_login h2 {
  font-size: var(--wp--preset--font-size--medium);
  font-weight: 400;
  margin: 0;
}
.woocommerce-account:not(.logged-in) .woocommerce form .form-row {
  padding: 0;
  margin: 0 0 16px;
}
.woocommerce-account:not(.logged-in) .woocommerce form .form-row label {
  font-weight: 400;
}
.woocommerce-account:not(.logged-in) .woocommerce form .form-row .input-text {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 4px;
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--ink);
  font: inherit;
}
.woocommerce-account:not(.logged-in)
  .woocommerce
  form
  .input-text:focus-visible,
.woocommerce-account:not(.logged-in) .woocommerce form button:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}
.woocommerce-account:not(.logged-in) .woocommerce form .required {
  color: var(--wp--preset--color--error);
}
.woocommerce-account:not(.logged-in) .woocommerce form button.button {
  min-height: 32px;
  min-width: 96px;
  padding: 4px 16px;
  border: 0;
  border-radius: 4px;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
  font: inherit;
  box-shadow: none;
}
.woocommerce-account:not(.logged-in) #customer_login .col-2 {
  margin-block-start: 32px;
  padding-block-start: 32px;
  border-block-start: 1px dashed var(--wp--preset--color--ink);
}
@media (min-width: 768px) {
  .woocommerce-account:not(.logged-in) #customer_login {
    display: flex;
    gap: 0;
  }
  .woocommerce-account:not(.logged-in) #customer_login .col-1,
  .woocommerce-account:not(.logged-in) #customer_login .col-2 {
    float: none;
    width: 50%;
    box-sizing: border-box;
  }
  .woocommerce-account:not(.logged-in) #customer_login .col-1 {
    padding-inline-end: 40px;
  }
  .woocommerce-account:not(.logged-in) #customer_login .col-2 {
    margin: 0;
    padding: 0 40px 0 0;
    border: 0;
    border-inline-start: 1px dashed var(--wp--preset--color--ink);
  }
}

.wc-block-components-button.wc-block-components-drawer__close {
  opacity: 1;
  top: 24px;
  left: 24px;
}

.wc-block-components-button.wc-block-components-drawer__close svg {
  width: 18px;
  height: 18px;
  stroke: var(--wp--preset--color--ink);
  stroke-width: 2px;
  fill: var(--wp--preset--color--ink);
}

table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,
table.wc-block-cart-items
  .wc-block-cart-items__row
  .wc-block-components-product-name {
  font-size: var(--wp--preset--font-size--body);
}

.wc-blocks-components-select .wc-blocks-components-select__select {
  height: 36px;
  padding: 0px 9px;
}

.wc-blocks-components-select .wc-blocks-components-select__select:focus {
  padding: 0px 9px;
}

.woocommerce-checkout header {
  font-size: var(--wp--preset--font-size--headline);
  padding: 16px;
}

.nilabook-cast-count-filter {
  box-sizing: border-box;
  padding: 16px;
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--ink);
  font-size: var(--wp--preset--font-size--small);
}
.nilabook-cast-count-filter label {
  display: block;
  margin-bottom: 12px;
}
.nilabook-cast-count-filter input {
  box-sizing: border-box;
  width: 100%;
  height: 36px;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 4px;
  color: inherit;
  background: var(--wp--preset--color--surface);
  font: inherit;
}
.nilabook-cast-count-filter input:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}

.nilabook-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.nilabook-cast-filter .nilabook-filter-heading h3,
.nilabook-cast-count-filter .nilabook-filter-heading label {
  margin: 0;
}
.nilabook-cast-filters button.nilabook-clear-filter {
  height: 36px;
  padding: 0 8px;
  border: 0;
  color: var(--wp--preset--color--error);
  background: transparent;
  font: inherit;
  font-size: var(--wp--preset--font-size--small);
  cursor: pointer;
  display: flex;
  gap: 4px;
  align-items: center;
}
.nilabook-cast-filters button.nilabook-clear-filter:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}

.nilabook-cast-filter:not(
    :has(.wc-block-product-filter-checkbox-list__input:checked)
  )
  .nilabook-clear-cast,
.nilabook-cast-count-filter:not(:has(input:not(:placeholder-shown)))
  .nilabook-clear-count {
  display: none;
}

.nilabook-cast-filters button.nilabook-clear-filter span {
  font-size: 24px;
}

@media (width > 782px) {
  :where(.wc-block-product-filters).is-mobile-overlay
    .wc-block-product-filters__overlay-content {
    gap: 2px;
  }
}

.single-product
  .nilabook-product-cover
  .wp-block-woocommerce-product-image-gallery
  .woocommerce-product-gallery.images {
  margin-bottom: 0;
}

.single-product .wp-block-post-title {
  font-size: var(--wp--preset--font-size--medium);
}

.single-product .amount {
  font-size: var(--wp--preset--font-size--body);
}

/* Single-book reading order follows the cover-first product reference. */
.nilabook-single-product .nilabook-book-details {
  max-width: 440px;
}

@media (min-width: 781px) {
  .nilabook-single-product .nilabook-book-details {
    display: flex;
    gap: 32px;
    max-width: var(--wp--style--global--content-size);
  }

  .nilabook-single-product .nilabook-book-details .nilabook-book-details-image {
    flex: 1;
  }
  .nilabook-single-product
    .nilabook-book-details
    .nilabook-book-details-details {
    flex: 2;
  }
}

.nilabook-single-product .nilabook-book-details h2 {
  font-size: var(--wp--preset--font-size--medium);
}

.nilabook-single-product .nilabook-book-details > .nilabook-product-cover {
  margin-block: 0;
}
.nilabook-single-product
  .nilabook-book-details
  .wp-block-woocommerce-add-to-cart-form {
  margin-block-start: 12px;
}
.nilabook-single-product .nilabook-book-details .stock.in-stock {
  display: none;
}
.nilabook-single-product
  .nilabook-book-details
  .wc-block-add-to-cart-form
  form.cart {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin-block: 0 !important;
}
.nilabook-single-product
  .nilabook-book-details
  div.wc-block-add-to-cart-form
  form.cart
  div.quantity.wc-block-components-quantity-selector:has(
    input:not([type="hidden"])
  ) {
  width: 100%;
  max-width: none;
  flex-basis: 100%;
  margin: 0;
  height: 36px;
  align-items: center;
}
.nilabook-single-product
  .nilabook-book-details
  .wc-block-add-to-cart-form
  .single_add_to_cart_button {
  width: 100%;
  height: 32px;
  margin: 0;
}
.nilabook-product-share {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-block: 12px;
}
.nilabook-product-share a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}
.nilabook-product-share a:hover {
  opacity: 0.8;
}
.nilabook-product-share .nilabook-share-x {
  color: var(--wp--preset--color--brand-x);
}
.nilabook-product-share .nilabook-share-facebook {
  color: var(--wp--preset--color--brand-facebook);
}
.nilabook-product-share .nilabook-share-whatsapp {
  color: var(--wp--preset--color--brand-whatsapp);
}
.nilabook-product-share svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.nilabook-book-heading {
  gap: 16px;
  align-items: baseline;
}
.nilabook-book-heading .wp-block-post-title {
  margin: 0;
  overflow-wrap: anywhere;
}
.nilabook-book-heading .wp-block-woocommerce-product-price {
  flex-shrink: 0;
  margin: 0;
  text-align: end;
}
.nilabook-single-product
  .nilabook-book-details
  .wp-block-woocommerce-product-summary {
  border-top: 1px solid var(--wp--preset--color--border);
  padding-block-start: 16px;
  margin-block-start: 4px;
  font-size: var(--wp--preset--font-size--small);
}
.nilabook-single-product
  .nilabook-book-details
  .wc-block-components-product-summary
  p {
  margin-block: 0 4px;
}
.nilabook-single-product .nilabook-book-details p:empty,
.nilabook-single-product .nilabook-book-details p:has(> br:only-child) {
  display: none;
}

.nilabook-book-description:not(:has(.wc-block-product-description)) {
  display: none;
}

.nilabook-book-description .wc-block-product-description {
  margin-block-start: 4px;
  padding-block-start: 10px;
  border-top: 1px solid var(--wp--preset--color--border);
  font-size: var(--wp--preset--font-size--small);
}

.nilabook-book-description p {
  margin-block: 0 8px;
}

.nilabook-single-product > .book-shelf {
  margin-block-start: 48px;
}

.nilabook-book-description .wc-block-product-description table {
  width: 100%;
}

.nilabook-book-description .wc-block-product-description table {
  border-collapse: collapse;
}

.nilabook-book-description .wc-block-product-description table tbody td {
  border: 1px solid var(--wp--preset--color--ink);
  padding: 2px 4px;
}

.nilabook-book-description p a {
  text-decoration: underline;
}

.is-layout-flow hr {
  border-style: solid;
  border-color: var(--wp--preset--color--border);
  border-bottom-style: none;
  margin: 4px 0 16px 0;
}
