/* Product cards 2.3: square, uncropped media and predictable content height. */
.product .product-media {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1/1;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #f5f7fa;
  text-decoration: none;
  line-height: 0;
  min-width: 0;
}
.product .product-media > img,
.product-detail .product .product-media > img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none;
  max-width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain !important;
  object-position: center;
  border-radius: 0;
  margin: 0;
}
.product .product-media .product-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #eef2f7;
  color: #92a1b3;
  font-size: 58px;
  line-height: 1;
}
.product {
  min-width: 0;
  overflow-wrap: anywhere;
  align-self: start;
  gap: 14px;
}
.product h3 {
  font-size: 19px;
  line-height: 1.4;
  margin: 0;
}
.product .product-tags:empty,
.product-description-empty {
  display: none;
}
.product .product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.product .product-tag {
  padding: 6px 10px;
  border: 1px solid #d3dff0;
  background: #f1f6ff;
  color: #254d86;
  font:
    500 12px/1.35 system-ui,
    sans-serif;
  border-radius: 999px;
  text-decoration: none;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.product .product-tag:hover {
  background: #e0ecff;
  border-color: #9db9e4;
}
.product .product-description-toggle {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: inherit;
  min-width: 0;
}
.product-description-toggle > summary {
  display: block;
  list-style: none;
  cursor: pointer;
  font-weight: 400;
  color: inherit;
  padding: 0;
  min-width: 0;
}
.product-description-toggle > summary::-webkit-details-marker {
  display: none;
}
.product-description-toggle .product-description-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.65;
  max-height: 4.95em;
  font-weight: 400;
  color: inherit;
}
.product-description-toggle .description-more,
.product-description-toggle .description-less {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 4px;
  font-size: 14px;
  color: #225dc8;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.product-description-toggle .description-less {
  display: none;
}
.product-description-toggle[open] .product-description-preview,
.product-description-toggle[open] .description-more {
  display: none;
}
.product-description-toggle[open] .description-less {
  display: inline-flex;
}
.product-description-full {
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.65;
}
.product-description-toggle.is-short > summary {
  display: none;
}
.product-description-toggle > summary:focus-visible {
  outline: 3px solid #8db2f3;
  outline-offset: 4px;
  border-radius: 6px;
}
.product .product-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 13px;
  margin-top: 0;
}
.product .product-share > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-width: 110px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #d3ddeb;
  border-radius: 9px;
  font:
    600 14px/1.3 system-ui,
    sans-serif;
  text-decoration: none;
}
.product .product-share > a > i {
  font-size: 20px;
}
.product .share-facebook {
  color: #1958ac;
  background: #f0f5ff;
}
.product .share-whatsapp {
  color: #146d3a;
  background: #effaf3;
}
.product .product-share > a:hover {
  filter: brightness(0.96);
}
.catalog-filters {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  margin: 24px 0 14px;
  padding: 18px;
  background: #f5f7fb;
  border: 1px solid #e1e7f0;
  border-radius: 12px;
}
.catalog-filters > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  min-width: 150px;
  margin: 0;
}
.catalog-filters input,
.catalog-filters select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  margin: 0;
  font: 15px system-ui;
  border: 1px solid #c8d4e3;
  border-radius: 8px;
  background: #fff;
  color: #20334d;
}
.catalog-filters button {
  min-height: 44px;
  margin: 0;
}
.catalog-reset {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 5px;
}
.catalog-empty {
  grid-column: 1/-1;
  padding: 32px;
  text-align: center;
  color: #52657b;
  background: #f6f8fc;
  border-radius: 12px;
}
#catalog-count {
  font-size: 14px;
  color: #53677f;
  margin: 0 0 18px;
}
.admin .product-category-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.admin .product-category-stack > label {
  margin: 0;
}
.admin .product-category-stack > button {
  align-self: flex-start;
}
.admin .product-tags-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 1/-1;
}
.admin .product-tags-preview:empty {
  display: none;
}
.admin .product-tags-preview > span {
  font-size: 13px;
  background: #eaf2ff;
  color: #27588c;
  padding: 6px 10px;
  border-radius: 999px;
}
.admin .product-list-tools {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: end;
  margin: 0 0 22px;
  padding: 18px;
  background: white;
  border: 1px solid var(--ui-border, #d5dfe9);
  border-radius: 12px;
}
.admin .product-list-tools > label {
  flex: 1;
  min-width: 180px;
  margin: 0;
}
.admin .product-list-tools > span {
  font-size: 14px;
  align-self: center;
  color: #52657b;
}
.admin .products-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 22px;
}
.admin .product .product-tag {
  min-height: 32px;
  font-size: 13px;
  padding: 6px 11px;
}
.admin .product .product-share a {
  font-size: 14px;
}
.product-detail .product .product-description-preview,
.product-detail .product .product-description-full {
  font-size: 16px;
}
@media (max-width: 640px) {
  .catalog-filters {
    padding: 14px;
    gap: 12px;
  }
  .catalog-filters > label {
    min-width: 100%;
    width: 100%;
  }
  .product .product-share > a {
    min-height: 44px;
  }
  .product .product-tag {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }
  .product {
    padding: 16px;
  }
  .catalog-reset {
    padding-left: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .product * {
    scroll-behavior: auto;
  }
}

/* Compact public catalogue; four or five columns chosen in the builder. */
.product-catalog-grid.columns {
  display: grid;
  grid-template-columns: repeat(var(--catalog-columns, 4), minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.product-catalog-grid .product {
  padding: 14px;
  gap: 12px;
}
.product-catalog-grid .product h3 {
  font-size: 16px;
}
.product .sale-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 76px;
  width: auto;
  max-width: calc(100% - 28px);
  height: auto;
  min-height: 76px;
  padding: 12px;
  border-radius: 18px;
  background: #c41438 !important;
  color: #fff !important;
  font-size: 17px;
  line-height: 1.15;
  font-weight: 800;
  box-shadow: 0 4px 14px #4b0a2340;
  z-index: 2;
}
.product .sale-badge small {
  color: #fff !important;
  opacity: 1 !important;
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.2;
  font-weight: 800;
}
.product-category-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid #d3dff0;
  border-radius: 10px;
  padding: 14px;
}
.product-category-checks label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #f4f7ff;
  border-radius: 8px;
}
.product-category-checks input[type="checkbox"] {
  width: 22px !important;
  height: 22px;
  min-height: 22px;
  margin: 0;
}
@media (max-width: 1000px) {
  .product-catalog-grid.columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .product-catalog-grid.columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-width: 460px) {
  .product-catalog-grid.columns {
    grid-template-columns: minmax(0, 1fr);
  }
}
