/*
 * Advertised coupons (Shopro\Coupons showcase): chip on product cards (journal3/products.twig), the "PAPILDOMAI −10 % su
 * kodu MINUS10" row with the price after the code in the buy box (product/product_shopro.twig), discounted cart lines
 * and the cart's one-click offer (checkout/cart.twig). Behaviour in js/shopro-coupons.js; loaded on every page by
 * journal3/event/header.php.
 */

.shp-coupon-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin: 2px 0 6px;
  padding: 3px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shp-coupon-chip .shp-coupon-chip-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* on a narrow card the text gives way, never the code */
.shp-coupon-chip b {
  flex-shrink: 0;
  color: #2563eb;
  font-weight: 800;
  letter-spacing: .02em;
}

/* buy box row */
#product-product #product > .pp-coupon { order: 11; }

.pp-coupon {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 12px 0 4px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f5f9ff;
  color: #1e3a8a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
}

.pp-coupon:hover { border-color: #93c5fd; }

.pp-coupon-code {
  padding: 3px 10px;
  border: 1px dashed #60a5fa;
  border-radius: 6px;
  background: #fff;
  color: #2563eb;
  font-weight: 800;
  letter-spacing: .04em;
}

.pp-coupon-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.pp-coupon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 2px solid #1e3a8a;
  border-radius: 6px;
  background: #fff;
  color: transparent;
  font-size: 14px;
  transition: background .15s, color .15s;
}

.pp-coupon-input:checked + .pp-coupon-box {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.pp-coupon-input:focus-visible + .pp-coupon-box { box-shadow: 0 0 0 3px rgba(37, 99, 235, .3); }

.pp-coupon-info {
  color: #64748b;
  font-size: 18px;
  line-height: 1;
}

/* price with the code while the row is ticked: the regular price steps back */
#product-product #product .price-group .product-price-coupon {
  color: var(--pp-danger, #dc2626);
  font-size: clamp(30px, 1.4vw + 18px, 38px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}

#product-product #product .product-price-group.has-coupon .price-group { flex-wrap: wrap; }
#product-product #product .product-price-group.has-coupon .product-price-coupon { order: -1; }
#product-product #product .product-price-group.has-coupon .product-price,
#product-product #product .product-price-group.has-coupon .product-price-new {
  color: var(--pp-muted, #64748b);
  font-size: 18px;
  font-weight: 500;
  text-decoration: line-through;
}
#product-product #product .product-price-group.has-coupon .product-price-old { display: none; }

/* cart */
.cart-line-coupon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
  font-weight: 600;
}

.cart-line .td-total .cart-line-was { display: block; color: #94a3b8; font-size: 13px; font-weight: 500; }
.cart-line .td-total .cart-line-now { color: #dc2626; font-weight: 700; }

.cart-coupon-offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px dashed #60a5fa;
  border-radius: 10px;
  background: #f5f9ff;
  color: #1e3a8a;
  font-weight: 600;
  line-height: 1.35;
}

.cart-coupon-offer .btn { flex-shrink: 0; }
