/**
 * Pagină produs: „Alte variante” + accesorii cross-sell (Pachet smart).
 * Layout: coloană unică pe mobil/tabletă; două coloane doar pe ecrane late,
 * doar când există ambele blocuri (clasă --split din EJS).
 */

.product-detail-page .product-page-crossell .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.product-detail-page .product-variants-crossell-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  width: 100%;
  min-width: 0;
  position: relative;
  z-index: 2;
}

@media (min-width: 1180px) {
  .product-detail-page .product-variants-crossell-wrap--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
    gap: 1.25rem;
    align-items: start;
  }
}

.product-detail-page .product-variants-crossell-wrap .product-variant-options {
  margin-bottom: 0;
}

.product-detail-page .product-variant-options {
  margin-bottom: 0;
}

.product-detail-page .variant-options-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
}

.product-detail-page .variant-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.75rem;
}

.product-detail-page .variant-option-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.product-detail-page .variant-option-card:hover {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.18);
  transform: translateY(-2px);
}

.product-detail-page .variant-option-card:focus-visible {
  outline: 2px solid var(--primary, #6366f1);
  outline-offset: 2px;
}

.product-detail-page .variant-option-image {
  aspect-ratio: 1;
  background: var(--bg-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-detail-page .variant-option-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.35rem;
}

.product-detail-page .variant-option-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
}

.product-detail-page .variant-option-footer {
  padding: 0.5rem 0.6rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.product-detail-page .variant-option-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-detail-page .variant-option-name {
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 0.1rem;
}

.product-detail-page .variant-option-label {
  opacity: 0.85;
  margin-right: 0.25rem;
}

.product-detail-page .variant-option-footer .variant-option-price {
  color: var(--primary-light, #818cf8);
  font-weight: 700;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

html.light-mode .product-detail-page .variant-option-footer {
  background: rgba(0, 0, 0, 0.04);
}

/* ——— Cross-sell (marketing + CTA) ——— */

@keyframes pds-crossell-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pds-crossell-badge-glow {
  0%,
  100% {
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.38);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 4px 18px rgba(147, 51, 234, 0.5);
    filter: brightness(1.06);
  }
}

@keyframes pds-crossell-cta-nudge {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.95;
  }
  50% {
    transform: translateX(3px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-detail-page .product-page-crossell--animated,
  .product-detail-page .product-page-crossell--animated .product-page-crossell-item,
  .product-detail-page .product-page-crossell-badge,
  .product-detail-page .product-page-crossell-cta {
    animation: none !important;
  }
}

.product-detail-page .product-page-crossell {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(99, 102, 241, 0.38);
  background: linear-gradient(
    155deg,
    rgba(99, 102, 241, 0.16) 0%,
    var(--bg-glass) 38%,
    var(--bg-darker) 100%
  );
  color: var(--text-primary);
  padding: 1.1rem 1.1rem 1.15rem;
  box-shadow:
    0 10px 36px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.product-detail-page .product-page-crossell--animated {
  animation: pds-crossell-reveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.product-detail-page .product-page-crossell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #6366f1);
  background-size: 200% 100%;
  opacity: 0.85;
  pointer-events: none;
}

.product-detail-page .product-page-crossell-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(115deg, #4f46e5 0%, #7c3aed 45%, #a855f7 100%);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.38);
  animation: pds-crossell-badge-glow 2.8s ease-in-out infinite;
}

.product-detail-page .product-page-crossell-badge i {
  font-size: 0.75rem;
  opacity: 0.95;
}

.product-detail-page .product-page-crossell-title {
  margin: 0;
  font-size: 1.14rem;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .product-detail-page .product-page-crossell-title {
    background: linear-gradient(
      120deg,
      var(--text-primary) 0%,
      var(--text-primary) 52%,
      var(--primary-light, #a5b4fc) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }

  html.light-mode .product-detail-page .product-page-crossell-title {
    background: linear-gradient(120deg, #0f172a 0%, #334155 72%, #4f46e5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.product-detail-page .product-page-crossell-hint {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 36ch;
}

.product-detail-page .product-page-crossell-hint strong {
  color: var(--text-primary);
  font-weight: 700;
}

.product-detail-page .product-page-crossell-cta {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-light, #a5b4fc);
  letter-spacing: 0.02em;
  animation: pds-crossell-cta-nudge 2.2s ease-in-out infinite;
}

.product-detail-page .product-page-crossell-cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.35), rgba(124, 58, 237, 0.45));
  border: 1px solid rgba(99, 102, 241, 0.45);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.product-detail-page .product-page-crossell-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
  width: 100%;
}

.product-detail-page .product-page-crossell-item {
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.product-detail-page .product-page-crossell--animated .product-page-crossell-item {
  animation: pds-crossell-reveal 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.product-detail-page .product-page-crossell--animated .product-page-crossell-item:nth-child(1) {
  animation-delay: 0.07s;
}

.product-detail-page .product-page-crossell--animated .product-page-crossell-item:nth-child(2) {
  animation-delay: 0.14s;
}

.product-detail-page .product-page-crossell--animated .product-page-crossell-item:nth-child(3) {
  animation-delay: 0.21s;
}

.product-detail-page .product-page-crossell--animated .product-page-crossell-item:nth-child(4) {
  animation-delay: 0.28s;
}

.product-detail-page .product-page-crossell--animated .product-page-crossell-item:nth-child(5) {
  animation-delay: 0.35s;
}

.product-detail-page .product-page-crossell-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.7rem;
  row-gap: 0.5rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 0;
}

@media (max-width: 420px) {
  .product-detail-page .product-page-crossell-row {
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
      'thumb meta'
      'step step';
  }

  .product-detail-page .product-page-crossell-thumb {
    grid-area: thumb;
    width: 44px;
    height: 44px;
  }

  .product-detail-page .product-page-crossell-meta {
    grid-area: meta;
  }

  .product-detail-page .product-page-crossell-stepper {
    grid-area: step;
    width: 100%;
    max-width: 100%;
    justify-content: space-between;
    margin-top: 0.15rem;
  }
}

.product-detail-page .product-page-crossell-row:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.product-detail-page .product-page-crossell-row.is-in-cart {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.product-detail-page .product-page-crossell-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  text-decoration: none;
}

.product-detail-page .product-page-crossell-thumb:focus-visible {
  outline: 2px solid var(--primary, #6366f1);
  outline-offset: 2px;
}

.product-detail-page .product-page-crossell-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-page .product-page-crossell-meta {
  min-width: 0;
  overflow: hidden;
}

.product-detail-page .product-page-crossell-pill {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.18);
  padding: 0.14rem 0.4rem;
  border-radius: 5px;
  margin-bottom: 0.18rem;
}

.product-detail-page .product-page-crossell-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-detail-page .product-page-crossell-price {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 0.15rem;
}

.product-detail-page .product-page-crossell-per {
  font-weight: 600;
  font-size: 0.72rem;
  opacity: 0.85;
}

.product-detail-page .product-page-crossell-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.15rem 0.25rem 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
}

.product-detail-page .product-page-crossell-minus,
.product-detail-page .product-page-crossell-plus {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  transition: transform 0.12s, opacity 0.15s;
  -webkit-text-fill-color: currentColor;
}

.product-detail-page .product-page-crossell-minus:focus-visible,
.product-detail-page .product-page-crossell-plus:focus-visible {
  outline: 2px solid var(--primary, #6366f1);
  outline-offset: 2px;
}

.product-detail-page .product-page-crossell-minus {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.product-detail-page .product-page-crossell-plus {
  background: linear-gradient(145deg, var(--primary), #7c3aed);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.product-detail-page .product-page-crossell-plus:hover:not(:disabled) {
  transform: scale(1.05);
}

.product-detail-page .product-page-crossell-minus:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.product-detail-page .product-page-crossell-minus:disabled,
.product-detail-page .product-page-crossell-plus:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.product-detail-page .product-page-crossell-minus i,
.product-detail-page .product-page-crossell-plus i {
  pointer-events: none;
}

.product-detail-page .product-page-crossell-qty {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

html.light-mode .product-detail-page .product-page-crossell-stepper {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

html.light-mode .product-detail-page .product-page-crossell-minus {
  background: #fff;
  color: #334155;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

html.light-mode .product-detail-page .product-page-crossell-minus:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}

html.light-mode .product-detail-page .product-page-crossell-plus {
  background: linear-gradient(145deg, #4f46e5, #7c3aed);
  color: #fff;
}

html.light-mode .product-detail-page .product-page-crossell-qty {
  color: #0f172a;
}

/* Subsol coloană dreaptă: preț / TBI / CTA rămân vizual sub zona variante + cross-sell */
.product-detail-page .product-price-box,
.product-detail-page .tbi-calculator-block,
.product-detail-page .product-actions {
  position: relative;
  z-index: 1;
}
