/* ═══════════════════════════════════════════════
   CART NAV ICON
   ═══════════════════════════════════════════════ */
.tnx-nav-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #A0A8BC;
  text-decoration: none;
  transition: color .2s, background .2s;
  flex-shrink: 0;
}
.tnx-nav-cart:hover { color: #E8ECF4; background: rgba(255,255,255,.06); }
.tnx-nav-cart svg { width: 22px; height: 22px; display: block; }

.tnx-cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #8B5CF6;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
  display: none;
}
.tnx-cart-count--visible,
.tnx-cart-count:not(:empty) { display: block; }

/* ═══════════════════════════════════════════════
   CART PAGE
   ═══════════════════════════════════════════════ */
.tnx-cart-page { min-height: 60vh; }

.tnx-cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
  margin-top: 32px;
}

/* ── Cart Items ── */
.tnx-cart-items { display: flex; flex-direction: column; gap: 12px; }

.tnx-cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  background: #1A1D27;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  padding: 16px;
  transition: border-color .2s;
}
.tnx-cart-item:hover { border-color: rgba(139,92,246,.25); }

.tnx-cart-item-img {
  width: 80px;
  height: 64px;
  object-fit: contain;
  border-radius: 10px;
  background: #F0F1F3;   /* светло-серый фон для прозрачных PNG */
  border: 1px solid rgba(255,255,255,.07);
  padding: 6px;
}

.tnx-cart-item-name {
  font-size: 15px;
  font-weight: 600;
  color: #E8ECF4;
  margin-bottom: 4px;
}
.tnx-cart-item-price { font-size: 13px; color: #8B93A7; }

.tnx-cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 6px 10px;
}
.tnx-qty-btn {
  background: none;
  border: none;
  color: #A0A8BC;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  transition: color .15s;
}
.tnx-qty-btn:hover { color: #E8ECF4; }
.tnx-qty-val {
  font-size: 15px;
  font-weight: 600;
  color: #E8ECF4;
  min-width: 22px;
  text-align: center;
}
/* Editable qty input */
input.tnx-qty-val {
  width: 36px;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  -moz-appearance: textfield;
}
input.tnx-qty-val::-webkit-inner-spin-button,
input.tnx-qty-val::-webkit-outer-spin-button { -webkit-appearance: none; }

.tnx-cart-item-total {
  font-size: 15px;
  font-weight: 700;
  color: #E8ECF4;
  min-width: 90px;
  text-align: right;
}

.tnx-cart-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,.25);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color .15s, background .15s;
  display: flex;
  align-items: center;
}
.tnx-cart-remove:hover { color: #EF4444; background: rgba(239,68,68,.1); }
.tnx-cart-remove svg { width: 18px; height: 18px; }

/* ── Summary box ── */
.tnx-cart-summary-box {
  background: #1A1D27;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 20px;
  padding: 28px;
  position: sticky;
  top: 82px;
}
.tnx-cart-summary-title {
  font-size: 18px;
  font-weight: 700;
  color: #E8ECF4;
  margin-bottom: 20px;
}
.tnx-cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #8B93A7;
  margin-bottom: 12px;
}
.tnx-cart-summary-total {
  font-size: 18px;
  font-weight: 700;
  color: #E8ECF4;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  margin-bottom: 20px;
  margin-top: 8px;
}
.tnx-cart-checkout {
  width: 100%;
  justify-content: center;
  font-size: 16px;
  padding: 14px;
  margin-bottom: 12px;
}
.tnx-cart-continue {
  display: block;
  text-align: center;
  color: #8B93A7;
  font-size: 13px;
  text-decoration: none;
  transition: color .2s;
}
.tnx-cart-continue:hover { color: #E8ECF4; }

/* ── Empty cart ── */
.tnx-cart-empty {
  text-align: center;
  padding: 80px 20px;
  color: #8B93A7;
}
.tnx-cart-empty svg { width: 80px; height: 80px; margin: 0 auto 24px; display: block; }
.tnx-cart-empty p { font-size: 18px; margin-bottom: 24px; }

/* ── Add to cart button feedback ── */
.tnx-btn--added {
  background: rgba(34,197,94,.2) !important;
  border-color: rgba(34,197,94,.4) !important;
  color: #4ADE80 !important;
}

/* ════════════════════════════════════════════
   CART MODAL (glassmorphism)
   ════════════════════════════════════════════ */

/* Сброс box-sizing и шрифта — модалка добавляется вне .tnx-wrap,
   поэтому глобальный reset туда не попадает */
.tnx-modal-overlay,
.tnx-modal-overlay * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', Arial, sans-serif;
}

.tnx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.tnx-modal-overlay.tnx-modal-visible {
  opacity: 1;
  pointer-events: all;
}

