/* Enavelle native WooCommerce catalogue and shared product cards. */

.enavelle-catalog {
  background: var(--enavelle-white);
}

.enavelle-catalog__intro {
  padding-block: clamp(8px, 1.1vw, 16px) clamp(6px, 0.8vw, 10px);
  text-align: center;
}

.enavelle-catalog__intro h1 {
  margin: 0;
  font-family: var(--enavelle-font-display);
  font-size: clamp(1.2rem, 1.45vw, 1.55rem);
  font-weight: 500;
  line-height: 1;
}

.enavelle-catalog__description {
  max-width: 66ch;
  margin: 5px auto 0;
  color: var(--enavelle-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.enavelle-catalog__description > :last-child {
  margin-bottom: 0;
}

.enavelle-catalog__shell {
  width: var(--enavelle-shell);
  margin-inline: auto;
  padding-bottom: clamp(72px, 8vw, 140px);
}

.enavelle-catalog__toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) repeat(2, minmax(92px, 0.62fr)) repeat(3, minmax(122px, 0.82fr)) auto auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 12px;
  border: 1px solid var(--enavelle-line);
  border-radius: var(--enavelle-radius);
  background: var(--enavelle-paper);
}

.enavelle-catalog__toolbar input,
.enavelle-catalog__toolbar select,
.enavelle-catalog__toolbar button,
.enavelle-catalog__toolbar a {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--enavelle-line);
  border-radius: 12px;
  color: var(--enavelle-ink);
  background: var(--enavelle-white);
  font: inherit;
}

.enavelle-catalog__toolbar input,
.enavelle-catalog__toolbar select {
  width: 100%;
  padding: 8px 12px;
}

.enavelle-catalog__toolbar button,
.enavelle-catalog__toolbar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-weight: 750;
  text-decoration: none;
}

.enavelle-catalog__toolbar button {
  border-color: var(--enavelle-ink);
  color: var(--enavelle-white);
  background: var(--enavelle-ink);
  cursor: pointer;
}

.enavelle-catalog__toolbar a:hover,
.enavelle-catalog__toolbar a:focus-visible {
  border-color: var(--enavelle-ink);
}

.enavelle-catalog__layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.2fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(30px, 4vw, 70px);
}

.enavelle-catalog__filter-trigger {
  display: none;
}

.enavelle-catalog [data-enavelle-filter-drawer] {
  position: sticky;
  top: 24px;
  padding: 24px;
  border: 1px solid var(--enavelle-line);
  border-radius: var(--enavelle-radius);
  background: var(--enavelle-paper);
}

.enavelle-catalog__filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.enavelle-catalog__filter-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.enavelle-catalog__filter-heading button {
  display: none;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
}

.enavelle-catalog [data-enavelle-filter-drawer] ul {
  display: grid;
  gap: 4px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.enavelle-catalog__filter-label {
  margin: 22px 0 0;
  color: var(--enavelle-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.enavelle-catalog__filter-label + ul {
  margin-top: 8px;
}

.enavelle-catalog [data-enavelle-filter-drawer] a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
}

.enavelle-catalog [data-enavelle-filter-drawer] a:hover,
.enavelle-catalog [data-enavelle-filter-drawer] a[aria-current="page"] {
  background: var(--enavelle-white);
}

.enavelle-catalog__controls {
  min-height: 54px;
  margin-bottom: 28px;
}

.enavelle-catalog__controls::after {
  display: table;
  clear: both;
  content: "";
}

.enavelle-catalog__controls .woocommerce-result-count {
  margin: 14px 0;
  color: var(--enavelle-muted);
}

.enavelle-catalog__controls .woocommerce-ordering {
  margin: 0;
}

.enavelle-catalog__controls select {
  min-height: 44px;
  padding: 8px 40px 8px 14px;
  border: 1px solid var(--enavelle-line);
  border-radius: 999px;
  color: var(--enavelle-ink);
  background: var(--enavelle-white);
}

.woocommerce ul.products,
.enavelle-product-grid {
  float: none;
  display: grid;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: clamp(20px, 2.4vw, 38px);
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
  display: none;
}

.woocommerce ul.products li.product,
.enavelle-product-grid li.product {
  position: relative;
  float: none !important;
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0;
}

.woocommerce ul.products li.product .woocommerce-LoopProduct-link,
.enavelle-product-grid li.product .woocommerce-LoopProduct-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.enavelle-catalog-card__image {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--enavelle-radius);
  background: transparent;
  cursor: zoom-in;
}

.enavelle-catalog-card__image:focus-visible,
.enavelle-catalog-viewer button:focus-visible,
.enavelle-catalog-viewer a:focus-visible {
  outline: 3px solid var(--enavelle-clay);
  outline-offset: 3px;
}

.woocommerce ul.products li.product img,
.enavelle-product-grid li.product img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 18px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--enavelle-radius);
  background: var(--enavelle-paper);
  transition: transform 220ms ease;
}

