/* EW Woo Builder – style bazowe. Niska specyficzność (:where), żeby klasy Bricks wygrywały. */
:where([data-ewc-region], .ewc-qty, .ewc-remove, .ewc-coupon) { transition: opacity .2s; }
:where(.ewc-is-loading) { opacity: .55; pointer-events: none; }
:where(.ewc-is-removing) { opacity: .35; }

/* Ilość */
:where(.ewc-qty) { display: inline-flex; align-items: stretch; border: 1px solid currentColor; border-radius: 6px; overflow: hidden; }
:where(.ewc-qty__btn) { appearance: none; background: none; border: 0; padding: 0 .65em; cursor: pointer; font: inherit; color: inherit; line-height: 1; }
:where(.ewc-qty__btn:disabled) { opacity: .35; cursor: default; }
:where(.ewc-qty__input) { width: 3em; text-align: center; border: 0; background: none; font: inherit; color: inherit; -moz-appearance: textfield; padding: .4em 0; }
:where(.ewc-qty__input)::-webkit-inner-spin-button, :where(.ewc-qty__input)::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
:where(.ewc-qty--fixed) { border: 0; }

/* Usuń */
:where(.ewc-remove) { display: inline-flex; align-items: center; gap: .35em; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; }
:where(.ewc-remove svg) { width: 1em; height: 1em; }

/* Kupon */
:where(.ewc-coupon__row) { display: flex; gap: .5em; }
:where(.ewc-coupon__input) { flex: 1; min-width: 0; }
:where(.ewc-coupon--collapsible:not(.ewc-coupon--open) .ewc-coupon__row) { display: none; }
:where(.ewc-coupon__toggle) { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; color: inherit; }
:where(.ewc-coupons) { display: flex; flex-wrap: wrap; gap: .5em; list-style: none; margin: 0; padding: 0; }
:where(.ewc-coupons__item) { display: inline-flex; align-items: center; gap: .4em; padding: .25em .6em; border-radius: 99px; background: rgba(0,0,0,.06); }
:where(.ewc-coupons__remove) { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; line-height: 1; }

/* Sumy */
:where(.ewc-totals) { display: flex; flex-direction: column; gap: .5em; margin: 0; }
:where(.ewc-totals__row) { display: flex; justify-content: space-between; gap: 1em; }
:where(.ewc-totals__row dt, .ewc-totals__row dd) { margin: 0; }
:where(.ewc-totals__row--total) { font-weight: 700; font-size: 1.15em; }

/* Darmowa dostawa */
:where(.ewc-fsb__track) { height: 6px; border-radius: 99px; background: rgba(0,0,0,.1); overflow: hidden; }
:where(.ewc-fsb__bar) { height: 100%; width: var(--ewc-progress, 0%); background: currentColor; border-radius: inherit; transition: width .4s; }

/* Dostawa i płatność (kafelki) */
:where(.ewc-shipping__list, .ewc-payment__list) { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5em; }
:where(.ewc-shipping__item, .ewc-payment__item) { position: relative; }
:where(.ewc-shipping__label, .ewc-payment__label) { display: flex; align-items: center; gap: .6em; cursor: pointer; }
:where(.ewc-shipping__cost) { margin-left: auto; }
:where(.ewc-payment__item .payment_box) { margin-top: .5em; }

