/* Traktor cart FBT modal — Do tego często wybierają */

/*
 * Theme sets `.modal-dialog { margin: 16px; }` (left-biased).
 * Do NOT use left:50% + translateX — that doubles offset when margin:auto already centers.
 */
#traktorCartFbtModal.modal {
  z-index: 1060;
}

#traktorCartFbtModal.modal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  /* Pełnoekranowa powłoka .modal nie może blokować kosza / delete za dialogiem. */
  pointer-events: none;
}

#traktorCartFbtModal .modal-dialog.traktor-cart-fbt-dialog {
  max-width: 760px;
  width: 100%;
  margin: 0 auto !important;
  position: relative;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  pointer-events: auto;
}

body.traktor-cart-fbt-open .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.55);
  opacity: 1 !important;
  display: block !important;
  pointer-events: auto;
  z-index: 1055;
}

.traktor-cart-fbt-content {
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  background: #fff;
}

.traktor-cart-fbt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e5e5e5;
  padding: 1.75rem 1.75rem 1.15rem;
}

.traktor-cart-fbt-title {
  font-family: var(--font-family-family-primary, Sora, sans-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: #000;
  margin: 0 0 0.35rem;
  line-height: 1.35;
}

.traktor-cart-fbt-subtitle {
  margin: 0;
  color: #666;
  font-family: var(--font-family-family-primary, Sora, sans-serif);
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 400;
}

.traktor-cart-fbt-close {
  padding: 0.15rem 0.45rem;
  margin: -0.25rem -0.25rem 0 0;
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 300;
  opacity: 0.65;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #000;
}

.traktor-cart-fbt-close:hover {
  opacity: 1;
}

.traktor-cart-fbt-body {
  padding: 1.15rem 1.75rem 1.75rem;
}

.traktor-cart-fbt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.traktor-cart-fbt-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  min-width: 0;
}

.traktor-cart-fbt-card__media {
  display: block;
  aspect-ratio: 1 / 1;
  background: #f6f6f6;
  overflow: hidden;
}

.traktor-cart-fbt-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.traktor-cart-fbt-card__noimg {
  display: block;
  width: 100%;
  height: 100%;
  background: #eee;
}

.traktor-cart-fbt-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem;
  flex: 1;
}

.traktor-cart-fbt-card__name {
  color: #222;
  text-decoration: none;
  font-family: var(--font-family-family-primary, Sora, sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.traktor-cart-fbt-card__name:hover {
  color: #000;
  text-decoration: underline;
}

.traktor-cart-fbt-card__price {
  font-family: var(--font-family-family-primary, Sora, sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: auto;
}

.traktor-cart-fbt-add {
  width: 100%;
  margin-top: 0.25rem;
  border: 1px solid #f2febd;
  border-radius: 4px;
  background: #e4fd71;
  color: #000;
  font-family: var(--font-family-family-primary, Sora, sans-serif);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.traktor-cart-fbt-add:hover:not(:disabled) {
  background: #d8f54f;
  border-color: #e4fd71;
  color: #000;
}

.traktor-cart-fbt-add:disabled {
  opacity: 0.7;
  cursor: default;
}

.traktor-cart-fbt-add.is-added {
  background: #1f3d2b;
  border-color: #1f3d2b;
  color: #e4fd71;
}

@media (max-width: 767.98px) {
  #traktorCartFbtModal.modal.show {
    align-items: flex-start;
    padding-top: 0.75rem;
  }

  #traktorCartFbtModal .modal-dialog.traktor-cart-fbt-dialog {
    max-width: 100%;
  }

  .traktor-cart-fbt-header,
  .traktor-cart-fbt-body {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .traktor-cart-fbt-grid {
    grid-template-columns: 1fr;
  }

  .traktor-cart-fbt-card {
    flex-direction: row;
    align-items: stretch;
  }

  .traktor-cart-fbt-card__media {
    width: 96px;
    flex: 0 0 96px;
    aspect-ratio: auto;
    min-height: 96px;
  }

  .traktor-cart-fbt-card__name {
    min-height: 0;
    -webkit-line-clamp: 3;
  }
}
