/*
 * Dobre Audio: product page v2 (ported from the approved mock).
 * Normal declarations are unlayered and prefixed .da-pwrap.da-v2 (beats product-sticky.css, which uses .da-pwrap .x).
 * Only !important overrides live in @layer ps-modules at the end (they must beat layered utilities like .text-warning).
 * Removing the da-v2 flag (module mode "off") restores the old layout.
 */

/* ---------- Structure ---------- */
.da-pwrap.da-v2 { overflow-x: clip; }
.da-pwrap.da-v2 .product__description-short { max-height: none; opacity: 1; overflow: visible; transition: none; }
.da-pwrap.da-v2 .da-reass-v2 { display: block; margin: 10px 0 0; }
.da-pwrap.da-v2 .product__bottom-right { display: none; }

@media (min-width: 992px) {
  .da-pwrap.da-v2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: 32px; align-items: start; }
  .da-pwrap.da-v2 > .product__container,
  .da-pwrap.da-v2 > .product__bottom { display: contents; }
  .da-pwrap.da-v2 .product__left { grid-area: 1 / 1; margin-bottom: 0; }
  .da-pwrap.da-v2 .da-short-box { grid-area: 2 / 1; }
  .da-pwrap.da-v2 .product__bottom-left { grid-area: 3 / 1; margin: 24px 0 20px; padding: 28px 32px; background: #fff; border-radius: 20px; box-shadow: 0 2px 14px rgba(0,0,0,.05); border: 1px solid rgba(0,0,0,.04); }
  .da-pwrap.da-v2 .product__right { grid-row: 1 / span 3; grid-column: 2; align-self: stretch; position: relative; top: auto; bottom: auto; inset-block: auto; }
}