.tnx-modal {
  position: relative;
  background: rgba(18, 20, 30, .88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 28px;
  padding: 44px 36px 32px;
  max-width: 400px;
  width: 100%;
  color: #E8ECF4;
  line-height: 1.5;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(255,255,255,.04) inset;
  transform: scale(.88) translateY(24px);
  transition: transform .32s cubic-bezier(.34, 1.45, .64, 1);
  overflow: hidden;
}
.tnx-modal-overlay.tnx-modal-visible .tnx-modal {
  transform: scale(1) translateY(0);
}

/* ── Glow accent (сверху) ── */
.tnx-modal::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 160px;
  background: radial-gradient(ellipse, rgba(139,92,246,.3) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Close button ── */
.tnx-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: #8B93A7;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: background .2s, color .2s;
  -webkit-appearance: none;
  appearance: none;
  font-family: 'Inter', Arial, sans-serif;
}
.tnx-modal-close:hover { background: rgba(255,255,255,.13); color: #E8ECF4; }

/* ── Check circle ── */
.tnx-modal-check {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(34,197,94,.22) 0%, rgba(34,197,94,.05) 100%);
  border: 1.5px solid rgba(34,197,94,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  animation: tnxCheckPop .38s cubic-bezier(.34,1.6,.64,1) both;
}
.tnx-modal-check svg { width: 28px; height: 28px; display: block; }
@keyframes tnxCheckPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Title ── */
.tnx-modal-title {
  font-size: 19px;
  font-weight: 800;
  color: #E8ECF4;
  text-align: center;
  margin-bottom: 0;
  letter-spacing: -.25px;
  font-family: 'Inter', Arial, sans-serif;
}

/* ── Product row ── */
.tnx-modal-product {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 18px 0 12px;
}
.tnx-modal-product-img {
  width: 54px;
  height: 46px;
  object-fit: contain;
  border-radius: 6px;
  background: transparent;   /* убираем тёмный фон — PNG прозрачный */
  flex-shrink: 0;
  display: block;
}
.tnx-modal-product-name {
  font-size: 13px;
  font-weight: 600;
  color: #E8ECF4;
  line-height: 1.35;
  flex: 1;
  font-family: 'Inter', Arial, sans-serif;
}
.tnx-modal-product-price {
  font-size: 15px;
  font-weight: 700;
  color: #A78BFA;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'Inter', Arial, sans-serif;
}

/* ── Cart summary line ── */
.tnx-modal-summary {
  font-size: 12px;
  color: #6B7385;
  text-align: center;
  margin-bottom: 20px;
  font-family: 'Inter', Arial, sans-serif;
}
.tnx-modal-summary strong { color: #A0A8BC; font-weight: 600; }

/* ── Action buttons ── */
.tnx-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Основная кнопка «Перейти в корзину» */
.tnx-modal-actions a.tnx-btn-purple,
.tnx-modal-actions .tnx-btn-purple {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7C3AED, #9F67FF);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
  font-family: 'Inter', Arial, sans-serif;
  box-shadow: 0 8px 24px rgba(124,58,237,.45);
  letter-spacing: -.1px;
}
.tnx-modal-actions a.tnx-btn-purple:hover,
.tnx-modal-actions .tnx-btn-purple:hover {
  opacity: .9;
  transform: translateY(-1px);
}

/* Вторичная кнопка «Продолжить покупки» */
.tnx-modal-continue {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 20px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: #8B93A7;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s;
  -webkit-appearance: none;
  appearance: none;
  font-family: 'Inter', Arial, sans-serif;
}
.tnx-modal-continue:hover {
  background: rgba(255,255,255,.09);
  color: #C4C9D8;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .tnx-modal { padding: 36px 20px 24px; border-radius: 22px; }
  .tnx-modal-title { font-size: 17px; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .tnx-cart-layout { grid-template-columns: 1fr; }

  .tnx-cart-item {
    grid-template-columns: 72px 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 12px;
    padding: 14px;
  }

  /* Картинка занимает обе строки слева */
  .tnx-cart-item-img {
    width: 72px;
    height: 72px;
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
  }

  /* Название + цена — правее картинки, первая строка */
  .tnx-cart-item-info {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;        /* важно для обрезки длинного текста */
  }
  .tnx-cart-item-name {
    font-size: 14px;
    white-space: normal;   /* пусть переносится, не обрезаем */
  }

  /* Сумма строки — правый верхний угол */
  .tnx-cart-item-total {
    grid-column: 3;
    grid-row: 1;
    font-size: 14px;
    min-width: auto;
    text-align: right;
    align-self: start;
  }

  /* Счётчик количества — под названием, не растягивается */
  .tnx-cart-item-qty {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: start;   /* не растягивать на всю ширину ячейки */
    width: fit-content;
    padding: 4px 8px;
  }

  /* Кнопка удаления — правый нижний угол */
  .tnx-cart-remove {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    align-self: end;
  }
}