.enavelle-catalog-card__image img {
  margin-bottom: 18px !important;
}

.woocommerce ul.products li.product:hover img,
.enavelle-product-grid li.product:hover img {
  transform: translateY(-2px);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.enavelle-product-grid li.product .woocommerce-loop-product__title {
  margin: 0;
  padding: 0;
  font-family: var(--enavelle-font-display);
  font-size: clamp(1.05rem, 1.4vw, 1.35rem);
  font-weight: 500;
  line-height: 1.28;
}

.woocommerce ul.products li.product .price,
.enavelle-product-grid li.product .price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  margin: 10px 0 0;
  color: var(--enavelle-ink);
  font-size: 1rem;
  font-weight: 750;
}

.woocommerce ul.products li.product .price del,
.enavelle-product-grid li.product .price del {
  color: var(--enavelle-muted);
  opacity: 0.72;
}

.woocommerce ul.products li.product .price ins,
.enavelle-product-grid li.product .price ins {
  color: var(--enavelle-clay);
  text-decoration: none;
}

.enavelle-product-card__meta {
  display: block;
  margin-top: 7px;
  color: var(--enavelle-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.enavelle-product-badge {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--enavelle-ink);
  background: var(--enavelle-white);
  font-size: 0.76rem;
  font-weight: 800;
}

.enavelle-product-badge--sale { background: var(--enavelle-rose); }
.enavelle-product-badge--restocked { background: var(--enavelle-sage); }
.enavelle-product-badge--new { color: var(--enavelle-white); background: var(--enavelle-clay); }

.woocommerce ul.products li.product .button,
.enavelle-product-grid li.product .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 10px 18px;
  border: 1px solid var(--enavelle-ink);
  border-radius: 999px;
  color: var(--enavelle-white);
  background: var(--enavelle-ink);
  font-weight: 750;
  text-decoration: none;
}

.woocommerce nav.woocommerce-pagination {
  margin-top: 48px;
}

.woocommerce nav.woocommerce-pagination ul {
  display: flex;
  justify-content: center;
  gap: 8px;
  border: 0;
}

.woocommerce nav.woocommerce-pagination ul li {
  float: none;
  border: 0;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--enavelle-line);
  border-radius: 50%;
}

.enavelle-catalog-viewer {
  width: min(1180px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: clamp(18px, 2vw, 30px);
  color: var(--enavelle-ink);
  background: var(--enavelle-white);
  box-shadow: 0 26px 80px rgba(20, 17, 14, 0.28);
}

.enavelle-catalog-viewer::backdrop { background: rgba(20, 17, 14, 0.64); }

.enavelle-catalog-viewer__content {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  min-height: min(720px, calc(100vh - 32px));
}

.enavelle-catalog-viewer__media {
  display: grid;
  min-height: 0;
  padding: clamp(18px, 3vw, 48px);
  place-items: center;
  background: var(--enavelle-paper);
}

.enavelle-catalog-viewer__media img {
  display: block;
  width: 100%;
  height: min(680px, calc(100vh - 96px));
  object-fit: contain;
}

.enavelle-catalog-viewer__details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 17px;
  padding: clamp(32px, 4vw, 68px);
}

