/* ==========================================================================
   OstuGrupp — conversion boosters
   Free-shipping progress bar · stock urgency · delivery estimate · cross-sell.
   Uses the design tokens from main.css (slate + green, radius, shadows, fonts).
   ========================================================================== */

/* ==========================================================================
   (1) Free-shipping progress bar
   ========================================================================== */
.ostu-ship {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
}
.ostu-ship.is-reached {
  background: rgba(5, 150, 105, .07);
  border-color: rgba(5, 150, 105, .35);
}

.ostu-ship__msg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 10px;
  line-height: 1.4;
}
/* Holds the theme's stroke SVG now, not a 🚚 / ✓ glyph in the OS font. */
.ostu-ship__icon { display: inline-flex; align-items: center; justify-content: center; line-height: 1; flex: 0 0 auto; color: var(--green); }
.ostu-ship__icon svg { display: block; width: 18px; height: 18px; }
.ostu-ship.is-reached .ostu-ship__icon {
  color: #fff;
  background: var(--green);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.ostu-ship.is-reached .ostu-ship__text { color: var(--green-dark); }
.ostu-ship__text strong { color: var(--slate-dark); font-variant-numeric: tabular-nums; }
.ostu-ship__text .woocommerce-Price-amount { font-weight: 700; }

.ostu-ship__track {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.ostu-ship__fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-dark) 100%);
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}
/* Animated sheen sweeping along the fill. */
.ostu-ship__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .45) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: ostu-ship-sheen 1.8s ease-in-out infinite;
}
.ostu-ship.is-reached .ostu-ship__fill::after { animation: none; }
@keyframes ostu-ship-sheen {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* Cart-page variant: a touch larger and spaced below. */
.ostu-ship-wrap { margin-bottom: 22px; }
.ostu-ship--cart { padding: 16px 18px; }
.ostu-ship--cart .ostu-ship__msg { font-size: 15px; }

/* Mini-cart variant: snug inside the dropdown, sits above the actions. */
.ostu-ship--mini {
  border: 0;
  box-shadow: none;
  border-radius: var(--radius);
  background: var(--muted);
  padding: 12px;
  margin: 4px 10px 2px;
}
.ostu-ship--mini.is-reached { background: rgba(5, 150, 105, .1); }
.ostu-ship--mini .ostu-ship__msg { font-size: 13px; margin-bottom: 8px; }
.ostu-ship--mini .ostu-ship__icon svg { width: 15px; height: 15px; }

/* ==========================================================================
   (2) Stock urgency (single product)
   ========================================================================== */
.ostu-urgency {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0 2px;
  padding: 9px 14px;
  border-radius: var(--radius);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.ostu-urgency__pulse {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ea580c;
  box-shadow: 0 0 0 0 rgba(234, 88, 12, .55);
  animation: ostu-urgency-pulse 1.6s ease-out infinite;
}
@keyframes ostu-urgency-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(234, 88, 12, .55); }
  70%  { box-shadow: 0 0 0 8px rgba(234, 88, 12, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}

/* ==========================================================================
   (3) Estimated delivery (single product)
   ========================================================================== */
.ostu-delivery {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--muted);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
  line-height: 1.4;
}
.ostu-delivery__icon { display: inline-flex; align-items: center; color: var(--slate-500); line-height: 1; flex: 0 0 auto; }
.ostu-delivery__icon svg { width: 18px; height: 18px; }
.ostu-delivery__text { color: var(--slate-dark); }

/* ==========================================================================
   (4) "Osta koos" cross-sell (cart page)
   ========================================================================== */
.ostu-crosssell { margin-top: 32px; }
.ostu-crosssell__title { font-size: 22px; margin-bottom: 18px; }
.ostu-crosssell__title .eyebrow { display: block; margin-bottom: 6px; }

.ostu-crosssell__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 560px) { .ostu-crosssell__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) { .ostu-crosssell__grid { grid-template-columns: repeat(3, 1fr); } }

.ostu-cs-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 12px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ostu-cs-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(5, 150, 105, .3);
}
.ostu-cs-card__media {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ostu-cs-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}
.ostu-cs-card__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.ostu-cs-card__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ostu-cs-card__name:hover { color: var(--green); }
.ostu-cs-card__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-dark);
  font-variant-numeric: tabular-nums;
}
.ostu-cs-card__price del { color: var(--slate-500); font-weight: 500; font-size: 13px; opacity: .7; margin-right: 5px; }
.ostu-cs-card__price ins { text-decoration: none; color: var(--green-dark); }

.ostu-cs-card .ostu-cs-card__add,
.ostu-cs-card a.ostu-cs-card__add.button {
  align-self: flex-start;
  margin-top: 3px;
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  min-height: 0;
  line-height: 1.2;
  transition: background .2s, transform .2s;
}
.ostu-cs-card .ostu-cs-card__add:hover { background: var(--green-dark); transform: translateY(-1px); }
.ostu-cs-card .ostu-cs-card__add.added { display: none; }
.ostu-cs-card .ostu-cs-card__add.loading { opacity: .75; }

/* Touch: give the small cross-sell "Lisa" button a finger-friendly height on
   phones/tablets without bloating it on desktop. */
@media (max-width: 1023.98px) {
  .ostu-cs-card .ostu-cs-card__add,
  .ostu-cs-card a.ostu-cs-card__add.button { min-height: 40px; padding: 9px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ostu-ship__fill,
  .ostu-ship__fill::after,
  .ostu-urgency__pulse { animation: none; transition: none; }
  .ostu-cs-card { transition: none; }
}
