/* Panel „Dodano do koszyka” wysuwany z prawej (js/amix-cart-drawer.js) */
html.amix-cd-lock, html.amix-cd-lock body { overflow: hidden; }
.amix-cd[hidden] { display: none; }
.amix-cd { position: fixed; inset: 0; z-index: 100000; font-family: inherit; color: #222; }
.amix-cd__backdrop { position: absolute; inset: 0; background: rgba(17, 17, 17, .45); opacity: 0; transition: opacity .25s ease; }
.amix-cd__panel { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(460px, 100%); background: #fff; box-shadow: -12px 0 40px rgba(0, 0, 0, .14); transform: translateX(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); outline: 0; }
.amix-cd.is-open .amix-cd__backdrop { opacity: 1; }
.amix-cd.is-open .amix-cd__panel { transform: none; }
@media (prefers-reduced-motion: reduce) { .amix-cd__panel, .amix-cd__backdrop { transition: none; } }

.amix-cd__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px 24px; border-bottom: 1px solid #eee; }
.amix-cd__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2; }
.amix-cd__ok { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e8f5ed; color: #1a7f45; }
.amix-cd__close { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #222; cursor: pointer; }
.amix-cd__close:hover { background: #f2f2f2; }
.amix-cd__close:focus-visible, .amix-cd__btn:focus-visible, .amix-cd__rec:focus-visible { outline: 2px solid #c8102e; outline-offset: 2px; }

.amix-cd__scroll { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 18px 24px 28px; }

.amix-cd__ship { min-height: 44px; margin-bottom: 18px; }
.amix-cd__ship p { margin: 0 0 8px; font-size: 14px; line-height: 1.35; color: #444; }
.amix-cd__ship strong { color: #222; }
.amix-cd__bar { height: 6px; overflow: hidden; border-radius: 6px; background: #eee; }
.amix-cd__bar span { display: block; height: 100%; border-radius: inherit; background: #1f6fd1; transition: width .5s ease, background-color .3s; } /* niebieski do progu – czerwony kojarzy się z błędem */
.amix-cd__ship.is-free strong { color: #1a7f45; }
.amix-cd__ship.is-free .amix-cd__bar span { background: #1a7f45; }

.amix-cd__item { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 14px; min-height: 76px; padding: 14px; border: 1px solid #ececec; border-radius: 14px; }
.amix-cd__thumb { display: block; width: 76px; height: 76px; }
.amix-cd__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.amix-cd__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.amix-cd__name { color: #222; font-size: 14px; font-weight: 700; line-height: 1.3; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.amix-cd__name:hover { text-decoration: underline; }
.amix-cd__variant { font-size: 13px; color: #555; }
.amix-cd__qty { font-size: 12.5px; color: #777; }
.amix-cd__price { align-self: start; font-size: 15px; font-weight: 700; white-space: nowrap; }
.amix-cd__note { margin: 0; font-size: 14px; color: #444; }
.amix-cd__skeleton { grid-column: 1 / -1; height: 76px; border-radius: 10px; background: linear-gradient(90deg, #f3f3f3 25%, #fafafa 50%, #f3f3f3 75%); background-size: 200% 100%; animation: amix-cd-sk 1.1s linear infinite; }
@keyframes amix-cd-sk { to { background-position: -200% 0; } }

.amix-cd__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.amix-cd__btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; padding: 0 14px; border-radius: 12px; font: inherit; font-size: 14.5px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.amix-cd__btn--ghost { border: 1px solid #d9d9d9; background: #fff; color: #222; }
.amix-cd__btn--ghost:hover { border-color: #222; }
.amix-cd__btn--primary { border: 1px solid #c8102e; background: #c8102e; color: #fff !important; }
.amix-cd__btn--primary:hover { border-color: #a50b22; background: #a50b22; }
.amix-cd__btn svg { flex: 0 0 auto; }


@media (max-width: 480px) {
  .amix-cd__head { padding: 14px 12px 12px 18px; }
  .amix-cd__title { font-size: 17px; }
  .amix-cd__scroll { padding: 16px 18px 24px; }
  .amix-cd__item { grid-template-columns: 64px 1fr; gap: 12px; padding: 12px; }
  .amix-cd__thumb { width: 64px; height: 64px; }
  .amix-cd__price { grid-column: 2; }
  .amix-cd__actions { grid-template-columns: 1fr; }
  .amix-cd__actions .amix-cd__btn--primary { order: -1; }
}

/* ---------- Widoki: „Wybierz smak” / „Dodano do koszyka” ---------- */
.amix-cd:not([data-view="pick"]) .amix-cd__view--pick,
.amix-cd:not([data-view="cart"]) .amix-cd__view--cart { display: none !important; }
.amix-cd__title .amix-cd__ok { flex: 0 0 auto; }

/* produkt nad listą wariantów */
.amix-cd__prod { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; color: #222; text-decoration: none; }
.amix-cd__prod img { flex: 0 0 auto; width: 56px; height: 56px; object-fit: contain; }
.amix-cd__prod span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.amix-cd__prod strong { font-size: 14px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.amix-cd__prod em { font-style: normal; font-size: 14px; font-weight: 700; color: #555; }
.amix-cd__prod:hover strong { text-decoration: underline; }

/* lista wariantów */
.amix-cd__vars { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.amix-cd__var { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; margin: 0; padding: 8px 12px 8px 18px; border: 1px solid transparent; border-radius: 12px; background: #f5f5f5; cursor: pointer; transition: background .15s, border-color .15s; list-style: none; }
.amix-cd__var:hover { background: #efefef; }
.amix-cd__var.is-on { border-color: #c8102e; background: #fff; }
.amix-cd__var-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.25; color: #222; }
.amix-cd__var-name small { font-size: 12.5px; font-weight: 600; color: #666; }
.amix-cd__var.is-out { cursor: default; background: #fafafa; }
.amix-cd__var.is-out .amix-cd__var-name { color: #aaa; font-weight: 600; }
.amix-cd__out { flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; background: #eee; color: #777; font-size: 12px; font-weight: 600; }

.amix-cd__step { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; cursor: default; }
.amix-cd__step button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid #d0d0d0; border-radius: 50%; background: #fff; color: #222; cursor: pointer; transition: border-color .15s, color .15s; }
.amix-cd__step button:not(:disabled):hover { border-color: #c8102e; color: #c8102e; }
.amix-cd__step button:disabled { border-color: #e4e4e4; color: #c4c4c4; cursor: default; }
.amix-cd__step button:focus-visible { outline: 2px solid #c8102e; outline-offset: 2px; }
.amix-cd__step output { min-width: 26px; font-size: 16px; font-weight: 700; text-align: center; color: #222; }
.amix-cd__var.is-on .amix-cd__step output { color: #c8102e; }

/* stopka z „Dodaj do koszyka” */
.amix-cd__foot { flex: 0 0 auto; padding: 12px 24px 18px; border-top: 1px solid #eee; background: #fff; }
.amix-cd__msg { margin: 0; font-size: 13px; line-height: 1.35; color: #555; }
.amix-cd__msg:not(:empty) { margin-bottom: 8px; }
.amix-cd__msg.is-error, .amix-cd__note.is-error { color: #a50b22; }
.amix-cd__msg a { color: inherit; text-decoration: underline; }
.amix-cd__btn--wide { width: 100%; min-height: 54px; justify-content: space-between; padding: 0 20px; font-size: 15px; }
.amix-cd__btn--primary:disabled { border-color: #e2e2e2; background: #e2e2e2; color: #8a8a8a !important; cursor: not-allowed; }
.amix-cd__panel.is-busy .amix-cd__vars, .amix-cd__panel.is-busy [data-cd-add] { pointer-events: none; opacity: .6; }

.amix-cd__items { display: flex; flex-direction: column; gap: 8px; }
.amix-cd__items .amix-cd__note { margin: 4px 0 0; font-size: 13px; }
.amix-cd [data-cd-pick] .amix-cd__skeleton { height: 60px; margin-bottom: 8px; }

@media (max-width: 480px) {
  .amix-cd__var { min-height: 56px; padding: 6px 8px 6px 14px; }
  .amix-cd__var-name { font-size: 14px; }
  .amix-cd__step button { width: 34px; height: 34px; }
  .amix-cd__foot { padding: 10px 18px calc(14px + env(safe-area-inset-bottom)); }
  .amix-cd__btn--wide { font-size: 14px; padding: 0 16px; }
}

/* ---------- Widok „Twój koszyk” (ikona koszyka w nagłówku) ---------- */
.amix-cd:not([data-view="bag"]) .amix-cd__view--bag { display: none !important; }
.amix-cd__count { color: #777; font-weight: 600; }

.amix-cd__lines { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.amix-cd__line { display: grid; grid-template-columns: 72px 1fr auto; align-items: start; gap: 14px; margin: 0; padding: 16px 0; border-bottom: 1px solid #eee; list-style: none; transition: opacity .15s; }
.amix-cd__line:first-child { padding-top: 4px; }
.amix-cd__line:last-child { border-bottom: 0; }
.amix-cd__line .amix-cd__thumb { width: 72px; height: 72px; }
.amix-cd__line.is-busy { opacity: .45; pointer-events: none; }
.amix-cd__unit { font-size: 12.5px; color: #777; }
.amix-cd__unit del { margin-left: 4px; color: #aaa; }
.amix-cd__line-row { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.amix-cd__step--sm { gap: 4px; }
.amix-cd__step--sm button { width: 32px; height: 32px; }
.amix-cd__step--sm output { min-width: 24px; font-size: 15px; }
.amix-cd__remove { padding: 4px 0; border: 0; background: none; color: #777; font: inherit; font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.amix-cd__remove:hover { color: #c8102e; }
.amix-cd__remove:focus-visible { outline: 2px solid #c8102e; outline-offset: 2px; }
.amix-cd__line .amix-cd__price { padding-top: 1px; }

.amix-cd__sum { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; font-size: 15px; color: #444; }
.amix-cd__sum strong { font-size: 20px; font-weight: 800; color: #222; }
.amix-cd__sum--sub { margin-bottom: 4px; font-size: 13.5px; color: #1a7f45; }
.amix-cd__actions--foot { margin-top: 0; }
.amix-cd__btn--wide-c { width: 100%; }

.amix-cd__empty { padding: 40px 8px; text-align: center; color: #555; }
.amix-cd__empty p { margin: 0 0 6px; font-size: 14px; }
.amix-cd__empty strong { font-size: 17px; color: #222; }

/* stary podgląd koszyka po najechaniu – zastąpiony panelem */
.widget_shopping_cart_content .mini_mini__cart { display: none !important; visibility: hidden !important; }
.voir_cart .cart_obj { cursor: pointer; }
.voir_cart .cart_obj:focus-visible { outline: 2px solid #c8102e; outline-offset: 3px; border-radius: 10px; }

@media (max-width: 480px) {
  .amix-cd__line { grid-template-columns: 60px 1fr auto; gap: 12px; padding: 14px 0; }
  .amix-cd__line .amix-cd__thumb { width: 60px; height: 60px; }
  .amix-cd__line .amix-cd__price { grid-column: auto; }
  .amix-cd__actions--foot { grid-template-columns: 1fr 1fr; }
  .amix-cd__actions--foot .amix-cd__btn--primary { order: 0; }
  .amix-cd__actions--foot .amix-cd__btn { min-height: 48px; padding: 0 10px; font-size: 13.5px; }
  .amix-cd__sum strong { font-size: 18px; }
}

/* ---------- Polecanki (cross-selling) – „Dodano do koszyka” i „Twój koszyk” ---------- */
.amix-cd__ups { margin: 26px -24px 0; padding: 20px 24px 6px; border-top: 1px solid #eee; background: #fafafa; }
.amix-cd__ups[hidden] { display: none; }
.amix-cd__ups--bag { margin-top: 8px; }
.amix-cd__ups-title { margin: 0 0 4px; font-size: 16px; font-weight: 700; line-height: 1.3; color: #222; }
.amix-cd__ups-sub { margin: 0 0 4px; font-size: 13px; line-height: 1.4; color: #555; }
.amix-cd__ups-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.amix-cd__up { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 14px; margin: 0; padding: 12px; border: 1px solid #ececec; border-radius: 14px; background: #fff; list-style: none; }
.amix-cd__up-img { display: block; width: 72px; height: 72px; }
.amix-cd__up-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.amix-cd__up-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.amix-cd__up-name { color: #222; font-size: 13.5px; font-weight: 600; line-height: 1.3; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.amix-cd__up-name:hover { text-decoration: underline; }
.amix-cd__up-tag { padding: 3px 8px; border-radius: 999px; background: #e8f5ed; color: #1a7f45; font-size: 11.5px; font-weight: 700; line-height: 1.3; }
.amix-cd__up-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid #d0d0d0; border-radius: 10px; background: #fff; color: #222; font: inherit; font-size: 13.5px; font-weight: 700; line-height: 1.2; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.amix-cd__up-btn del { color: #999; font-size: 12px; font-weight: 500; }
.amix-cd__up-btn:not(:disabled):hover { border-color: #c8102e; color: #c8102e; }
.amix-cd__up-btn:focus-visible { outline: 2px solid #c8102e; outline-offset: 2px; }
.amix-cd__up-btn.is-loading { color: transparent; position: relative; pointer-events: none; }
.amix-cd__up-btn.is-loading del { color: transparent; }
.amix-cd__up-btn.is-loading::after { content: ''; position: absolute; inset: 0; width: 16px; height: 16px; margin: auto; border: 2px solid #ddd; border-top-color: #c8102e; border-radius: 50%; animation: amix-cd-spin .7s linear infinite; }
@keyframes amix-cd-spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .amix-cd__ups { margin-left: -18px; margin-right: -18px; padding: 18px 18px 4px; }
  .amix-cd__up { grid-template-columns: 60px 1fr; gap: 12px; padding: 10px; }
  .amix-cd__up-img { width: 60px; height: 60px; }
}