/* Licznik */
:where(.ewc-counter) { position: relative; display: inline-flex; align-items: center; gap: .4em; color: inherit; text-decoration: none; }
:where(.ewc-counter__badge) { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; padding: 0 .3em; border-radius: 99px; font-size: .75em; line-height: 1; background: currentColor; }
:where(.ewc-counter__badge .ewc-count) { color: #fff; }
:where(.ewc-counter--empty .ewc-counter__badge.ewc-hide-empty) { display: none; }

/* Pole kasy: Woo dodaje form-row-first/last – w gridzie Bricks zajmują pełną szerokość komórki. */
:where(.brxe-ewc-checkout-field .form-row) { width: 100%; float: none; margin: 0; }
:where(.ewc-ship-different .shipping_address) { margin-top: 1em; }
:where(.ewc-fsb) { display: flex; flex-direction: column; gap: .5em; }
:where(.ewc-fsb[hidden]) { display: none; }
:where(.ewc-counter--hide-empty .ewc-counter__badge:has(.ewc-count[data-count="0"])) { display: none; }
:where(.ewc-shipping__desc) { display: block; font-size: .85em; opacity: .75; }
:where(.ewc-shipping__empty) { margin: 0; }
:where(.ewc-field--sr-label label:not(.checkbox)) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(.ewc-place-order__button) { width: 100%; }
:where(.ewc-payment .payment_box) { padding: .75em 1em; border-radius: 6px; background: rgba(0,0,0,.04); }
:where(.ewc-payment .wc_payment_method > label) { display: inline-flex; align-items: center; gap: .5em; cursor: pointer; }
:where(.ewc-payment .wc_payment_methods) { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5em; }
:where(.ewc-account-nav__list) { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
:where(.ewc-account-nav__link) { display: flex; align-items: center; gap: .6em; color: inherit; text-decoration: none; }
:where(.ewc-account-nav__count) { margin-left: auto; font-size: .8em; opacity: .7; }
:where(.ewc-order-actions) { display: flex; flex-wrap: wrap; gap: .5em; }
:where(.ewc-place-order) { display: flex; flex-direction: column; gap: 1em; }
:where(.ewc-ship-different .shipping_address) { display: grid; gap: 0 1em; }

/* Układ (zwykła specyficzność – musi wygrać ze stylami Woo/motywu). */
.ewc-shipping__list, .ewc-payment .wc_payment_methods { list-style: none; margin: 0; padding: 0; }
.ewc-shipping__item { display: flex; flex-wrap: wrap; align-items: center; column-gap: .6em; }
.ewc-shipping__item > input { margin: 0; flex: none; }
.ewc-shipping__label { flex: 1; display: flex; align-items: center; gap: .6em; margin: 0; }
.ewc-shipping__item > :not(input):not(.ewc-shipping__label) { flex-basis: 100%; }
.ewc-payment .wc_payment_method { list-style: none; display: flex; flex-wrap: wrap; align-items: center; column-gap: .6em; margin: 0; }
.ewc-payment .wc_payment_method > input { margin: 0; flex: none; }
.ewc-payment .wc_payment_method > label { flex: 1; margin: 0; display: flex; align-items: center; gap: .5em; }
.ewc-payment .wc_payment_method > .payment_box { flex-basis: 100%; }
.ewc-payment--no-boxes .payment_box:not(:has(fieldset, input, select, iframe)) { display: none !important; }
.ewc-ship-different__toggle label { display: inline-flex; align-items: center; gap: .5em; cursor: pointer; justify-content: flex-start; float: none; width: auto; }
.ewc-ship-different__toggle input { order: -1; margin: 0; }

/* Progi nagród */
:where(.ewc-rewards) { display: flex; flex-direction: column; gap: .6em; }
.ewc-rewards[hidden] { display: none; }
.ewc-rewards__track { position: relative; height: 8px; border-radius: 99px; background: rgba(0,0,0,.1); }
.ewc-rewards__bar { position: absolute; inset: 0 auto 0 0; width: var(--ewc-progress, 0%); border-radius: inherit; background: currentColor; transition: width .4s; }
.ewc-rewards__dot { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.15); box-shadow: 0 0 0 3px #fff; }
.ewc-rewards__dot.is-reached { background: currentColor; }
.ewc-rewards__dot:last-of-type { transform: translate(-100%, -50%); }
.ewc-rewards__scale { position: relative; height: 1.2em; font-size: .8em; opacity: .7; }
.ewc-rewards__scale > span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ewc-rewards__scale > span:last-child { transform: translateX(-100%); }
:where(.ewc-rewards__list) { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25em; font-size: .9em; }
:where(.ewc-rewards__item:not(.is-reached)) { opacity: .65; }
:where(.ewc-rewards__from) { opacity: .7; }

/* Order bump */
.ewc-bump[hidden] { display: none; }
.ewc-bump__label { display: flex; align-items: center; gap: .8em; cursor: pointer; margin: 0; }
:where(.ewc-bump__label) { padding: 1em; border: 2px dashed rgba(0,0,0,.25); border-radius: 10px; }
.ewc-bump__input { flex: none; width: 1.2em; height: 1.2em; margin: 0; }
.ewc-bump__image { flex: none; width: 56px; }
.ewc-bump__image img { width: 100%; height: auto; display: block; border-radius: 6px; }
.ewc-bump__body { display: flex; flex-direction: column; gap: .2em; }
:where(.ewc-bump__title) { font-weight: 600; }
:where(.ewc-bump__badge) { align-self: flex-start; font-size: .75em; text-transform: uppercase; letter-spacing: .04em; padding: .15em .5em; border-radius: 99px; background: rgba(0,0,0,.08); }
:where(.ewc-bump__desc) { font-size: .9em; opacity: .8; }

/* Kalkulator wysyłki */
.ewc-calc[hidden] { display: none; }
:where(.ewc-calc) { display: flex; flex-direction: column; gap: .5em; }
.ewc-calc__form { display: flex; flex-wrap: wrap; gap: .5em; }
.ewc-calc--collapsed .ewc-calc__form { display: none; }
.ewc-calc__form > input, .ewc-calc__form > select { flex: 1 1 8em; min-width: 0; }
.ewc-calc__toggle { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; color: inherit; }

/* Kup teraz */
:where(.ewc-buy-now) { display: inline-flex; align-items: center; justify-content: center; gap: .5em; cursor: pointer; }
.ewc-buy-now.ewc-is-loading { opacity: .6; pointer-events: none; }

/* ---------- 0.3.0: dodaj do koszyka, zdjęcie produktu, wiersz podsumowania, link konta ---------- */
:where(.ewc-atc__button, button.ewc-atc, a.ewc-atc) { display: inline-flex; align-items: center; justify-content: center; gap: .5em; cursor: pointer; }
:where(.ewc-atc--icon) { padding: 0; }
:where(.ewc-atc--qty) { display: flex; align-items: stretch; gap: .5em; }
.ewc-atc.ewc-is-loading, .ewc-atc__button.ewc-is-loading { opacity: .6; pointer-events: none; }
.ewc-atc--oos[disabled] { cursor: not-allowed; opacity: .6; }
.ewc-atc__icon { display: inline-flex; line-height: 1; }
.ewc-atc__icon[hidden] { display: none; }

:where(.ewc-pimg) { display: block; position: relative; overflow: hidden; }
.ewc-pimg > img { display: block; width: 100%; height: 100%; }
.ewc-pimg__hover { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease; }
.ewc-pimg--hover:hover .ewc-pimg__hover { opacity: 1; }
@media (hover: none) { .ewc-pimg__hover { display: none; } }

:where(.ewc-line) { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; }
.ewc-line[hidden] { display: none !important; }
.ewc-line__label small.ewc-line__method { display: block; font-size: .8em; opacity: .75; }
:where(.ewc-line__remove) { background: none; border: 0; padding: 0; margin-left: .4em; font: inherit; font-size: .85em; text-decoration: underline; cursor: pointer; color: inherit; }
.ewc-line__value { white-space: nowrap; }

:where(.ewc-account-link) { display: inline-flex; align-items: center; gap: .5em; }

/* Neutralizacja domyślnych stylów kasy Bricks/Woo, które BU zerował (#payment z tłem i paddingiem, przycisk z line-height 60px). */
.woocommerce-checkout .ewc-payment #payment.ewc-payment__inner { padding: 0; background: none; border-radius: 0; }
.woocommerce-checkout .ewc-place-order .button.ewc-place-order__button { line-height: 1.2; }
/* WooCommerce po `added_to_cart` dokleja link „Zobacz koszyk” obok przycisku – przy EW stan pokazuje sam przycisk. */
.ewc-atc + a.added_to_cart.wc-forward, .ewc-atc a.added_to_cart.wc-forward { display: none; }
