/* ═══════════════════════════════════════════
   KOSZYK V2 — Redesign
   Dodaj te style na końcu english_puzzle.css
   ═══════════════════════════════════════════ */

/* --- Reset: ukrycie starych stylów koszyka blokowego --- */
.koszyk-v2 .wp-block-woocommerce-cart,
.koszyk-v2 .wc-block-cart,
.koszyk-v2 .wc-block-cart-items {
  display: none !important;
}

/* --- Layout bazowy --- */
.koszyk-v2 {
  background: var(--primary-bg);
  padding: 2rem 0 4rem;
  min-height: 60vh;
}

/* ─────────────────────────────────
   PUSTY KOSZYK
   ───────────────────────────────── */
.koszyk-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem 5rem;
  gap: 2rem;
}

.koszyk-empty__visual {
  position: relative;
  max-width: 280px;
  animation: floatHippo 4s ease-in-out infinite;
}

@keyframes floatHippo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.koszyk-empty__hippo {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(88, 58, 240, 0.15));
}

.koszyk-empty__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--secondary-text);
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.koszyk-empty__msg {
  font-size: 1.25rem;
  font-weight: 600;
  color: #555;
  margin: 0 0 2rem;
}

/* ─────────────────────────────────
   NAGŁÓWEK KOSZYKA (pełny)
   ───────────────────────────────── */
.koszyk-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.koszyk-header__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3rem);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0;
  margin-bottom: 30px;
  line-height: 1;
}

.koszyk-header__count {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-text);
  background: rgba(88, 58, 240, 0.1);
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
}

.koszyk-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-text) !important;
  text-decoration: none !important;
  transition: gap 0.3s ease;
}

.koszyk-back:hover {
  gap: 0.75rem;
}

.koszyk-back__icon {
  font-size: 1.3em;
  line-height: 1;
}

/* ─────────────────────────────────
   GRID: produkty + podsumowanie
   ───────────────────────────────── */
.koszyk-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 991px) {
  .koszyk-layout {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────
   KARTA PRODUKTU
   ───────────────────────────────── */
.koszyk-products {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.koszyk-item {
  display: grid;
  grid-template-columns: 100px 1fr auto auto;
  grid-template-rows: auto;
  grid-template-areas:
    "thumb info qty total";
  gap: 1rem 1.25rem;
  align-items: center;
  background: #fff;
  border: 2px solid #000;
  border-radius: 25px;
  padding: 1.25rem 1.5rem;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: slideInItem 0.4s ease both;
  animation-delay: var(--item-delay, 0s);
}

@keyframes slideInItem {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.koszyk-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88, 58, 240, 0.08);
}

/* Usuwanie */
.koszyk-item__remove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #999;
  text-decoration: none !important;
  transition: all 0.2s ease;
  z-index: 2;
}

.koszyk-item__remove:hover {
  background: var(--five-bg);
  color: #fff !important;
  transform: scale(1.15);
}

/* Miniatura */
.koszyk-item__thumb {
  grid-area: thumb;
  display: block;
  width: 100px;
  height: 100px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--four-bg);
  flex-shrink: 0;
}

.koszyk-item__thumb img,
.koszyk-item__thumb .koszyk-item__img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  border-radius: 16px;
  transition: transform 0.3s ease;
}

.koszyk-item__thumb:hover img,
.koszyk-item__thumb:hover .koszyk-item__img {
  transform: scale(1.08);
}

/* Info */
.koszyk-item__info {
  grid-area: info;
  min-width: 0;
}

.koszyk-item__name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--secondary-text) !important;
  text-decoration: none !important;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  transition: color 0.2s ease;
}

.koszyk-item__name:hover {
  color: var(--primary-text) !important;
}

.koszyk-item__price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.koszyk-item__price-old {
  text-decoration: line-through;
  color: #999;
  font-size: 0.85rem;
}

.koszyk-item__price-current {
  font-weight: 700;
  color: var(--primary-text);
}

/* Ilość - Stepper */
.koszyk-item__qty {
  grid-area: qty;
}

.koszyk-item__qty-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin-bottom: 0.35rem;
  text-align: center;
}

.koszyk-qty-stepper {
  display: flex;
  align-items: center;
  border: 2px solid #000;
  border-radius: 50px;
  overflow: hidden;
  height: 42px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.koszyk-qty-stepper:focus-within {
  border-color: var(--primary-text);
  box-shadow: 0 0 0 3px rgba(88, 58, 240, 0.15);
}

.koszyk-qty-stepper--pulse {
  animation: pulseStepper 0.2s ease;
}

@keyframes pulseStepper {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.koszyk-qty-stepper__btn {
  width: 38px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--secondary-text);
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.koszyk-qty-stepper__btn:hover {
  background: var(--third-bg);
}

.koszyk-qty-stepper__btn:active {
  background: var(--primary-text);
  color: #fff;
}

.koszyk-qty-stepper__input {
  width: 40px;
  text-align: center;
  border: none;
  background: transparent;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--secondary-text);
  padding: 0;
  -moz-appearance: textfield;
}

.koszyk-qty-stepper__input::-webkit-outer-spin-button,
.koszyk-qty-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Suma pozycji */
.koszyk-item__total {
  grid-area: total;
  text-align: right;
  padding-right: 1.5rem;
}

.koszyk-item__total-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin-bottom: 0.35rem;
}

