/**
 * PLD Product Card (Ads layout).
 * Inherits landing-page vars when present, with standalone fallbacks.
 */

.pld-product-card-ads {
  /* Standalone defaults (V3 landing palette). Without these every var() below
     is invalid at computed-value time, so a card outside .pld-ads-v2 loses its
     border, palette and button fills entirely. .pld-ads-v2 overrides the three
     colour tokens with the V2 palette (see css/ads-landing.css). */
  --pca-navy: #1d4e79;
  --pca-blue: #3f8ed6;
  --pca-blue-dark: #2f76ba;
  --pca-soft: #eef4fb;
  --pca-border: #dbe6f2;

  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--pca-border);
  border-radius: 10px;
  padding: 16px;
  height: 100%;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  box-shadow: rgba(0, 0, 0, 0.05) 0 0 7px 0;
}

/* Safety net: only a card placed OUTSIDE the 2-col grid (a direct child of a
   column) is capped, so a stray card can't stretch full width and blow up.
   Cards inside .ads-product-grid keep filling their 50% cell. */
.pld-ads-landing .wp-block-column > .pld-product-card-ads {
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* Title */
.pld-product-card-ads .pld-pca-title {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--pca-navy);
  min-height: 4em;
}

.pld-product-card-ads .pld-pca-title a {
  color: inherit;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.pld-product-card-ads .pld-pca-title a:hover {
  color: var(--pca-blue);
  text-decoration: underline;
}

/* Image + Read More overlay */
.pld-product-card-ads .pld-pca-image {
  position: relative;
  background: var(--pca-soft);
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.pld-product-card-ads .pld-pca-image picture {
  width: 100%;
  height: 100%;
}
.pld-product-card-ads .pld-pca-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  box-sizing: border-box;
  display: block;
  border: 1.5px solid rgba(229, 229, 229, 1);
}
.pld-product-card-ads .pld-pca-image:hover {
  background-color: rgba(0, 155, 217, 0.2);
}

.pld-product-card-ads .pld-pca-readmore {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(6px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--pca-blue);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    background 0.2s ease;
  box-shadow: 0 4px 12px rgba(15, 63, 106, 0.25);
  white-space: nowrap;
}

.pld-product-card-ads .pld-pca-image:hover .pld-pca-readmore {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  font-size: 18px;
}

.pld-product-card-ads .pld-pca-readmore:hover {
  background: var(--pca-blue-dark);
}

/* Price row */
.pld-product-card-ads .pld-pca-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}

.pld-product-card-ads .pld-pca-amount {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--pca-blue);
  line-height: 1.2;
}

.pld-product-card-ads .pld-pca-gst {
  display: block;
  font-size: 16px;
  color: rgba(33, 37, 41, 0.4);
  margin-top: 2px;
}

.pld-product-card-ads .pld-pca-preview {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 18px;
  font-weight: 600;
  color: var(--pca-blue);
  text-decoration: none;
  white-space: nowrap;
  margin-top: 2px;
}

.pld-product-card-ads .pld-pca-preview:hover {
  color: var(--pca-blue-dark);
}

.pld-product-card-ads .pld-pca-preview-icon {
  display: inline-flex;
}

/* Actions row: qty + quote */
.pld-product-card-ads .pld-pca-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
}

.pld-product-card-ads .pld-pca-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--pca-border);
  border-radius: 6px;
  overflow: hidden;
  height: 48px;
  flex: 0 0 auto;
}

.pld-product-card-ads .pld-pca-qty-btn {
  width: 34px;
  height: 100%;
  border: none;
  background: #fff;
  color: var(--pca-navy);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.pld-product-card-ads .pld-pca-qty-btn:hover {
  background: var(--pca-soft);
}

.pld-product-card-ads .pld-pca-qty-input {
  width: 38px;
  height: 100%;
  border: none;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--pca-navy);
  background: #fff;
  -moz-appearance: textfield;
  padding: 0;
}

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

/* Add to Quote (YITH) rendered as an outline button */
.pld-product-card-ads .pld-pca-quote {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
}

.pld-product-card-ads .pld-pca-quote .yith-ywraq-add-to-quote,
.pld-product-card-ads .pld-pca-quote .yith-ywraq-add-button {
  width: 100%;
  margin: 0;
}

.pld-product-card-ads .pld-pca-quote a {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 12px 16px !important;
  margin: 0 !important;
  background: var(--pca-blue, #009bd9) !important;
  color: #fff !important;
  font-family:
    'Century Gothic W01',
    Roboto,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 20px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  -webkit-font-smoothing: antialiased !important;
  text-decoration: none;
  border: none !important;
  border-radius: 4px;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.pld-product-card-ads .pld-pca-quote a:hover {
  background: var(--pca-blue-dark, #0089c4) !important;
  color: #fff !important;
}

.pld-product-card-ads .pld-pca-quote .clear {
  display: none;
}

/* Hide YITH's inline loader image; the card shows its own button spinner
   (.pca-quote-loading) while the quote request runs. */
.pld-product-card-ads .ywraq-loader {
  display: none !important;
}

/* Add to Cart (full width, filled) */
.pld-product-card-ads .pld-pca-cart {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 4px;
  background: var(--pca-blue, #009bd9) !important;
  color: #fff !important;
  font-family:
    'Century Gothic W01',
    Roboto,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 20px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  -webkit-font-smoothing: antialiased !important;
  cursor: pointer;
  transition: background 0.2s ease;
  margin: 10px 0 0 0;
}

.pld-product-card-ads .pld-pca-cart:hover {
  background: var(--pca-blue-dark) !important;
}

.pld-product-card-ads .pld-pca-cart.added,
.pld-product-card-ads .pld-pca-cart[disabled] {
  background: var(--pca-blue-dark) !important;
  cursor: not-allowed;
  opacity: 1;
}

.pld-product-card-ads .pld-pca-error {
  color: #b23a3a;
  font-size: 13px;
}

@media (max-width: 480px) {
  .pld-product-card-ads .pld-pca-actions {
    flex-wrap: wrap;
  }
  .pld-product-card-ads .pld-pca-quote a {
    height: 48px;
  }
}
