/* Tarjeta comercial compartida por todos los loops de productos. */

.product-grid,
.custom-products-grid,
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 30px 18px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0;
  padding-right: 0;
  list-style: none;
}

.custom-products-grid {
  width: min(calc(100% - 48px), 1456px) !important;
  margin-top: 28px !important;
  margin-bottom: 36px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.woocommerce.archive ul.products,
body.post-type-archive-product ul.products,
body.tax-product_cat ul.products,
body.tax-product_tag ul.products {
  width: min(calc(100% - 48px), 1456px) !important;
  margin-top: 28px !important;
  margin-bottom: 36px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.product-grid::before,
.product-grid::after,
.custom-products-grid::before,
.custom-products-grid::after,
.woocommerce ul.products::before,
.woocommerce ul.products::after {
  display: none !important;
  content: none !important;
}

.home-section__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px 0;
  color: #666;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 14px;
}

.product-grid .product-card,
.custom-products-grid .product-card,
.woocommerce ul.products li.product.product-card {
  width: 100% !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  border: 1px solid #e4e0da;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  list-style: none;
  display: flex;
  flex-direction: column;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.product-grid .product-card:hover,
.custom-products-grid .product-card:hover,
.woocommerce ul.products li.product.product-card:hover {
  border-color: #cec7bd;
  box-shadow: 0 10px 28px rgba(45, 38, 31, 0.08);
  transform: translateY(-2px);
}

.product-card__media {
  position: relative;
}

.product-card__image {
  display: block !important;
  aspect-ratio: 0.82 / 1 !important;
  overflow: hidden;
  background: #e6e6e6;
  text-decoration: none;
}

.woocommerce ul.products li.product.product-card .product-card__image img,
.product-card__image img {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  display: block !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: transform 0.35s ease;
}

.product-card:hover .product-card__image img {
  transform: scale(1.025);
}

.product-card__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 24px);
  pointer-events: none;
}

.product-card__badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.product-card__badge--bestseller {
  background: #252525;
  color: #fff;
}

.product-card__badge--new {
  background: #65715b;
  color: #fff;
}

.product-card__badge--sale {
  background: #fff;
  color: #252525;
}