/* ---------- Short description box (variant B) ---------- */
.da-pwrap.da-v2 .da-short-box { background: #f6f8fb; border: 1px solid #e5e9f0; border-radius: 20px; padding: 22px 28px; margin: 16px 0; }
.da-pwrap.da-v2 .da-short-box .da-short-inner, .da-pwrap.da-v2 .da-short-box .product__description-short { margin: 0; }
@media (min-width: 992px) { .da-pwrap.da-v2 .da-short-box { margin: 24px 0 0; } }
.da-pwrap.da-v2 .da-short-box ul { list-style: none; margin: 0; padding: 0; }
.da-pwrap.da-v2 .da-short-box li { position: relative; padding: 5px 0 5px 28px; font-size: 14px; line-height: 1.5; color: #374151; }
.da-pwrap.da-v2 .da-short-box li b, .da-pwrap.da-v2 .da-short-box li strong { font-weight: 600; color: #111; }
.da-pwrap.da-v2 .da-short-box li::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 18px; height: 18px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M8 12.5l3 3 5-6'/></svg>") no-repeat;
}

/* ---------- Brand line: 8px under it (theme has 32px) ---------- */
.da-pwrap.da-v2 .product__right .product__manufacturer { margin: 0 0 8px; }

/* ---------- Variant selector zone ---------- */
.da-pwrap.da-v2 .dav-wrap { margin: 12px 0 14px; }

/* ---------- Buy area ---------- */
.da-pwrap.da-v2 .product__right .product__add-to-cart-container { margin-bottom: 16px; }
.da-pwrap.da-v2 .product__right .inpost-izi-btn-wrapper inpost-izi-button { margin-top: 4px; }

/* ---------- No layout shift while third-party blocks arrive ---------- */
/* ext_blapi renders its info line inside the qty/cart row and its script moves it ABOVE that row
   after DOMContentLoaded. Pre-position it above the row with the exact same box so the move is invisible. */
.da-pwrap.da-v2 .product__actions-qty-add > .ext-blapi-move-above { order: -1; flex: 0 0 100%; margin: 0 0 12px; }
/* InPost Pay widget is injected async (0 -> ~83px): reserve its height so nothing below moves */
/* the widget is width:100% + 2px padding (content-box): its button is 4px wider than the cart button and shifted 2px right. Pull the host 2px left so both buttons span the same width */
.da-pwrap.da-v2 .product__actions .inpost-izi-btn-wrapper inpost-izi-button { display: block; min-height: 83px; width: 100%; margin-left: -2px; margin-right: 2px; }

/* ---------- Discount pill (same on main view and in the bubble) ---------- */
.da-pwrap.da-v2 .product__right .product__discount-percentage {
  display: inline-flex; align-items: center; align-self: center; background: #fee2e2; border-radius: 99px;
  padding: 1px 7px; font-size: 11.5px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}

/* ---------- Share + review row ---------- */
.da-pwrap.da-v2 .product__additional-info { margin: 12px 0 6px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.da-pwrap.da-v2 .product__additional-info .ps-sharebuttons { display: flex; align-items: center; gap: 8px; }
.da-pwrap.da-v2 .product__additional-info .product-comments-additional-info { order: -1; }
.da-pwrap.da-v2 .ps-sharebuttons__label { font-size: 13px; font-weight: 500; line-height: 1.2; color: #6b7280; margin: 0; }
.da-pwrap.da-v2 .ps-sharebuttons__list { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.da-pwrap.da-v2 .ps-sharebuttons__link { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: #6b7280; transition: .15s; }
.da-pwrap.da-v2 .ps-sharebuttons__link svg { width: 17px; height: 17px; fill: currentColor; }
.da-pwrap.da-v2 .ps-sharebuttons__link:hover { background: #eef4ff; color: #0b69f6; }
.da-pwrap.da-v2 .post-product-comment {
  display: inline-flex; align-items: center; max-width: 100%; box-sizing: border-box; width: auto; height: auto; min-height: 0;
  border: 1px solid #dfe3ea; background: #fff; color: #1f2937; padding: 6px 14px; border-radius: 99px; text-decoration: none;
  font-size: 13px; font-weight: 500; line-height: 1.3; box-shadow: none; transition: .15s;
}
.da-pwrap.da-v2 .post-product-comment::before { content: "\2605"; margin-right: 6px; color: #f59e0b; }
.da-pwrap.da-v2 .post-product-comment:hover { border-color: #0b69f6; background: #f5f9ff; color: #0b4fc4; }

/* ---------- Trust chips (blockreassurance): green check + title only, arrow chip, right under the buy buttons ---------- */
.da-pwrap.da-v2 .da-reass-v2 .blockreassurance { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; font: inherit; }
.da-pwrap.da-v2 .da-reass-v2 .reassurance {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid #dfe3ea; border-radius: 99px; padding: 5px 10px 5px 8px;
  background: #fff; color: #1f2937; font-size: 12.5px; font-weight: 500; line-height: 1.3; text-decoration: none; transition: .15s; width: auto; margin: 0;
}
.da-pwrap.da-v2 .da-reass-v2 .reassurance::before {
  content: ""; flex: none; width: 15px; height: 15px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M8 12.5l3 3 5-6'/></svg>") no-repeat center / contain;
}
.da-pwrap.da-v2 .da-reass-v2 .reassurance::after { content: "\203A"; margin-left: 2px; font-size: 17px; line-height: 1; color: #0b69f6; }
.da-pwrap.da-v2 .da-reass-v2 .reassurance:hover { border-color: #0b69f6; background: #f5f9ff; color: #0b4fc4; }
.da-pwrap.da-v2 .da-reass-v2 .reassurance__image { display: none; }
.da-pwrap.da-v2 .da-reass-v2 .reassurance__content { display: inline; }
.da-pwrap.da-v2 .da-reass-v2 .reassurance__content br,
.da-pwrap.da-v2 .da-reass-v2 .reassurance__desc { display: none; }
.da-pwrap.da-v2 .da-reass-v2 .reassurance__title { font-weight: 500; }

/* ---------- Desktop follow card (sticky in the right column, visible when the buy row is out of view) ---------- */
.da-follow { display: none; }
/* The bubble lives in an out-of-flow rail that covers the whole right column: it takes no space (no layout shift when it is injected)
   and, being sticky from the column top, it is already docked under the header when it fades in. */
.da-follow-rail { display: none; }
@media (min-width: 992px) {
  .da-follow-rail { display: block; position: absolute; inset: 0; pointer-events: none; z-index: 5; }
  .da-follow {
    display: block; position: sticky; top: var(--da-sticky-top, 152px); margin: 0; z-index: 5;
    max-height: calc(100vh - var(--da-sticky-top, 152px) - 16px); overflow-y: auto; scrollbar-width: thin;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; box-shadow: 0 8px 28px rgba(0,0,0,.08); padding: 16px;
    /* Hidden = fully painted but transparent (never visibility:hidden, so the first frame does not have to rasterize the card) and kept on its own compositor layer */
    opacity: 0; pointer-events: none; transform: translate3d(0, 22px, 0) scale(.96); transform-origin: 50% 0; will-change: transform, opacity;
    transition: transform .38s cubic-bezier(.4, 0, .6, 1), opacity .26s cubic-bezier(.4, 0, .6, 1);
  }
  /* Apple-like entrance: long spring-style deceleration for the move, softer fade, content rises a beat later */
  .da-follow.is-on { opacity: 1; pointer-events: auto; transform: none; transition: transform .75s cubic-bezier(.32, .72, 0, 1), opacity .5s cubic-bezier(.25, .1, .25, 1); }
  /* content rises top to bottom, one beat after the other; the InPost copy is the last item */
  .da-follow > :not(.da-follow__izi), .da-follow__izi > * { opacity: 0; transform: translate3d(0, 10px, 0); transition: opacity .2s ease, transform .2s ease; }
  .da-follow.is-on > :not(.da-follow__izi), .da-follow.is-on .da-follow__izi.is-filled > * {
    opacity: 1; transform: none;
    transition: opacity .55s cubic-bezier(.25, .1, .25, 1) .05s, transform .75s cubic-bezier(.32, .72, 0, 1) .05s;
  }
  .da-follow.is-on > :nth-child(2) { transition-delay: .1s; }
  .da-follow.is-on > :nth-child(3) { transition-delay: .15s; }
  .da-follow.is-on > :nth-child(4) { transition-delay: .2s; }
  .da-follow.is-on .da-follow__izi.is-filled > * { transition-delay: .26s; }
}
.da-follow__h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.da-follow__img { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; background: #f5f5f7; flex: none; }
.da-follow__t { min-width: 0; line-height: 1.3; }
.da-follow__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 600; color: #111; }
.da-follow__var { color: #6b7280; font-size: 12.5px; }
.da-follow__p { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 6px; }
.da-follow__price { font-size: 22px; font-weight: 700; color: #111; }
.da-follow__old { color: #9ca3af; font-size: 13px; text-decoration: line-through; }
.da-follow__pill { font-style: normal; background: #fee2e2; color: #991b1b; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.da-follow__br { color: #6b7280; font-size: 12.5px; }
.da-follow__av { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #14532d; margin-bottom: 12px; }
.da-follow__av i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: block; flex: none; }
.da-follow__btn { width: 100%; height: 48px; border: 0; border-radius: 980px; background: var(--bs-primary, #0b69f6); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.da-follow__btn:disabled { opacity: .5; cursor: not-allowed; }
/* The InPost copy is injected after load: its slot grows smoothly instead of making the card jump */
.da-follow__izi { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--da-ease, cubic-bezier(.22, 1, .36, 1)); }
.da-follow__izi.is-filled { grid-template-rows: 1fr; }
.da-follow__izi > * { min-height: 0; overflow: hidden; }
.da-follow__izi.is-filled > * { padding-top: 10px; }
.da-buybar__ip > * { opacity: 0; transition: opacity .3s ease; }
.da-buybar__ip.is-filled > * { opacity: 1; }

/* ---------- Mobile bottom buy bar: thumbnail | text | InPost | cart icon ---------- */
.da-buybar {
  /* bottom:-2px + padding: iOS Safari leaves a sub-pixel gap above its toolbar; the bar overlaps it instead */
  position: fixed; left: 0; right: 0; bottom: -2px; padding-bottom: calc(2px + env(safe-area-inset-bottom, 0px)); z-index: 1030; background: #fff; border-top: 1px solid #e5e7eb; box-shadow: 0 -6px 20px rgba(0,0,0,.08);
  container-type: inline-size; transform: translate3d(0, calc(100% + 44px), 0); opacity: 0; pointer-events: none; will-change: transform, opacity;
  transition: transform .38s cubic-bezier(.4, 0, .6, 1), opacity .26s cubic-bezier(.4, 0, .6, 1);
}
/* white skirt under the bar so nothing shows through at the very bottom (rubber-band scroll, toolbar animation) */
.da-buybar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px; background: #fff; }
.da-buybar.is-on { transform: none; opacity: 1; pointer-events: auto; transition: transform .7s cubic-bezier(.32, .72, 0, 1), opacity .45s cubic-bezier(.25, .1, .25, 1); }
@media (min-width: 992px) { .da-buybar { display: none; } }
.da-buybar__in {
  --bh: 46px; --bw1: 58px; --th: 46px; --logo-w: 50px; --logo-h: 33px; --ci: 23px;
  max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box;
  padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
@container (min-width: 361px) { .da-buybar__in { --bh: 50px; --bw1: 70px; --th: 50px; --logo-w: 56px; --logo-h: 37px; --ci: 26px; } }
@container (min-width: 430px) { .da-buybar__in { --bh: 56px; --bw1: 84px; --th: 56px; --logo-w: 66px; --logo-h: 44px; --ci: 28px; } }
.da-buybar__img { width: var(--th); height: var(--th); object-fit: contain; border-radius: 8px; background: #f5f5f7; flex: none; }
.da-buybar__t { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; line-height: 1.25; }
.da-buybar__nm { display: none; }
.da-buybar__pr { font-size: 17px; font-weight: 700; color: #111; white-space: nowrap; }
.da-buybar__var { display: block; color: #6b7280; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.da-buybar__var:empty { display: none; }
.da-buybar__ip { display: block; flex: none; width: var(--bw1); }
.da-buybar__add {
  flex: none; width: var(--bw1); height: var(--bh); border: 0; padding: 0; border-radius: 980px; background: var(--bs-primary, #0b69f6); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.da-buybar__add:disabled { opacity: .5; cursor: not-allowed; }
.da-buybar__add svg { width: var(--ci); height: var(--ci); fill: currentColor; }
@container (max-width: 380px) { .da-buybar__pr { font-size: 16px; } }
@container (min-width: 480px) {
  .da-buybar__t { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: baseline; align-content: center; }
  .da-buybar__nm { display: block; grid-column: 1 / -1; font-size: 12.5px; font-weight: 600; color: #111; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 1px; }
  .da-buybar__pr { grid-column: 1; }
  .da-buybar__var { grid-column: 2; }
}
/* "Reduce motion" means less movement, not none: keep a calm fade, drop the slide/scale/stagger */
@media (prefers-reduced-motion: reduce) {
  .da-follow, .da-buybar, .da-follow.is-on, .da-buybar.is-on { transform: none; transition: opacity .35s ease; }
  .da-follow > :not(.da-follow__izi), .da-follow.is-on > :not(.da-follow__izi), .da-follow__izi > *, .da-follow.is-on .da-follow__izi.is-filled > * { opacity: 1; transform: none; transition: none; }
  .da-follow__izi, .da-follow__izi > *, .da-buybar__ip > * { transition: none; }
}

/* ---------- !important overrides, layered so they beat theme utilities ---------- */
@layer ps-modules {
  .da-pwrap.da-v2 .product__description-short { max-height: none !important; opacity: 1 !important; }
  .da-pwrap.da-v2 .product__right .product__discount-percentage { color: #991b1b !important; }
  .da-pwrap.da-v2 .product__right .product__actions-qty-add { row-gap: 8px !important; }
  /* review chip: theme .btn rules are !important (padding 12px 24px, 15px, pill radius) */
  .da-pwrap.da-v2 .post-product-comment {
    width: auto !important; height: auto !important; min-height: 0 !important; padding: 6px 14px !important; font-size: 13px !important; font-weight: 500 !important;
    line-height: 1.3 !important; border: 1px solid #dfe3ea !important; border-radius: 99px !important; background: #fff !important; color: #1f2937 !important; box-shadow: none !important; text-decoration: none !important;
  }
  .da-pwrap.da-v2 .post-product-comment:hover { border-color: #0b69f6 !important; background: #f5f9ff !important; color: #0b4fc4 !important; }
}
