/* Dettaglio /templates/{slug} */
body.body-stage.body-stage-template-detail-marketplace {
  overflow-x: clip;
  --tpl-bg: #ffffff;
  --tpl-surface: #f6f6f6;
  --tpl-surface-2: #f2f2f0;
  --tpl-text: #141414;
  --tpl-muted: #5e5e5e;
  --tpl-border: #d8d8d8;
  --tpl-primary: #136ef5;
  --tpl-primary-hover: #0f58c4;
  --tpl-primary-dark: #0b4293;
  --tpl-info-bg: #e7f0fe;
  --tpl-radius: 8px;
  --tpl-radius-lg: 16px;
  --tpl-radius-gallery: 20px;
  --tpl-container: 1200px;
  background: var(--tpl-bg);
  color: var(--tpl-text);
}

body.body-stage-template-detail-marketplace .tpl-detail {
  padding-top: calc(64px + var(--stage-navbar-height, 4.25rem));
  padding-bottom: 72px;
}

@media (max-width: 48rem) {
  body.body-stage-template-detail-marketplace .tpl-detail {
    padding-top: calc(32px + var(--stage-navbar-height, 4.25rem));
  }
}

body.body-stage-template-detail-marketplace .tpl-detail__container {
  max-width: var(--tpl-container);
  margin: 0 auto;
  padding: 0 30px;
  text-align: left;
}

@media (max-width: 48rem) {
  body.body-stage-template-detail-marketplace .tpl-detail__container {
    padding: 0 16px;
  }
}

body.body-stage-template-detail-marketplace .tpl-detail__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 14px;
  color: var(--tpl-muted);
  margin-bottom: 20px;
}

body.body-stage-template-detail-marketplace .tpl-detail__breadcrumb-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--tpl-muted);
  text-decoration: none;
}

body.body-stage-template-detail-marketplace .tpl-detail__breadcrumb-link:hover {
  color: var(--tpl-text);
  text-decoration: underline;
}

body.body-stage-template-detail-marketplace .tpl-detail__breadcrumb-link:focus-visible {
  outline: 2px solid var(--tpl-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

body.body-stage-template-detail-marketplace .tpl-detail__header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
}

body.body-stage-template-detail-marketplace .tpl-detail__title {
  margin: 0;
  font-size: var(--fs-h1-page);
  font-weight: var(--fw-h1-page);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

body.body-stage-template-detail-marketplace .tpl-detail__meta-line {
  margin: 10px 0 0;
  font-size: 16px;
  color: var(--tpl-muted);
}

body.body-stage-template-detail-marketplace .tpl-detail__meta-link {
  color: var(--tpl-muted);
  text-decoration: none;
}

body.body-stage-template-detail-marketplace .tpl-detail__meta-link:hover {
  color: var(--tpl-text);
  text-decoration: underline;
}

body.body-stage-template-detail-marketplace .tpl-detail__header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (max-width: 48rem) {
  body.body-stage-template-detail-marketplace .tpl-detail__header-actions {
    width: 100%;
  }

  body.body-stage-template-detail-marketplace .tpl-detail__header-actions :is(.primary-button, .secondary-button) {
    flex: 1 1 calc(50% - 4px);
    min-height: 48px;
  }
}

body.body-stage-template-detail-marketplace .tpl-detail__cta--block {
  width: 100%;
}

body.body-stage-template-detail-marketplace .tpl-detail__aside-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.body-stage-template-detail-marketplace .tpl-detail__gallery {
  margin-top: 40px;
}

@media (max-width: 48rem) {
  body.body-stage-template-detail-marketplace .tpl-detail__gallery {
    margin-top: 24px;
  }
}

body.body-stage-template-detail-marketplace .tpl-detail__carousel-viewport {
  position: relative;
  overflow: hidden;
  border-radius: var(--tpl-radius-gallery);
  background: var(--tpl-surface);
}

body.body-stage-template-detail-marketplace .tpl-detail__carousel-track {
  will-change: transform;
}

@media (max-width: 48rem) {
  body.body-stage-template-detail-marketplace .tpl-detail__carousel-viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  body.body-stage-template-detail-marketplace .tpl-detail__carousel-track {
    transform: none !important;
  }

  body.body-stage-template-detail-marketplace .tpl-detail__slide {
    scroll-snap-align: start;
    flex: 0 0 100%;
  }
}

body.body-stage-template-detail-marketplace .tpl-detail__slide {
  margin: 0;
  aspect-ratio: 16 / 10;
  width: 100%;
}

body.body-stage-template-detail-marketplace .tpl-detail__slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

body.body-stage-template-detail-marketplace .tpl-detail__carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--tpl-radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--tpl-text);
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 20, 20, 0.12);
}

