/**
 * Digital product detail — layers digital-specific presentation on top of the
 * shared modern buyer-detail language already shipped for /services
 * (public/css/service-detail.css: breadcrumb, identity row, .service-panel,
 * .service-badge, .service-detail-grid, .service-buybox-*, review summary/bars,
 * .seller-profile-card). Nothing above is redefined here — only what a digital
 * listing needs that a service listing does not: an instant-download callout,
 * a gallery lightbox, and the file/license fact styling.
 *
 * Class names consumed by public/js/digital-detail.js are load-bearing:
 *   [data-digital-detail] [data-buybox] [data-gallery-thumb] #digital-gallery-main
 *   .dp-lightbox .dp-lightbox__img [data-lightbox-open] [data-lightbox-close]
 */

.digital-detail.buyer-detail {
  padding-block: 0;
}

/* ------------------------------------------------------------- download badge */

.dp-download-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full, 100px);
  background: var(--color-primary-light, #fae6e7);
  color: var(--color-primary, #8c0605);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dp-instant-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full, 100px);
  background: #e7f6ec;
  color: #1a7f37;
  font-size: 0.8rem;
  font-weight: 700;
}

.dp-no-shipping {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted, #6c6c6c);
}

/* --------------------------------------------------------------------- gallery */

/* Digital covers are usually portrait/square artwork, not 16:9 photography —
   contain-fit on a slightly taller box avoids letterboxing every cover down to a
   thin strip the way the service 16:9 stage would. */
.dp-gallery .service-gallery-stage {
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}

.dp-gallery .service-gallery-stage:only-child {
  cursor: default;
}

/* --------------------------------------------------------------------- lightbox */

.dp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.9);
  padding: var(--space-5, 24px);
}

.dp-lightbox[hidden] {
  display: none;
}

.dp-lightbox__img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.dp-lightbox__close {
  position: absolute;
  top: var(--space-4, 16px);
  right: var(--space-4, 16px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.dp-lightbox__close:hover,
.dp-lightbox__close:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

/* ---------------------------------------------------------------- file facts */

/* Reuses .service-facts/.service-fact for the "What you'll get" grid — same
   label/value fact-list treatment the service page uses for its details block,
   so a buyer who has seen either page reads this one identically. */
.dp-license-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
  margin-top: var(--space-3, 12px);
}

.dp-trust-note {
  margin: var(--space-3, 12px) 0 0;
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-muted, #6c6c6c);
}

/* Separates "the small file you download from WorkAndHire" (instructions/access)
   from "the actual digital product" facts below it — a subtle tinted sub-block, not
   an alert/warning box, so the distinction reads as deliberate UX rather than an error. */
.dp-doc-block {
  background: var(--color-surface-muted, #f7f7f8);
  border: 1px solid var(--color-border, #ececec);
  border-radius: var(--radius-sm, 8px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  margin-bottom: var(--space-4, 16px);
}

.dp-doc-block__title {
  margin: 0 0 var(--space-2, 8px);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #6c6c6c);
}

.dp-doc-facts {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.dp-doc-note {
  margin: var(--space-2, 8px) 0 0;
  font-size: var(--font-size-sm, 0.8125rem);
  color: var(--color-text-muted, #6c6c6c);
  line-height: 1.5;
}

/* ----------------------------------------------------------------- buybox meta */

.dp-buybox-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2, 8px);
  flex-wrap: wrap;
}

.dp-buybox-price .buyer-price {
  font-size: 1.65rem;
}

.service-buybox-card > .btn-block + .btn-block {
  margin-top: 0.5rem;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 640px) {
  .dp-gallery .service-gallery-stage {
    aspect-ratio: 1 / 1;
  }

  .dp-lightbox__close {
    top: var(--space-3, 12px);
    right: var(--space-3, 12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dp-lightbox {
    transition: none;
  }
}