.product-card__content {
  padding: 14px 15px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card__content h3 {
  margin: 0 0 8px !important;
  padding: 0 !important;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
  min-height: 2.4em;
}

.product-card__content h3 a {
  color: #232323;
  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.035em;
  text-decoration: none;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card__content p {
  margin: 0 0 12px !important;
  color: #666;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sp-related ul.products li.product.product-card .product-card__content p {
  margin: 0 0 12px !important;
  color: #666 !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
}

.product-card__price,
.product-card__price .price,
.woocommerce ul.products li.product.product-card .product-card__price {
  display: block;
  color: #232323 !important;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 20px !important;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.product-card__price--locked,
.product-card__price--locked a {
  color: #666 !important;
  font-size: 14px !important;
  text-decoration: none;
}

.product-card__price del {
  margin-right: 5px;
  opacity: 0.55;
}

.product-card__price ins {
  text-decoration: none;
}

.product-card__stock {
  margin-top: 8px;
  color: #527044;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.product-card__stock::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

.product-card__stock.is-out {
  color: #9b4b43;
}

.product-card__actions {
  margin-top: auto;
  padding-top: 14px;
}

.woocommerce ul.products li.product.product-card .product-card__button,
.product-card__button,
.sp-related ul.products li.product .product-card__button.add_to_cart_button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0 !important;
  padding: 0 17px !important;
  border: 1px solid #252525 !important;
  border-radius: 999px !important;
  background: #252525 !important;
  color: #fff !important;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  width: 100%;
}

.product-card__button:hover {
  background: #000 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.woocommerce ul.products li.product.product-card .product-card__button--secondary,
.product-card__button--secondary {
  background: transparent !important;
  color: #252525 !important;
}

.woocommerce ul.products li.product.product-card .product-card__button--secondary:hover,
.product-card__button--secondary:hover {
  background: #252525 !important;
  color: #fff !important;
}

.woocommerce ul.products li.product.product-card .onsale,
.woocommerce ul.products li.product.product-card .star-rating,
.woocommerce ul.products li.product.product-card > .button,
.woocommerce ul.products li.product.product-card > .added_to_cart {
  display: none !important;
}

body.basket-infinite-scroll-active nav.woocommerce-pagination,
body.basket-infinite-scroll-active .woocommerce-pagination {
  display: none !important;
}

.basket-infinite-scroll {
  width: min(calc(100% - 48px), 1456px);
  min-height: 72px;
  margin: 10px auto 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  text-align: center;
}

.basket-infinite-scroll__loader {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.basket-infinite-scroll__loader::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #ddd7cf;
  border-top-color: #3c3935;
  border-radius: 50%;
  animation: basket-card-spin 0.75s linear infinite;
}

@keyframes basket-card-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 991px) {
  .product-grid,
  .custom-products-grid,
  .woocommerce ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .product-grid,
  .custom-products-grid,
  .woocommerce ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px 12px !important;
  }

  .custom-products-grid {
    width: calc(100% - 24px) !important;
    margin-top: 18px !important;
  }

  body.woocommerce.archive ul.products,
  body.post-type-archive-product ul.products,
  body.tax-product_cat ul.products,
  body.tax-product_tag ul.products {
    width: calc(100% - 24px) !important;
    margin-top: 18px !important;
  }

  .product-card__badges {
    top: 8px;
    left: 8px;
    gap: 4px;
    max-width: calc(100% - 16px);
  }

  .product-card__badge {
    min-height: 23px;
    padding: 0 7px;
    font-size: 9px;
  }

  .product-card__content {
    padding: 10px 10px 12px;
  }

  .product-card__content h3 {
    margin-bottom: 5px !important;
    min-height: 2.3em;
  }

  .product-card__content h3 a {
    font-size: 16px;
    letter-spacing: -0.03em;
  }

  .product-card__content p {
    display: none;
  }

  .sp-related ul.products li.product.product-card .product-card__content p {
    display: none !important;
  }

  .product-card__price,
  .product-card__price .price,
  .woocommerce ul.products li.product.product-card .product-card__price {
    font-size: 16px !important;
    line-height: 1.25;
  }

  .product-card__price--locked,
  .product-card__price--locked a {
    font-size: 11px !important;
  }

  .product-card__stock {
    margin-top: 6px;
    font-size: 10px;
  }

  .product-card__actions {
    margin-top: auto;
    padding-top: 10px;
  }

  .woocommerce ul.products li.product.product-card .product-card__button,
  .product-card__button,
  .sp-related ul.products li.product .product-card__button.add_to_cart_button {
    width: 100%;
    min-height: 36px;
    padding: 0 8px !important;
    font-size: 10px !important;
  }

  .basket-infinite-scroll {
    width: calc(100% - 24px);
    min-height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card__image img,
  .product-card__button {
    transition: none !important;
  }

  .product-card:hover {
    transform: none !important;
  }
}


/* ===== Basket Product Cards 1.6.2 ===== */
.product-grid .product-card,
.custom-products-grid .product-card,
.woocommerce ul.products li.product.product-card {
  border-color: #e7e4df;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(35,31,27,.02);
}
.product-grid .product-card:hover,
.custom-products-grid .product-card:hover,
.woocommerce ul.products li.product.product-card:hover {
  border-color: #d8d2ca;
  box-shadow: 0 12px 30px rgba(45,38,31,.09);
}
.product-card__image { background:#f1efec; }
.product-card__badges { top:11px; left:11px; gap:5px; }
.product-card__badge { min-height:29px; border-radius:7px; padding:0 10px; font-size:10px; font-weight:700; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.product-card__badge--bestseller { background:#ff6a00; color:#fff; }
.product-card__badge--new { background:#149b2f; color:#fff; }
.product-card__badge--sale { background:#ff3b30; color:#fff; }
.product-card__content { padding:13px 14px 14px; }
.product-card__content h3 { min-height:auto; margin-bottom:5px!important; }
.product-card__content h3 a { font-size:16px; font-weight:600; line-height:1.22; letter-spacing:-.028em; }
.product-card__content p { font-size:13px; line-height:1.35; margin-bottom:8px!important; -webkit-line-clamp:1; color:#66707a; }
.product-card__price,.product-card__price .price,.woocommerce ul.products li.product.product-card .product-card__price { font-size:20px!important; font-weight:600; color:#151515!important; }
.product-card__installments { margin:8px 0 0; padding:9px 10px; border-radius:9px; background:#f5f7f3; font-family:"IBM Plex Sans",sans-serif; line-height:1.2; }
.product-card__installment-label { display:block; color:#272d28; font-size:12px; }
.product-card__installment-amount { display:block; margin-top:2px; color:#244f25; font-size:15px; font-weight:700; white-space:nowrap; }
.product-card__installment-alt { display:block; margin-top:4px; color:#747b75; font-size:11px; }
.product-card__shipping-promises { display:grid; gap:5px; margin-top:8px; }
.product-card__shipping-promise { display:flex; align-items:center; gap:7px; min-height:34px; padding:7px 9px; border-radius:8px; font-family:"IBM Plex Sans",sans-serif; font-size:11px; font-weight:500; }
.product-card__shipping-promise svg { width:16px; height:16px; flex:0 0 16px; }
.product-card__shipping-promise--flex { background:#e6f6e7; color:#225d27; }
.product-card__shipping-promise--flet { background:#eef3ee; color:#2e5031; }
.product-card__actions { padding-top:10px; }
.woocommerce ul.products li.product.product-card .product-card__button,
.product-card__button,
.sp-related ul.products li.product .product-card__button.add_to_cart_button { min-height:45px; border-radius:9px!important; font-size:13px!important; font-weight:600!important; gap:8px; }
.product-card__button-icon { width:19px; height:19px; flex:0 0 19px; }
@media(max-width:640px){
  .product-card__content{padding:10px 10px 11px}
  .product-card__content h3 a{font-size:14px}
  .product-card__price,.product-card__price .price,.woocommerce ul.products li.product.product-card .product-card__price{font-size:17px!important}
  .product-card__installments{padding:8px}
  .product-card__installment-label{font-size:11px}.product-card__installment-amount{font-size:13px}.product-card__installment-alt{font-size:10px}
  .product-card__shipping-promise{font-size:10px;padding:6px 8px;min-height:31px}
  .woocommerce ul.products li.product.product-card .product-card__button,.product-card__button{min-height:40px;font-size:11px!important}
}

/* ===== Basket Product Cards 1.6.5 — restore original catalog image proportion ===== */
/* Keep the wider product image used before the 1.6.3 regression. */
.product-grid .product-card .product-card__image,
.custom-products-grid .product-card .product-card__image,
.woocommerce ul.products li.product.product-card .product-card__image {
  aspect-ratio: 1 / .78 !important;
}

@media (max-width: 640px) {
  .product-grid .product-card .product-card__image,
  .custom-products-grid .product-card .product-card__image,
  .woocommerce ul.products li.product.product-card .product-card__image {
    aspect-ratio: 1 / .92 !important;
  }
}


/* ===== Basket Product Cards 1.6.6 — taller image container ===== */
/* Restore a portrait-oriented media area so vertical product photos are not aggressively cropped. */
.product-grid .product-card .product-card__image,
.custom-products-grid .product-card .product-card__image,
.woocommerce ul.products li.product.product-card .product-card__image {
  aspect-ratio: 4 / 5 !important;
  min-height: 0;
}

.product-grid .product-card .product-card__image img,
.custom-products-grid .product-card .product-card__image img,
.woocommerce ul.products li.product.product-card .product-card__image img {
  object-position: center center !important;
}

@media (max-width: 640px) {
  .product-grid .product-card .product-card__image,
  .custom-products-grid .product-card .product-card__image,
  .woocommerce ul.products li.product.product-card .product-card__image {
    aspect-ratio: 4 / 5 !important;
  }
}