.koszyk-item__total-value {
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--secondary-text);
}

/* Aktualizuj koszyk */
.koszyk-update {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* ─────────────────────────────────
   PODSUMOWANIE (sidebar)
   ───────────────────────────────── */
.koszyk-summary {
  position: sticky;
  top: 2rem;
}

.koszyk-summary__inner {
  background: #fff;
  border: 2px solid #000;
  border-radius: 25px;
  padding: 2rem;
}

.koszyk-summary__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 900;
  font-size: 1.35rem;
  text-transform: uppercase;
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
}

.koszyk-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.6rem 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.koszyk-summary__value {
  font-weight: 700;
}

.koszyk-summary__value--note {
  font-size: 0.8rem;
  font-weight: 500;
  color: #888;
  font-style: italic;
}

.koszyk-summary__row--discount .koszyk-summary__value {
  color: #22a867;
}

.koszyk-summary__divider {
  height: 2px;
  background: #000;
  margin: 1rem 0;
  border-radius: 2px;
}

.koszyk-summary__row--total {
  font-size: 1.2rem;
  font-weight: 900;
  padding: 0.75rem 0 1.25rem;
}

.koszyk-summary__row--total .koszyk-summary__value {
  font-size: 1.4rem;
  color: var(--primary-text);
}

/* Trust badge */
.koszyk-summary__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
}

.koszyk-summary__trust svg {
  color: #22a867;
  flex-shrink: 0;
}

/* Mascot pod podsumowaniem */
.koszyk-summary__mascot {
  max-width: 200px;
  margin: 2rem auto 0;
  animation: floatHippo 4s ease-in-out infinite;
}

.koszyk-summary__mascot img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(88, 58, 240, 0.12));
}

/* ─────────────────────────────────
   PRZYCISKI
   ───────────────────────────────── */
.koszyk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  text-decoration: none !important;
  border-radius: 50px;
  padding: 0.85rem 2rem;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid #000;
  line-height: 1.2;
}

.koszyk-btn--primary {
  background: var(--third-bg);
  color: #000 !important;
}

.koszyk-btn--primary:hover {
  background: var(--primary-text);
  border-color: var(--primary-text);
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(88, 58, 240, 0.25);
}

.koszyk-btn--primary:active {
  transform: translateY(0);
}

.koszyk-btn__arrow {
  font-size: 1.2em;
  transition: transform 0.25s ease;
}

.koszyk-btn--primary:hover .koszyk-btn__arrow {
  transform: translateX(4px);
}

.koszyk-btn--outline {
  background: transparent;
  color: #000 !important;
  font-size: 0.85rem;
  padding: 0.6rem 1.5rem;
}

.koszyk-btn--outline:hover {
  background: var(--primary-bg);
}

.koszyk-btn--full {
  width: 100%;
  text-align: center;
}

/* ─────────────────────────────────
   RESPONSYWNOŚĆ
   ───────────────────────────────── */
@media (max-width: 991px) {
  .koszyk-summary {
    position: static;
  }

  .koszyk-summary__mascot {
    display: none;
  }
}

@media (max-width: 767px) {
  .koszyk-v2 {
    padding: 1rem 0 3rem;
  }

  .koszyk-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .koszyk-item {
    grid-template-columns: 80px 1fr;
    grid-template-areas:
      "thumb info"
      "qty   total";
    gap: 0.75rem 1rem;
    padding: 1rem;
    padding-top: 2.5rem;
  }

  .koszyk-item__thumb {
    width: 80px;
    height: 80px;
  }

  .koszyk-item__qty {
    justify-self: start;
    z-index: 2;
  }

  .koszyk-item__qty-label {
    text-align: left;
  }

  .koszyk-item__total {
    text-align: right;
    align-self: center;
    padding-right: 0;
  }

  .koszyk-item__remove {
    top: 8px;
    right: 8px;
  }

  .koszyk-update {
    justify-content: center;
  }
}

@media (max-width: 479px) {
  .koszyk-header__title {
    font-size: 1.75rem;
  }

  .koszyk-item {
    grid-template-columns: 70px 1fr;
    padding: 0.85rem;
    padding-top: 2.25rem;
  }

  .koszyk-item__thumb {
    width: 70px;
    height: 70px;
  }

  .koszyk-item__name {
    font-size: 0.9rem;
  }

  .koszyk-summary__inner {
    padding: 1.25rem;
  }
}

/* ─────────────────────────────────
   UKRYCIE STARYCH ELEMENTÓW
   ───────────────────────────────── */
/* Na wypadek gdyby stare elementy nadal się renderowały */
.koszyk-v2 .panel_right_cart,
.koszyk-v2 .content-cart,
.koszyk-v2 .cart_bg,
.koszyk-v2 .cart_right,
.koszyk-v2 .cart_left {
  display: none !important;
}