body.body-stage-template-detail-marketplace .tpl-detail__carousel-btn--prev {
  left: 12px;
}

body.body-stage-template-detail-marketplace .tpl-detail__carousel-btn--next {
  right: 12px;
}

body.body-stage-template-detail-marketplace .tpl-detail__thumbs-wrap--desktop {
  margin-top: 10px;
}

body.body-stage-template-detail-marketplace .tpl-detail__thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

body.body-stage-template-detail-marketplace .tpl-detail__thumb-col {
  flex: 0 0 173px;
  max-width: 173px;
}

body.body-stage-template-detail-marketplace .tpl-detail__thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--tpl-radius-lg);
  overflow: hidden;
  opacity: 0.5;
  cursor: pointer;
  background: var(--tpl-surface);
  min-height: 44px;
}

body.body-stage-template-detail-marketplace .tpl-detail__thumb.is-active {
  opacity: 1;
  border-color: var(--tpl-primary);
}

body.body-stage-template-detail-marketplace .tpl-detail__thumb:hover {
  opacity: 0.8;
}

body.body-stage-template-detail-marketplace .tpl-detail__thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  display: block;
}

body.body-stage-template-detail-marketplace .tpl-detail__thumb-label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--tpl-muted);
  text-align: center;
}

body.body-stage-template-detail-marketplace .tpl-detail__mobile-dots {
  display: none;
  margin-top: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 48rem) {
  body.body-stage-template-detail-marketplace .tpl-detail__thumbs-wrap--desktop {
    display: none;
  }

  body.body-stage-template-detail-marketplace .tpl-detail__mobile-dots {
    display: flex;
  }

  body.body-stage-template-detail-marketplace .tpl-detail__carousel-btn {
    display: none;
  }
}

body.body-stage-template-detail-marketplace .tpl-detail__dots {
  display: flex;
  gap: 8px;
}

body.body-stage-template-detail-marketplace .tpl-detail__dot {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  position: relative;
  cursor: pointer;
}

body.body-stage-template-detail-marketplace .tpl-detail__dot::after {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: var(--tpl-border);
}

body.body-stage-template-detail-marketplace .tpl-detail__dot.is-active::after {
  background: var(--tpl-primary);
}

body.body-stage-template-detail-marketplace .tpl-detail__mobile-counter {
  font-size: 14px;
  color: var(--tpl-muted);
  min-width: 3rem;
}

body.body-stage-template-detail-marketplace .tpl-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 60px;
  margin-top: 60px;
  align-items: stretch;
}

body.body-stage-template-detail-marketplace .tpl-detail__main {
  min-width: 0;
}

@media (max-width: 63.9375rem) {
  body.body-stage-template-detail-marketplace .tpl-detail__layout {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    gap: 40px;
  }

  body.body-stage-template-detail-marketplace .tpl-detail__main {
    order: 1;
  }

  body.body-stage-template-detail-marketplace .tpl-detail__aside {
    order: 2;
  }
}

body.body-stage-template-detail-marketplace .tpl-detail__aside-sticky {
  position: sticky;
  top: calc(var(--stage-navbar-height, 4.25rem) + 40px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 63.9375rem) {
  body.body-stage-template-detail-marketplace .tpl-detail__aside-sticky {
    position: static;
  }
}

body.body-stage-template-detail-marketplace .tpl-detail__card {
  border: 1px solid var(--tpl-border);
  border-radius: var(--tpl-radius-lg);
  padding: 20px;
  background: var(--tpl-bg);
}

body.body-stage-template-detail-marketplace .tpl-detail__author {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  color: inherit;
}

body.body-stage-template-detail-marketplace .tpl-detail__author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  flex-shrink: 0;
}

body.body-stage-template-detail-marketplace .tpl-detail__author picture,
body.body-stage-template-detail-marketplace .tpl-detail__author .tpl-detail__author-avatar {
  display: block;
  width: 80px;
  height: 80px;
}

body.body-stage-template-detail-marketplace .tpl-detail__author-avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--tpl-surface-2);
  color: var(--tpl-text);
  font-size: 1.25rem;
  font-weight: 600;
}

