/* ==========================================================================
   Collection on the single product page (UIE_Collection_Frontend).
   Three steps — package, event details, review — in the shop's warm palette,
   matching the invitation choice pills (invite-choice.css).

   px, not rem: Bricks sets html{font-size:62.5%}.
   ========================================================================== */

.uie-collection-loop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; font-size: 12px; color: #6b6259; }
.uie-collection-loop > span, .uie-collection-flow .uie-collection-pill { display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid #eadfd3; border-radius: 999px; background: #faf6f1; color: #7d4a34; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; line-height: 1.5; }

.uie-collection-flow {
  --uie-c-ink: #211e1b;
  --uie-c-muted: #6b6259;
  --uie-c-line: #e8e0d6;
  --uie-c-line-strong: #d6cabc;
  --uie-c-paper: #faf6f1;
  --uie-c-accent: #9a5f45;
  --uie-c-accent-deep: #7d4a34;
  --uie-c-ease: cubic-bezier(0.22, 1, 0.36, 1);
  display: grid;
  gap: 18px;
  margin: 8px 0 24px;
  color: var(--uie-c-ink);
  text-align: left;
}
.uie-collection-flow *, .uie-collection-flow *::before, .uie-collection-flow *::after { box-sizing: border-box; }
.uie-collection-flow [hidden] { display: none !important; }
.uie-collection-flow p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--uie-c-muted); }
.uie-collection-flow fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ---------- Header + steps ---------- */
.uie-cf-head { display: grid; gap: 8px; justify-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--uie-c-line); }
.uie-cf-head .uie-collection-pill { text-transform: uppercase; }
.uie-collection-flow .uie-cf-head h2 { margin: 4px 0 0; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; font-weight: 500; letter-spacing: -.01em; text-wrap: balance; }
.uie-cf-head p { max-width: 52ch; }
.uie-cf-steps { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; padding: 0; list-style: none; counter-reset: uie-step; }
.uie-cf-steps li { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: #9b9187; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; counter-increment: uie-step; }
.uie-cf-steps__dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--uie-c-line-strong); border-radius: 50%; background: #fff; font-size: 11px; transition: background-color .2s var(--uie-c-ease), border-color .2s var(--uie-c-ease), color .2s var(--uie-c-ease); }
.uie-cf-steps__dot::before { content: counter(uie-step); }
.uie-cf-steps li[aria-current="step"] { color: var(--uie-c-ink); }
.uie-cf-steps li[aria-current="step"] .uie-cf-steps__dot { border-color: var(--uie-c-ink); background: var(--uie-c-ink); color: #fdfbf8; }
.uie-cf-steps li.is-done { color: var(--uie-c-accent-deep); }
.uie-cf-steps li.is-done .uie-cf-steps__dot { border-color: var(--uie-c-accent); background: #f6ece5; color: var(--uie-c-accent-deep); }
.uie-cf-steps li.is-done .uie-cf-steps__dot::before { content: "✓"; }

/* ---------- Section blocks ---------- */
.uie-collection-flow .uie-cf-block { display: grid; gap: 14px; min-width: 0; }
.uie-collection-flow .uie-cf-block > h3, .uie-collection-flow .uie-cf-block > legend { display: flex; align-items: center; gap: 10px; margin: 0 0 2px; padding: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.uie-collection-flow legend { float: left; width: 100%; }
.uie-collection-flow legend + * { clear: both; }
.uie-cf-num { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--uie-c-paper); border: 1px solid var(--uie-c-line); color: var(--uie-c-accent-deep); font-size: 12px; font-weight: 700; }
.uie-collection-flow .uie-cf-lead { margin-top: -6px; }

/* ---------- Package cards ---------- */
.uie-collection-flow [data-package-cards] { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.uie-collection-flow .uie-package-choice { position: relative; display: grid; margin: 0; cursor: pointer; }
.uie-collection-flow .uie-package-choice input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.uie-collection-flow .uie-package-body { display: grid; align-content: start; gap: 10px; height: 100%; padding: 18px 18px 16px; border: 1px solid var(--uie-c-line); border-radius: 16px; background: #fff; transition: border-color .2s var(--uie-c-ease), box-shadow .2s var(--uie-c-ease), transform .2s var(--uie-c-ease), background-color .2s var(--uie-c-ease); }
@media (hover: hover) and (pointer: fine) {
  .uie-collection-flow .uie-package-choice:hover .uie-package-body { border-color: var(--uie-c-line-strong); transform: translateY(-1px); box-shadow: 0 10px 24px -18px rgba(33, 30, 27, .45); }
}
.uie-collection-flow .uie-package-choice input:checked + .uie-package-body { border-color: var(--uie-c-ink); background: #fffdfb; box-shadow: inset 0 0 0 1px var(--uie-c-ink), 0 14px 30px -22px rgba(33, 30, 27, .55); }
.uie-collection-flow .uie-package-choice input:focus-visible + .uie-package-body { outline: 2px solid var(--uie-c-accent); outline-offset: 3px; }
.uie-collection-flow .uie-package-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.uie-collection-flow .uie-package-name { font-size: 18px; font-weight: 600; line-height: 1.25; letter-spacing: -.005em; }
.uie-collection-flow .uie-package-mark { position: relative; flex: none; width: 22px; height: 22px; margin-top: 1px; border: 1.5px solid var(--uie-c-line-strong); border-radius: 50%; background: #fff; transition: border-color .2s var(--uie-c-ease), background-color .2s var(--uie-c-ease); }
.uie-collection-flow .uie-package-choice input:checked + .uie-package-body .uie-package-mark { border-color: var(--uie-c-ink); background: var(--uie-c-ink); }
.uie-collection-flow .uie-package-choice input:checked + .uie-package-body .uie-package-mark::after { content: ""; position: absolute; left: 7px; top: 3.5px; width: 5px; height: 10px; border: solid #fdfbf8; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.uie-collection-flow .uie-package-description { color: var(--uie-c-muted); font-size: 13px; line-height: 1.5; }
.uie-collection-flow .uie-package-assets { display: flex; flex-wrap: wrap; gap: 6px; }
.uie-collection-flow .uie-package-count { flex: 1 0 100%; color: #9b9187; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.uie-collection-flow .uie-package-asset { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: var(--uie-c-paper); color: var(--uie-c-ink); font-size: 12.5px; line-height: 1.4; }
.uie-collection-flow .uie-package-adjustment { margin-top: 2px; padding-top: 12px; border-top: 1px dashed var(--uie-c-line); color: var(--uie-c-accent-deep); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.uie-collection-flow .uie-package-adjustment.is-free { color: var(--uie-c-muted); font-weight: 600; }
/* 1.44: final price on the card; the difference line underneath is secondary. */
.uie-collection-flow .uie-package-final { color: var(--uie-c-ink); font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.uie-collection-flow .uie-package-final:empty { display: none; }
.uie-collection-flow .uie-package-final small { font-size: 12px; font-weight: 500; color: var(--uie-c-muted); }
.uie-collection-flow .uie-package-final.is-from { font-size: 17px; }
.uie-collection-flow .uie-package-adjustment { font-size: 13px; font-weight: 600; }
.uie-collection-flow .uie-package-top .uie-package-badge { flex: none; margin-left: auto; padding: 3px 9px; border-radius: 999px; background: var(--uie-c-ink); color: #fdfbf8; font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1.5; white-space: nowrap; }
.uie-collection-flow .uie-package-top .uie-package-name { min-width: 0; }

/* ---------- Price ---------- */
.uie-collection-flow .uie-cf-total:not(:empty) { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 14px; background: var(--uie-c-paper); color: var(--uie-c-ink); font-size: 14px; }
.uie-collection-flow .uie-cf-total span { color: var(--uie-c-muted); font-weight: 600; }
.uie-collection-flow .uie-cf-total strong { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.uie-collection-flow .uie-cf-total strong del { color: #9b9187; font-size: 14px; font-weight: 500; }
.uie-collection-flow .uie-cf-total.is-note { display: block; font-size: 13px; color: var(--uie-c-muted); }

/* ---------- Event details form ---------- */
.uie-collection-flow form.uie-cf-block { padding: 20px; border: 1px solid var(--uie-c-line); border-radius: 18px; background: #fff; }
.uie-collection-flow .uie-event-field { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin: 0; }
.uie-collection-flow [data-collection-event-fields] { display: grid; gap: 18px; }
.uie-collection-flow .uie-event-field label { grid-column: 1 / -1; font-size: 13.5px; font-weight: 600; }
.uie-collection-flow .uie-event-field :is(input, textarea) { grid-column: 1 / -1; width: 100%; max-width: 100%; min-height: 48px; margin: 0; padding: 11px 14px; font: inherit; font-size: 16px; color: var(--uie-c-ink); background: #fff; border: 1px solid var(--uie-c-line-strong); border-radius: 12px; box-shadow: none; transition: border-color .2s var(--uie-c-ease), box-shadow .2s var(--uie-c-ease); }
.uie-collection-flow .uie-event-field :is(input, textarea):focus { border-color: var(--uie-c-ink); box-shadow: 0 0 0 3px rgba(154, 95, 69, .16); outline: none; }
.uie-collection-flow .uie-list-muted { color: #8a8077; font-size: 12px; }
.uie-collection-flow .uie-event-field-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
/* 1.44: where a field is used, the required mark and the date / weekday check. */
.uie-collection-flow .uie-event-used { grid-column: 1 / -1; color: #8a8077; font-size: 12px; line-height: 1.4; }
.uie-collection-flow .uie-event-required { color: var(--uie-c-accent-deep); }
.uie-collection-flow .uie-event-date-warning { margin: 4px 0 0; padding: 12px 14px; border: 1px solid #ecd7c9; border-radius: 12px; background: #fbf3ee; color: #7d4a34; font-size: 14px; font-weight: 600; line-height: 1.45; }
.uie-collection-flow .button-link, .uie-collection-flow .uie-collection-reset { min-height: 0; border: 0; padding: 2px 0; background: transparent; color: var(--uie-c-accent-deep); font: inherit; font-size: 12px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(125, 74, 52, .35); text-underline-offset: 3px; cursor: pointer; }
.uie-collection-flow .button-link:hover, .uie-collection-flow .uie-collection-reset:hover { text-decoration-color: currentColor; }

/* ---------- Buttons ---------- */
.uie-collection-flow .uie-collection-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: 100%; min-height: 52px; margin: 0; padding: 14px 22px; border: 1px solid var(--uie-c-ink); border-radius: 999px; background: var(--uie-c-ink); color: #fdfbf8; font: inherit; font-size: 15px; line-height: 1.3; font-weight: 600; letter-spacing: .01em; cursor: pointer; transition: background-color .2s var(--uie-c-ease), transform .2s var(--uie-c-ease), box-shadow .2s var(--uie-c-ease); }
@media (hover: hover) and (pointer: fine) {
  .uie-collection-flow .uie-collection-button:not(:disabled):hover { background: #000; transform: translateY(-1px); box-shadow: 0 12px 24px -16px rgba(33, 30, 27, .7); }
  .uie-collection-flow .uie-collection-button.is-secondary:not(:disabled):hover { background: var(--uie-c-paper); box-shadow: none; }
}
.uie-collection-flow .uie-collection-button.is-secondary { min-height: 44px; padding: 10px 18px; background: #fff; color: var(--uie-c-ink); border-color: var(--uie-c-line-strong); font-size: 14px; }
.uie-collection-flow .uie-collection-button.is-cart { min-height: 56px; font-size: 16px; }
.uie-collection-flow :is(button, input, textarea, select):focus-visible { outline: 2px solid var(--uie-c-accent); outline-offset: 3px; }
.uie-collection-flow button:disabled { opacity: .55; cursor: wait; }
.uie-collection-flow[aria-busy="true"] .uie-package-body { cursor: wait; }

/* ---------- Status + errors ---------- */
.uie-collection-flow .uie-cf-status:empty { display: none; }
.uie-collection-flow .uie-cf-status { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--uie-c-muted); }
.uie-collection-flow .uie-cf-status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--uie-c-accent); }
.uie-collection-flow[aria-busy="true"] .uie-cf-status::before { animation: uie-cf-pulse 1s ease-in-out infinite; }
@keyframes uie-cf-pulse { 50% { opacity: .25; } }
.uie-collection-flow [data-collection-error] { padding: 14px 16px; border: 1px solid #f1c9c3; border-radius: 12px; background: #fff5f3; color: #8d2119; font-size: 14px; line-height: 1.5; }

/* ---------- Review ---------- */
.uie-collection-flow [data-collection-assets] { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; margin: 4px 0 6px; }
.uie-collection-flow [data-collection-assets].is-single { grid-template-columns: minmax(0, 1fr); }
.uie-collection-flow .uie-collection-asset { display: flex; flex-direction: column; align-items: stretch; gap: 12px; min-width: 0; padding: 12px 12px 14px; border: 1px solid var(--uie-c-line); border-radius: 18px; background: #fff; }
.uie-collection-flow .uie-collection-asset__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 0; }
.uie-collection-flow .uie-collection-asset h4 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.uie-collection-flow .uie-collection-stage { display: flex; justify-content: center; overflow: hidden; padding: 18px; border-radius: 12px; background: linear-gradient(180deg, #f6f0e9, #efe7de); transition: opacity .2s var(--uie-c-ease); }
.uie-collection-flow .uie-collection-stage .canvas-container { flex-shrink: 0; background: #fff; box-shadow: 0 1px 2px rgba(33, 30, 27, .08), 0 14px 28px -16px rgba(33, 30, 27, .45); }
.uie-collection-flow .uie-collection-stage.is-loading { position: relative; align-items: center; min-height: 240px; background: linear-gradient(100deg, #f4ede5 30%, #faf6f1 50%, #f4ede5 70%) 0 0 / 300% 100%; animation: uie-cf-shimmer 1.4s ease-in-out infinite; }
.uie-collection-flow .uie-collection-stage.is-loading > canvas { visibility: hidden; }
.uie-collection-flow .uie-collection-stage.is-loading::after { content: "Učitavam pregled…"; position: absolute; inset: auto 0 50%; transform: translateY(50%); color: var(--uie-c-muted); font-size: 13px; font-weight: 600; text-align: center; }
@keyframes uie-cf-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.uie-collection-flow .uie-collection-stage.is-failed { align-items: center; min-height: 220px; background: #fbf4f1; }
.uie-collection-flow .uie-collection-stage__error { display: grid; justify-items: center; gap: 8px; max-width: 34ch; text-align: center; font-size: 13px; line-height: 1.5; color: var(--uie-c-muted); }
.uie-collection-flow .uie-collection-stage__error strong { color: #8d2119; font-size: 14px; }
.uie-collection-flow .uie-collection-stage__error .uie-collection-button { width: auto; margin-top: 4px; }
.uie-collection-flow .uie-collection-reset { align-self: center; }
.uie-collection-flow .is-stale .uie-collection-stage { opacity: .45; }

@media (max-width: 600px) {
  /* Phones: the page has no side padding of its own, so the bar stays inside the section. */
  .uie-collection-flow .uie-cf-cartbar { margin: 4px 0 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-radius: 16px 16px 0 0; }
}
.uie-collection-flow .uie-collection-button.is-cart.is-added { background: #2e7256; border-color: #2e7256; }
@media (max-width: 480px) {
  .uie-collection-flow .uie-cf-cartbar__row { gap: 12px; }
  .uie-collection-flow .uie-cf-cartbar__price strong { font-size: 17px; }
  .uie-collection-flow form.uie-cf-block { padding: 16px; border-radius: 16px; }
  .uie-collection-flow .uie-collection-stage { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .uie-collection-flow *, .uie-collection-flow *::before { transition: none !important; animation: none !important; }
}

/* ---------- Cart bar (review step) ---------- */
/* Sticks to the bottom of the screen while the review is in view: price, button and its error together. */
.uie-collection-flow .uie-cf-cartbar { position: sticky; bottom: 0; z-index: 5; display: grid; gap: 10px; margin: 4px -12px 0; padding: 12px; border-radius: 18px 18px 0 0; background: rgba(253, 251, 248, .94); box-shadow: 0 -12px 24px -20px rgba(33, 30, 27, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.uie-collection-flow .uie-cf-cartbar__row { display: flex; align-items: center; gap: 16px; }
.uie-collection-flow .uie-cf-cartbar__price { display: grid; flex: none; margin: 0; line-height: 1.25; }
.uie-collection-flow .uie-cf-cartbar__price:empty { display: none; }
.uie-collection-flow .uie-cf-cartbar__price span { color: var(--uie-c-muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.uie-collection-flow .uie-cf-cartbar__price strong { color: var(--uie-c-ink); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.uie-collection-flow .uie-cf-cartbar__price del { display: none; }
.uie-collection-flow .uie-cf-cartbar .uie-collection-button.is-cart { flex: 1; }

/* ---------- Error next to its button ---------- */
.uie-collection-flow .uie-cf-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid #f1c9c3; border-radius: 12px; background: #fff5f3; color: #8d2119; font-size: 14px; line-height: 1.5; animation: uie-cf-alert-in .25s var(--uie-c-ease); }
.uie-collection-flow .uie-cf-alert::before { content: "!"; display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: #b42318; color: #fff; font-size: 12px; font-weight: 700; }
@keyframes uie-cf-alert-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- The product page around a collection ---------- */
/* The collection has its own button: WooCommerce's add-to-cart form (hidden quantity + hidden
   button) and empty theme boxes only left gaps above it. The form stays in the page for the
   script (variation, quantity); variable products keep theirs for the choices. */
.uie-collection-product-page form.cart .single_add_to_cart_button { display: none; }
.uie-collection-product-page form.cart:not(.variations_form) { display: none; }
.uie-collection-product-page .brxe-product-add-to-cart:not(:has(.variations_form)),
.uie-collection-product-page .brxe-product-short-description:empty,
.uie-collection-product-page .brxe-woocommerce-notice:empty,
.uie-collection-product-page .woocommerce-product-details__short-description:empty { display: none; }