.enavelle-catalog-viewer__details h2 {
  margin: 0;
  font-family: var(--enavelle-font-display);
  font-size: clamp(1.6rem, 2.5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.1;
}

.enavelle-catalog-viewer__price { font-size: 1.25rem; font-weight: 800; }
.enavelle-catalog-viewer__details a { color: inherit; font-weight: 750; }
.enavelle-catalog-viewer__details label { display: grid; gap: 8px; font-weight: 750; }
.enavelle-catalog-viewer__details input {
  width: 100px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--enavelle-line);
  border-radius: 10px;
  font: inherit;
}
.enavelle-catalog-viewer__details > button {
  min-height: 48px;
  border: 1px solid var(--enavelle-ink);
  border-radius: 999px;
  color: var(--enavelle-white);
  background: var(--enavelle-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.enavelle-catalog-viewer__details > button:disabled { cursor: not-allowed; opacity: 0.5; }
.enavelle-catalog-viewer__details [data-enavelle-viewer-status] { min-height: 1.4em; margin: 0; color: var(--enavelle-muted); }
.enavelle-catalog-viewer__close,
.enavelle-catalog-viewer__nav {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--enavelle-line);
  border-radius: 50%;
  color: var(--enavelle-ink);
  background: var(--enavelle-white);
  font-size: 1.4rem;
  cursor: pointer;
}
.enavelle-catalog-viewer__close { top: 16px; right: 16px; }
.enavelle-catalog-viewer__nav { top: 50%; transform: translateY(-50%); }
.enavelle-catalog-viewer__nav--previous { left: 16px; }
.enavelle-catalog-viewer__nav--next { right: 16px; }

@media (min-width: 1100px) {
  .woocommerce ul.products,
  .enavelle-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .enavelle-catalog__products--three ul.products,
  .enavelle-product-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 1080px;
    margin-inline: auto;
  }
}

@media (min-width: 768px) and (max-width: 1099px) {
  .enavelle-catalog__toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .woocommerce ul.products,
  .enavelle-product-grid,
  .enavelle-catalog__products--three ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .enavelle-catalog__shell {
    width: min(100% - 32px, 620px);
  }

  .enavelle-catalog__layout {
    display: block;
  }

  .enavelle-catalog__toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 10px;
  }

  .enavelle-catalog__toolbar input:first-of-type,
  .enavelle-catalog__toolbar select,
  .enavelle-catalog__toolbar button,
  .enavelle-catalog__toolbar a {
    grid-column: 1 / -1;
  }

  .enavelle-catalog-viewer { width: min(100vw - 20px, 700px); }
  .enavelle-catalog-viewer__content { grid-template-columns: 1fr; overflow-y: auto; }
  .enavelle-catalog-viewer__media img { height: min(56vh, 480px); }
  .enavelle-catalog-viewer__details { padding: 28px 32px 38px; }
  .enavelle-catalog-viewer__nav { top: min(28vh, 240px); }

  .enavelle-catalog__filter-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-bottom: 24px;
    padding: 8px 18px;
    border: 1px solid var(--enavelle-line);
    border-radius: 999px;
    background: var(--enavelle-white);
    font-weight: 750;
  }

  .enavelle-catalog [data-enavelle-filter-drawer] {
    position: fixed;
    z-index: 1002;
    inset: 0 0 0 auto;
    width: min(88vw, 380px);
    padding: 24px;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: var(--enavelle-white);
    visibility: hidden;
    transform: translateX(100%);
    pointer-events: none;
    transition: transform 180ms ease;
  }

  .enavelle-catalog [data-enavelle-filter-drawer][aria-hidden="false"] {
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
  }

  .enavelle-catalog__filter-heading button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .woocommerce ul.products,
  .enavelle-product-grid,
  .enavelle-catalog__products--three ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
  }

  .enavelle-product-grid--three > :last-child:nth-child(odd),
  .enavelle-catalog__products--three ul.products > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc(50% - 6px) !important;
    justify-self: center;
  }

  .enavelle-product-badge {
    top: 8px;
    left: 8px;
    min-height: 28px;
    padding: 4px 9px;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .woocommerce ul.products li.product img,
  .enavelle-product-grid li.product img,
  .enavelle-catalog [data-enavelle-filter-drawer] {
    transition: none;
  }
}