body.body-stage-template-detail-marketplace .tpl-detail__author-name {
  display: block;
  font-size: 15px;
  font-weight: 500;
}

body.body-stage-template-detail-marketplace .tpl-detail__author-role {
  display: block;
  font-size: 13px;
  color: var(--tpl-muted);
}

body.body-stage-template-detail-marketplace .tpl-detail__facts {
  margin: 20px 0 0;
  padding: 0;
  border-top: 1px solid var(--tpl-surface-2);
}

body.body-stage-template-detail-marketplace .tpl-detail__fact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--tpl-surface-2);
  font-size: 14px;
}

body.body-stage-template-detail-marketplace .tpl-detail__fact dt {
  color: var(--tpl-muted);
  font-weight: 400;
}

body.body-stage-template-detail-marketplace .tpl-detail__fact dd {
  margin: 0;
  color: var(--tpl-text);
  text-align: right;
}

body.body-stage-template-detail-marketplace .tpl-detail__fact a {
  color: var(--tpl-text);
  text-decoration: underline;
}

body.body-stage-template-detail-marketplace .tpl-detail__aside-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

body.body-stage-template-detail-marketplace .tpl-detail__tags-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 500;
}

body.body-stage-template-detail-marketplace .tpl-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.body-stage-template-detail-marketplace .tpl-detail__tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: var(--tpl-radius);
  background: var(--tpl-info-bg);
  color: var(--tpl-primary-dark);
}

body.body-stage-template-detail-marketplace .tpl-detail__section {
  margin-bottom: 32px;
}

body.body-stage-template-detail-marketplace .tpl-detail__h2 {
  margin: 0 0 12px;
  font-size: var(--fs-h3);
  font-weight: var(--fw-h3);
}

body.body-stage-template-detail-marketplace .tpl-detail__p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--tpl-text);
}

body.body-stage-template-detail-marketplace .tpl-detail__list {
  margin: 0;
  padding-left: 1.1em;
  font-size: 16px;
  line-height: 1.6;
}

body.body-stage-template-detail-marketplace .tpl-detail__list li {
  margin-bottom: 8px;
  padding-left: 4px;
}

body.body-stage-template-detail-marketplace .tpl-detail__list li::marker {
  color: var(--tpl-primary);
}

body.body-stage-template-detail-marketplace .tpl-detail__pages {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  line-height: 1.75;
}

body.body-stage-template-detail-marketplace .tpl-detail__pages a {
  color: var(--tpl-primary);
  text-decoration: underline;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

body.body-stage-template-detail-marketplace .tpl-detail__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

body.body-stage-template-detail-marketplace .tpl-detail__pill--soft {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: var(--tpl-radius);
  background: var(--tpl-surface-2);
  color: var(--tpl-text);
}

body.body-stage-template-detail-marketplace .tpl-detail__similar {
  margin-top: 64px;
  max-width: none;
  min-width: 0;
}

body.body-stage-template-detail-marketplace .tpl-detail__similar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 63.9375rem) {
  body.body-stage-template-detail-marketplace .tpl-detail__similar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 48rem) {
  body.body-stage-template-detail-marketplace .tpl-detail__similar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.body-stage-template-detail-marketplace .tpl-detail__carousel-track {
    transition: none !important;
  }
}

/* Card «Template simili» — stesse regole del catalogo /templates */
body.body-stage-template-detail-marketplace .tpl-mkt__card {
  min-width: 0;
  transition: transform 0.16s ease;
}

body.body-stage-template-detail-marketplace .tpl-mkt__card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

body.body-stage-template-detail-marketplace .tpl-mkt__card-media {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: var(--tpl-surface);
}

body.body-stage-template-detail-marketplace .tpl-mkt__card-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

body.body-stage-template-detail-marketplace .tpl-mkt__card-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

body.body-stage-template-detail-marketplace .tpl-mkt__card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: #141414;
  text-decoration: none;
}

body.body-stage-template-detail-marketplace .tpl-mkt__card h3.tpl-mkt__card-title {
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

body.body-stage-template-detail-marketplace .tpl-mkt__card-category {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--tpl-muted);
}

body.body-stage-template-detail-marketplace .tpl-mkt__price {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: var(--tpl-radius);
  background: var(--tpl-surface-2);
  color: var(--tpl-text);
}
