/* Woda Upselling — frontend styles */

/* ── Slot wrapper ──────────────────────────────────────────────────────────── */

.woda-upselling-slot {
  position: relative;
  margin: 8px 0;
}

.woda-upselling-slot.woda-upselling-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ── Placeholder ───────────────────────────────────────────────────────────── */

.woda-upselling-slot-placeholder {
  display: none; /* Hidden until JS fills it */
}

/* ── Slot inner content helpers ────────────────────────────────────────────── */

.woda-upselling-slot .woda-upselling-slot-inner {
  background: #f0f6fc;
  border: 2px dashed #2271b1;
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 13px;
  color: #1d2327;
}

.woda-upselling-slot .woda-upselling-slot-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  color: #1d2327;
}

.woda-upselling-slot .woda-upselling-slot-desc {
  font-size: 13px;
  color: #50575e;
  margin-bottom: 10px;
}

.woda-upselling-slot .woda-upselling-slot-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── CTA Buttons ───────────────────────────────────────────────────────────── */

.woda-upselling-btn-primary {
  display: inline-block;
  background: var(--primary, #1a2d60);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
  text-decoration: none;
}
.woda-upselling-btn-primary:hover {
  filter: brightness(1.1);
  color: #fff;
}
.woda-upselling-btn-secondary {
  display: inline-block;
  background: #fff;
  color: var(--primary, #1a2d60);
  border: 1px solid var(--primary, #1a2d60);
  padding: 11px 21px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
  text-decoration: none;
}
.woda-upselling-btn-secondary:hover {
  background: #f3f4f6;
  color: var(--primary, #1a2d60);
}

.woda-upselling-btn-dismiss {
  background: none;
  border: none;
  color: #8c8f94;
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  font-family: inherit;
}

.woda-upselling-btn-dismiss:hover {
  color: #646970;
  text-decoration: underline;
}

/* ── Toast notifications ───────────────────────────────────────────────────── */

.woda-upselling-toast-container {
  position: fixed;
  top: 50px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.woda-upselling-toast {
  padding: 10px 16px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-width: 220px;
  max-width: 320px;
  animation: woda-slide-in 0.25s ease-out;
  pointer-events: auto;
}

.woda-upselling-toast-success {
  background: #edfaef;
  border-left: 4px solid #00a32a;
  color: #1d2327;
}

.woda-upselling-toast-error {
  background: #fef0f0;
  border-left: 4px solid #b32d2e;
  color: #1d2327;
}

.woda-upselling-toast-hiding {
  animation: woda-slide-out 0.25s ease-in forwards;
}

.woda-capacity-tooltip {
  position: absolute;
  z-index: 100000;
  max-width: 260px;
  padding: 8px 12px;
  background: #1d2327;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease-out, visibility 0.15s ease-out;
}

.woda-capacity-tooltip--visible {
  opacity: 1;
  visibility: visible;
}

.woda-capacity-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #1d2327;
}

@keyframes woda-slide-in {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes woda-slide-out {
  to {
    transform: translateX(110%);
    opacity: 0;
  }
}

/* ── Replace / modal overlay ───────────────────────────────────────────────── */

.woda-upselling-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.woda-upselling-modal {
  background: #fff;
  border-radius: 8px;
  max-width: 480px;
  width: 92%;
  max-height: 85vh;
  overflow: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.woda-upselling-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
}

.woda-upselling-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #646970;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}

.woda-upselling-modal-close:hover {
  color: #1d2327;
}

.woda-upselling-modal-body {
  padding: 16px 18px;
  max-height: 55vh;
  overflow-y: auto;
}

.woda-upselling-modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid #e0e0e0;
  background: #f3f4f6;
}

/* Replace popup item list */

.woda-upselling-replace-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #c3c4c7;
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  font-size: 13px;
}

.woda-upselling-replace-item:hover {
  background: #f3f4f6;
  border-color: var(--primary, #1a2d60);
}

.woda-upselling-replace-item.selected {
  background: #f3f4f6;
  border-color: var(--primary, #1a2d60);
}

.woda-upselling-replace-item-name {
  color: #1d2327;
  font-weight: 600;
}

.woda-upselling-replace-item-qty {
  color: #646970;
  font-size: 12px;
}

/* Composite popup */
.woda-upselling-composite-dialog {
  max-width: 520px;
  width: 100%;
}
.woda-upselling-composite-now {
  background: #f3f4f6;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.woda-upselling-composite-replace-list {
  margin: 4px 0 0 18px;
  padding: 0;
  color: #50575e;
  font-size: 13px;
}
.woda-upselling-composite-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.woda-upselling-composite-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.woda-upselling-composite-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary, #1a2d60);
  margin: 0;
}
.woda-upselling-composite-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
}
.woda-upselling-composite-select--locked,
.woda-upselling-composite-select:disabled {
  background: #f3f4f6;
  color: #50575e;
  cursor: not-allowed;
}
.woda-upselling-composite-total {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #dcdcde;
  text-align: right;
  font-size: 15px;
}
.woda-upselling-composite-total-value {
  font-size: 17px;
  color: #16a34a;
  font-weight: 700;
}
.woda-upselling-composite-picker {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}
.woda-upselling-composite-picker li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid #f0f0f1;
  font-size: 13px;
}
.woda-upselling-composite-picker li:last-child { border-bottom: none; }
.woda-upselling-composite-picker-count {
  margin: 6px 0 0;
  font-size: 13px;
  color: #50575e;
  text-align: right;
}

/* ── Dev presets toolbar ([woda_upselling_presets]) ─────────────────────── */
.woda-upselling-presets {
  margin: 16px 0;
  padding: 12px 14px;
  background: #fff8e5;
  border: 1px solid #e0d5a0;
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.woda-upselling-presets-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #646970;
  margin-bottom: 8px;
}
.woda-upselling-presets-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.woda-upselling-preset-btn {
  padding: 5px 10px;
  font-size: 12px;
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  cursor: pointer;
  color: #2c3338;
  line-height: 1.4;
}
.woda-upselling-preset-btn:hover:not(:disabled) {
  background: #f6f7f7;
}
.woda-upselling-preset-btn:disabled {
  opacity: .5;
  cursor: wait;
}
.woda-upselling-presets-status {
  margin-top: 8px;
  font-size: 12px;
  color: #3c434a;
  min-height: 1em;
}

/* ── Dev presets: matched rules block ─────────────────────────────────── */
.woda-upselling-presets-toolbar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #92400e;
  margin-bottom: 8px;
}
.woda-upselling-presets-matched {
  background: #fff;
  border: 1px solid #e0d5a0;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 12px;
  color: #3c434a;
  margin-top: 10px;
}
.woda-upselling-presets-matched-title {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #92400e;
  margin-bottom: 6px;
}
.woda-upselling-presets-matched-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.woda-upselling-presets-matched-list li {
  padding: 4px 0;
  border-bottom: 1px dashed #eee;
}
.woda-upselling-presets-matched-list li:last-child {
  border-bottom: none;
}
.woda-upselling-pci-id {
  font-family: monospace;
  font-weight: 700;
  color: #2271b1;
}
.woda-upselling-pci-name {
  font-weight: 600;
  color: #1d2327;
}
.woda-upselling-pci-desc {
  display: block;
  color: #646970;
  font-size: 11px;
  margin-top: 2px;
}
.woda-upselling-presets-empty {
  color: #8c8f94;
  font-style: italic;
}

/* ── Paired cart rows (visual hierarchy palette → warstwa) ──────────────── */
tr.woda-paired-row {
  background: #fafafa;
}
tr.woda-paired-row td:first-child {
  padding-left: 32px;
  position: relative;
  color: #50575e;
}
tr.woda-paired-row td:first-child::before {
  content: '\21B3';           /* ↳ */
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #8c8f94;
  font-size: 16px;
  line-height: 1;
}
tr.woda-paired-row .quantity .plus[disabled] {
  cursor: not-allowed;
}

/* cart_inline: rendered inside .product-name by PHP hook, visually moved
   below the product row via absolute positioning. Row reserves space
   with padding-bottom only when it actually contains the block. */
tr.woocommerce-cart-form__cart-item {
  position: relative;
}
tr.woocommerce-cart-form__cart-item:has(.woda-upselling-slot[data-slot-id="cart_inline"]) > th,
tr.woocommerce-cart-form__cart-item:has(.woda-upselling-slot[data-slot-id="cart_inline"]) > td {
  padding-bottom: 80px !important;
}
.product-name .woda-upselling-slot[data-slot-id="cart_inline"] {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
}
.woda-upselling-slot[data-slot-id="cart_inline"] .wf-upsell-snack {
  position: relative;
  padding: 0 12px 0 30px;
  margin: 0;
  background: #f3f4f6;
  border-radius: 8px;
  gap: 16px;
}
.woda-upselling-slot[data-slot-id="cart_inline"] .wf-upsell-snack::before {
  content: '\21B3';
  position: absolute;
  left: 14px;
  top: 16px;
  color: #8c8f94;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}
.woda-upselling-slot[data-slot-id="cart_inline"] .wf-snack-icon {
  margin: 0;
}

/* On narrow screens the inline block wraps to several lines and no longer
   fits the fixed 80px reservation — drop the absolute positioning and let
   it flow normally below the product name. */
@media (max-width: 768px) {
  tr.woocommerce-cart-form__cart-item:has(.woda-upselling-slot[data-slot-id="cart_inline"]) > th,
  tr.woocommerce-cart-form__cart-item:has(.woda-upselling-slot[data-slot-id="cart_inline"]) > td {
    padding-bottom: 0 !important;
  }
  .product-name .woda-upselling-slot[data-slot-id="cart_inline"] {
    position: static;
    margin-top: 10px;
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  /* Move the right padding off the cell (it squeezed the inline block)
     onto the product title only — keeps the name clear of the × button.
     The Bricks cart template sets `#brxe-hyesfj th.product-name`
     padding-right: 30px !important; the doubled class raises specificity
     above that ID rule so it can be overridden here. */
  #brxe-hyesfj th.product-name.product-name,
  th.product-name.product-name.product-name {
    padding-right: 0 !important;
  }
  th.product-name .woda-upselling-slot[data-slot-id="cart_inline"] {
    padding-right: 0;
  }
  th.product-name > a {
    display: inline-block;
    padding-right: 44px;
  }
  /* Drop the ↳ marker and let the CTA wrap below icon+text, so the
     label and icon get the full row width. */
  .woda-upselling-slot[data-slot-id="cart_inline"] .wf-upsell-snack {
    flex-wrap: wrap;
    padding: 0 0 10px;
    gap: 8px;
  }
  .woda-upselling-slot[data-slot-id="cart_inline"] .wf-upsell-snack::before {
    display: none;
  }
  .woda-upselling-slot[data-slot-id="cart_inline"] .wf-upsell-snack .wf-cta-button {
    flex: 0 0 100%;
    width: 100%;
  }
}

/* ── In-banner composite unit picker ──────────────────────────────────────── */
.woda-upselling-banner-picker {
  margin: 8px 0 10px;
}
.woda-upselling-banner-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.woda-upselling-banner-picker__unit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border: 2px solid #c3c4c7;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.1s, transform 0.05s, box-shadow 0.1s;
  user-select: none;
}
.woda-upselling-banner-picker__unit:hover {
  border-color: var(--primary, #1a2d60);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.woda-upselling-banner-picker__unit:focus-visible {
  outline: 2px solid var(--primary, #1a2d60);
  outline-offset: 2px;
}
.woda-upselling-banner-picker__unit--selected {
  border-color: var(--primary, #1a2d60);
  background: #f3f4f6;
}
.woda-upselling-banner-picker__unit--selected::after {
  content: '\2713';
  position: absolute;
  top: 4px;
  right: 6px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary, #1a2d60);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
}
.woda-upselling-banner-picker__img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  display: block;
}
.woda-upselling-banner-picker__img--empty {
  background: #f0f0f1;
  border-radius: 3px;
}
.woda-upselling-banner-picker__name {
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  color: var(--primary, #1a2d60);
}
.woda-upselling-banner-picker__counter {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary, #1a2d60);
}
.woda-upselling-banner-picker__saving {
  margin-top: 4px;
  font-size: 13px;
  color: #50575e;
}
.woda-upselling-banner-picker__saving--ready {
  color: #16a34a;
  font-weight: 700;
}
.woda-upselling-composite-saving {
  margin-top: 6px;
  padding: 8px 10px;
  background: #edfaef;
  border-left: 3px solid #00a32a;
  color: #1d2327;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.woda-upselling-composite-saving-value {
  color: #16a34a;
  font-weight: 700;
}
.woda-upselling-composite-swap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 0 14px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 12px;
}
.woda-upselling-composite-swap__side {
  min-width: 0;
}
.woda-upselling-composite-swap__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #50575e;
  margin-bottom: 6px;
  text-align: center;
}
.woda-upselling-composite-swap__cards {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.woda-upselling-composite-swap__card {
  flex: 0 1 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #f6f7f7;
  border-radius: 6px;
  padding: 6px 4px;
}
.woda-upselling-composite-swap__card img,
.woda-upselling-composite-swap__hero img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}
.woda-upselling-composite-swap__img--empty {
  width: 56px;
  height: 56px;
  background: #e0e0e0;
  border-radius: 4px;
}
.woda-upselling-composite-swap__cardname {
  font-size: 11px;
  line-height: 1.25;
  color: #1d2327;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.woda-upselling-composite-swap__arrow {
  font-size: 22px;
  color: var(--primary, #1a2d60);
  font-weight: 700;
  text-align: center;
}
.woda-upselling-composite-swap__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #f3f4f6;
  border: 1px solid var(--primary, #1a2d60);
  border-radius: 6px;
  padding: 10px;
}
.woda-upselling-composite-swap__hero img,
.woda-upselling-composite-swap__hero .woda-upselling-composite-swap__img--empty {
  width: 80px;
  height: 80px;
}
.woda-upselling-composite-swap__heroname {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary, #1a2d60);
  margin-top: 6px;
  line-height: 1.3;
}
@media (max-width: 480px) {
  .woda-upselling-composite-swap {
    grid-template-columns: 1fr;
  }
  .woda-upselling-composite-swap__arrow {
    transform: rotate(90deg);
  }
}
.woda-upselling-confirm-dialog {
  max-width: 420px;
}
.woda-upselling-confirm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.woda-upselling-confirm-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 4px;
  flex: 0 0 auto;
}
.woda-upselling-confirm-img--empty {
  background: #f0f0f1;
}
.woda-upselling-confirm-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.woda-upselling-confirm-name {
  font-weight: 600;
  font-size: 14px;
  color: #1d2327;
  line-height: 1.3;
}
.woda-upselling-confirm-price {
  font-size: 13px;
  color: #50575e;
  margin-top: 2px;
}
.woda-upselling-confirm-arrow {
  text-align: center;
  font-size: 20px;
  color: #8c8f94;
  line-height: 1;
  padding: 4px 0;
}
.woda-upselling-confirm-prices {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
  font-size: 14px;
}
.woda-upselling-confirm-priceline {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: #1d2327;
}
.woda-upselling-confirm-diff {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  font-weight: 700;
}
.woda-upselling-confirm-diff--save {
  background: #edfaef;
  color: #00a32a;
  border-left: 3px solid #00a32a;
}
.woda-upselling-confirm-diff--extra {
  background: #fcf0f1;
  color: #b32d2e;
  border-left: 3px solid #b32d2e;
}
.woda-upselling-cta--disabled,
[data-action="replace"][disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Combined replace popup (N>1 candidates) ──────────────────────────── */

.woda-upselling-replace-dialog {
  max-width: 480px;
}

.woda-upselling-replace-section-label {
  font-size: 13px;
  font-weight: 600;
  color: #1d2327;
  margin: 12px 0 8px;
}
.woda-upselling-replace-section-label:first-child {
  margin-top: 0;
}

.woda-upselling-replace-offer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f6f7f7;
  border-radius: 6px;
  margin-bottom: 4px;
}
.woda-upselling-replace-offer-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 4px;
  flex: 0 0 auto;
  background: #fff;
}
.woda-upselling-replace-offer-img--empty {
  background: #e9ebec;
}
.woda-upselling-replace-offer-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.woda-upselling-replace-offer-name {
  font-weight: 600;
  font-size: 14px;
  color: #1d2327;
  line-height: 1.3;
}
.woda-upselling-replace-offer-price {
  font-size: 13px;
  color: #50575e;
  margin-top: 2px;
}

.woda-upselling-replace-candidates {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.woda-upselling-replace-candidate {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid #c3c4c7;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}
.woda-upselling-replace-candidate:hover {
  border-color: var(--primary, #1a2d60);
}
.woda-upselling-replace-candidate--selected {
  border-color: #00a32a;
  background: #edfaef;
}

.woda-upselling-replace-candidate-radio {
  flex: 0 0 auto;
  margin: 0;
  cursor: pointer;
}

.woda-upselling-replace-candidate-imgwrap {
  flex: 0 0 auto;
  display: inline-flex;
}
.woda-upselling-replace-candidate-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}
.woda-upselling-replace-candidate-img--empty {
  background: #f0f0f1;
}

.woda-upselling-replace-candidate-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.woda-upselling-replace-candidate-name {
  font-weight: 600;
  font-size: 13px;
  color: #1d2327;
  line-height: 1.3;
  flex: 1 1 auto;
  min-width: 0;
}
.woda-upselling-replace-candidate-price {
  font-size: 13px;
  color: #1d2327;
  font-weight: 600;
  flex: 0 0 auto;
}

.woda-upselling-replace-diff-wrap {
  margin-top: 12px;
  min-height: 0;
}
.woda-upselling-replace-diff-wrap:empty {
  margin-top: 0;
}

.woda-upselling-replace-saving,
.woda-upselling-replace-doplata {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}
.woda-upselling-replace-saving {
  background: #edfaef;
  color: #00531a;
  border-left: 3px solid #00a32a;
}
.woda-upselling-replace-saving-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #00a32a;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}
.woda-upselling-replace-doplata {
  background: #fcf0f1;
  color: #b32d2e;
  border-left: 3px solid #b32d2e;
}
.woda-upselling-replace-doplata-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #b32d2e;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .woda-upselling-replace-candidate {
    flex-wrap: wrap;
  }
  .woda-upselling-replace-candidate-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .woda-upselling-replace-saving,
  .woda-upselling-replace-doplata {
    width: 100%;
    box-sizing: border-box;
  }
}

/* ── Gazacja buttons (snack with 3 CTAs) ─────────────────────────────── */
.wf-gazacja-actions {
  display: contents;
}

/* ── Layer picker popup (faceted accordion) ──────────────────────────── */
#woda-upselling-layer-overlay { animation: wf-layer-fade .15s ease-out; }

.wf-layer-dialog {
  max-width: 460px;
  width: 100%;
  animation: wf-layer-pop .2s cubic-bezier(.2, .8, .25, 1);
}
.wf-layer-dialog .woda-upselling-modal-header {
  padding: 16px 20px;
  font-size: 16px;
}
.wf-layer-dialog .woda-upselling-modal-body { padding: 18px 20px; }

@keyframes wf-layer-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wf-layer-pop {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* One-line hint under the title so the dialog never reads as empty. */
.wf-layer-intro {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #6b7280;
}

.wf-layer-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wf-layer-step {
  border: 1px solid #e3e6ec;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: border-color .15s, box-shadow .15s, opacity .15s;
}
.wf-layer-step--open {
  border-color: var(--primary, #1a2d60);
  box-shadow: 0 0 0 3px rgba(26, 45, 96, .08);
}
/* A step the user has not reached yet sits visually "waiting". */
.wf-layer-step--pending { opacity: .6; }

.wf-layer-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}
.wf-layer-step-head-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Numbered badge that flips to a check once the step is done. */
.wf-layer-step-badge {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: #eef1f6;
  color: #6b7280;
  transition: background .15s, color .15s;
}
.wf-layer-step--open .wf-layer-step-badge,
.wf-layer-step-badge--done {
  background: var(--primary, #1a2d60);
  color: #fff;
}
.wf-layer-step-badge svg { width: 13px; height: 13px; }

.wf-layer-step-label {
  font-weight: 700;
  font-size: 14px;
  color: #1d2327;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-layer-step-header--clickable { cursor: pointer; }
.wf-layer-step-header--clickable:hover { background: #f7f9fc; }

.wf-layer-step-chosen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary, #1a2d60);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
/* Small thumbnail of the chosen option in a collapsed step header. */
.wf-layer-step-thumb {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  background: #f7f9fc;
  flex: 0 0 auto;
}
.wf-layer-step-change {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Option grid — image cards. */
.wf-layer-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 2px 14px 16px;
}
.wf-layer-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #fff;
  border: 1.5px solid #e3e6ec;
  border-radius: 10px;
  padding: 14px 6px 11px;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s, border-color .12s, box-shadow .12s, background .12s;
}
.wf-layer-card:hover {
  border-color: var(--primary, #1a2d60);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 45, 96, .12);
}
.wf-layer-card--selected {
  border-color: var(--primary, #1a2d60);
  background: #f7f9fc;
  box-shadow: inset 0 0 0 1px var(--primary, #1a2d60);
}
/* Check badge in the corner of the chosen card. */
.wf-layer-card--selected::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary, #1a2d60) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.wf-layer-card__img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
}
.wf-layer-card__img--empty {
  width: 68px;
  height: 68px;
  background: #eef1f6;
  border-radius: 8px;
}
.wf-layer-card__name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #1d2327;
  margin-top: 9px;
}
.wf-layer-card__meta {
  font-size: 11.5px;
  line-height: 1.3;
  color: #6b7280;
  margin-top: 2px;
}

/* Result — prominent hero card like the composite "Otrzymujesz" card. */
.wf-layer-result {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  background: #f7f9fc;
  border: 1px solid #e3e6ec;
  border-left: 4px solid var(--primary, #1a2d60);
  border-radius: 10px;
}
.wf-layer-result-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  flex: 0 0 auto;
}
.wf-layer-result-img--empty { background: #eef1f6; }
.wf-layer-result-name {
  flex: 1 1 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #1a2d60);
}
.wf-layer-result-price {
  font-weight: 700;
  color: var(--primary, #1a2d60);
  white-space: nowrap;
}

/* Disabled submit until a full combination is chosen. */
.wf-layer-dialog .woda-upselling-btn-primary:disabled {
  opacity: .4;
  cursor: not-allowed;
  filter: none;
}

@media (max-width: 480px) {
  .wf-layer-options { gap: 8px; }
  .wf-layer-card { padding: 10px 4px 9px; }
  .wf-layer-card__img,
  .wf-layer-card__img--empty { width: 54px; height: 54px; }
  .wf-layer-result { flex-wrap: wrap; }
  .wf-layer-result-name { flex: 1 1 60%; }
}
