/* Card Wrapper styling to prevent stretching */
.pld-product-card-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 1.5rem 0;
  box-sizing: border-box;
}

/* Card Container */
.pld-product-card {
  background: #fff;
  border-radius: 0;
  box-shadow: 0 4px 20px hsla(0, 0%, 0%, 0.1);
  padding: 12px;
  width: 100%;
  max-width: 320px;
  font-family: inherit;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Title styling */
.pld-product-card-title {
  color: #84a835;
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 10px 0;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.7em;
  max-height: 2.7em;
}

.pld-product-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pld-product-card-title a:hover {
  color: #6a8829;
}

/* Image Container */
.pld-product-card-image-container {
  position: relative;
  border: 2px solid hsla(79, 52%, 43%, 0.2);
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 15px;
}

.pld-product-card-image {
  width: 100%;
  height: auto;
  display: block;
  border: 0 !important;
  margin-top: 0 !important;
}

/* Price Badge */
.pld-product-card-price-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: #fff;
  border: 2px solid #84a835;
  border-radius: 6px;
  padding: 4px 10px;
  font-weight: 600;
  font-size: 1.4rem;
  color: #84a835;
  box-shadow: 0 2px 8px rgba(132, 168, 53, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Action Form & Row */
.pld-product-card-form {
  margin: 0;
  margin-top: auto;
}

.pld-product-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

/* Quantity Selector */
.woocommerce .pld-qty-selector.quantity,
.woocommerce-page .pld-qty-selector.quantity,
.pld-qty-selector.quantity {
  display: flex !important;
  align-items: center !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  height: 40px !important;
  background: #fff !important;
  width: 80px !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  float: none !important;
  box-sizing: border-box !important;
}

.pld-qty-btn {
  border: none;
  background: transparent;
  width: 24px;
  height: 100%;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  user-select: none;
  padding: 0;
  margin: 0;
}

.pld-qty-btn i {
  font-size: 11px;
  color: inherit;
}

.pld-qty-btn:hover {
  background: #f1f5f9;
}

.pld-qty-input {
  border: none;
  width: 32px;
  height: 100%;
  text-align: center;
  font-size: 14px !important;
  font-weight: 400;
  color: #1e293b;
  padding: 0;
  background: transparent;
  -moz-appearance: textfield;
}

.pld-qty-input::-webkit-outer-spin-button,
.pld-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Disabled Quantity Selector for Subscriptions */
.pld-qty-selector.pld-qty-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background: #f8fafc !important;
}

.pld-qty-selector.pld-qty-disabled button,
.pld-qty-selector.pld-qty-disabled input {
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: 0.6;
}

/* Add to Cart Button */
.woocommerce .pld-add-to-cart-btn,
.woocommerce-page .pld-add-to-cart-btn,
.pld-add-to-cart-btn,
.pld-add-to-cart-btn:focus,
.pld-add-to-cart-btn:active,
.pld-add-to-cart-btn:visited,
.pld-add-to-cart-btn.loading,
.pld-add-to-cart-btn.added,
.pld-add-to-cart-btn.update,
.pld-add-to-cart-btn:disabled,
.pld-add-to-cart-btn.disabled {
  flex-grow: 1;
  height: 40px !important;
  min-height: 40px !important;
  line-height: 40px !important;
  background-color: #84a835 !important;
  color: #fff !important;
  border: 0 !important;
  outline: none !important;
  border-radius: 0 !important;
  font-weight: 600 !important;
  font-size: 16px !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 12px !important;
  text-shadow: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

.pld-add-to-cart-btn:hover {
  background-color: #72922c !important;
}

.pld-add-to-cart-btn.added,
.pld-add-to-cart-btn.update,
.pld-add-to-cart-btn:disabled,
.pld-add-to-cart-btn.disabled {
  opacity: 0.85 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.pld-add-to-cart-btn.loading {
  position: relative;
  color: transparent !important;
  cursor: not-allowed;
}

.pld-add-to-cart-btn.loading::before {
  content: none !important;
  display: none !important;
}

.pld-add-to-cart-btn.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-top: -9px;
  margin-left: -9px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: pld-spin 0.6s linear infinite;
}

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

/* Info Button */
.pld-info-btn {
  width: 40px;
  height: 40px;
  background-color: #84a835;
  color: #fff;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}

.pld-info-btn:hover {
  background-color: #72922c;
  color: #fff;
}

.pld-info-btn svg,
.pld-info-btn img {
  display: block;
  width: 22px !important;
  height: 22px !important;
}

/* Admin editor specific styles */
.admin-preview .pld-product-card-wrapper {
  margin: 0;
}

.admin-preview .pld-qty-selector {
  pointer-events: none;
  display: flex !important;
  align-items: center !important;
  background: #fff !important;
  box-sizing: border-box !important;
  width: 80px !important;
  flex-shrink: 0 !important;
}

.admin-preview .pld-qty-btn {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  height: 100% !important;
  width: 24px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #334155 !important;
  font-size: 14px !important;
  line-height: 1 !important;
  min-width: 0 !important;
}

.admin-preview .pld-qty-input {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  height: 100% !important;
  width: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: center !important;
  font-size: 14px !important;
  line-height: normal !important;
  min-height: 0 !important;
  min-width: 0 !important;
}

.admin-preview .pld-add-to-cart-btn {
  pointer-events: none;
}

.admin-preview .pld-info-btn {
  pointer-events: none;
}

/* Responsive styles for extra-small screens (0px to 370px) */
@media (max-width: 370px) {
  .pld-product-card-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .woocommerce .pld-qty-selector.quantity,
  .woocommerce-page .pld-qty-selector.quantity,
  .pld-qty-selector.quantity {
    width: 50% !important;
    margin: 0 !important;
    float: none !important;
    justify-content: center !important;
  }

  .pld-add-to-cart-btn {
    flex-grow: 1;
  }
}

/* Bundle items list styling */
.pld-bundle-items-list {
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 12px;
  text-align: left;
}

.pld-bundle-items-title {
  margin: 0 0 6px 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pld-bundle-items-ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pld-bundle-item-li {
  display: flex;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #334155;
  margin-bottom: 4px;
}

.pld-bundle-item-li:last-child {
  margin-bottom: 0;
}

.pld-bundle-item-qty {
  font-weight: 600;
  color: #84a835;
  margin-right: 6px;
  flex-shrink: 0;
}

.pld-bundle-item-name {
  overflow-wrap: break-word;
}

/* Sale / Discounted Ribbon */
.pld-product-card-image-container span.ribben_discounted {
  position: absolute;
  top: 14px;
  right: -35px;
  width: 127px;
  background-color: #c1272d !important;
  color: #fff !important;
  padding: 4px 0;
  font-weight: 700;
  font-size: 11px;
  transform: rotate(45deg);
  text-align: center;
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Strand Borders & Colors */

.pld-product-card-image-container img,
.pld-product-card-image {
  border: 0 !important;
}

.pld-product-card.pld-strand-movement .pld-product-card-image-container,
.pld-product-card-image-container.pld-strand-movement {
  border: 2px solid rgba(193, 39, 45, 0.2) !important;
}

.pld-product-card.pld-strand-movement .pld-product-card-title,
.pld-product-card.pld-strand-movement .pld-product-card-title a {
  color: #c1272d !important;
}

.pld-product-card.pld-strand-oral .pld-product-card-image-container,
.pld-product-card-image-container.pld-strand-oral {
  border: 2px solid rgba(0, 137, 233, 0.2) !important;
}

.pld-product-card.pld-strand-oral .pld-product-card-title,
.pld-product-card.pld-strand-oral .pld-product-card-title a {
  color: #0089e9 !important;
}

.pld-product-card.pld-strand-literacy .pld-product-card-image-container,
.pld-product-card-image-container.pld-strand-literacy {
  border: 2px solid rgba(132, 168, 53, 0.2) !important;
}

.pld-product-card.pld-strand-literacy .pld-product-card-title,
.pld-product-card.pld-strand-literacy .pld-product-card-title a {
  color: #84a835 !important;
}

/* Price formatting del / ins */
.pld-price-amount del,
.pld-price-amount ins,
.pld-price-amount .woocommerce-Price-amount {
  color: inherit !important;
}

.pld-price-amount del {
  text-decoration: line-through;
  font-weight: 400;
  margin-right: 6px;
  opacity: 0.9;
}

.pld-price-amount ins {
  text-decoration: none;
  font-weight: 700;
}
