/*
 * eBook DRM — Frontend Styles (Minha Conta / WooCommerce)
 * Design tokens match admin.css (--edrm-* prefix)
 */

:root {
  --edrm-primary: #0073aa;
  --edrm-primary-dark: #005a87;
  --edrm-success: #46b450;
  --edrm-warning: #f7b825;
  --edrm-danger: #dc3232;
  --edrm-purple: #826eb4;
  --edrm-orange: #f06a25;

  --edrm-text: #1d2327;
  --edrm-text-muted: #6b7280;
  --edrm-bg: #f6f7f7;
  --edrm-bg-card: #ffffff;
  --edrm-border: #e2e4e7;
  --edrm-border-focus: #2271b1;

  --edrm-radius-sm: 4px;
  --edrm-radius-md: 8px;
  --edrm-radius-lg: 12px;

  --edrm-sp-xs: 4px;
  --edrm-sp-sm: 8px;
  --edrm-sp-md: 16px;
  --edrm-sp-lg: 24px;
  --edrm-sp-xl: 32px;

  --edrm-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --edrm-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --edrm-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.14);

  --edrm-transition: 0.2s ease;
}

/* =========================================================
   Section title
   ========================================================= */
.edrm-my-ebooks h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--edrm-text);
  margin: 0 0 var(--edrm-sp-lg);
  padding-bottom: var(--edrm-sp-sm);
  border-bottom: 2px solid var(--edrm-border);
  display: none;
}

/* =========================================================
   eBook card grid
   ========================================================= */
.edrm-ebook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--edrm-sp-lg);
  margin-bottom: var(--edrm-sp-xl);
}

.edrm-ebook-card {
  background: linear-gradient(180deg, #fffdfa 0%, #fff 58%);
  border-radius: var(--edrm-radius-md);
  border: 1px solid #eadbb8;
  box-shadow:
    0 12px 32px rgba(59, 36, 13, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    box-shadow var(--edrm-transition),
    transform var(--edrm-transition);
}

.edrm-ebook-card:hover {
  box-shadow:
    0 16px 40px rgba(59, 36, 13, 0.13),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  transform: translateY(-2px);
}

/* Card header — coloured accent bar */
.edrm-ebook-card__header {
  background:
    radial-gradient(
      circle at 90% 0%,
      rgba(210, 159, 32, 0.18),
      transparent 38%
    ),
    linear-gradient(135deg, #fffaf0 0%, #f7edd6 100%);
  border-bottom: 1px solid #eadbb8;
  min-height: 116px;
  padding: 18px 18px 16px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.edrm-ebook-card__title-wrap {
  min-width: 0;
  flex: 1;
}

.edrm-ebook-card__title {
  color: #2c2016;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.edrm-ebook-card__cover {
  width: 54px;
  height: 74px;
  flex: 0 0 54px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(126, 91, 22, 0.28);
  box-shadow: 0 8px 18px rgba(59, 36, 13, 0.18);
}

/* Trial badge on header */
.edrm-badge--trial {
  position: absolute;
  top: var(--edrm-sp-sm);
  right: var(--edrm-sp-sm);
  background: var(--edrm-warning);
  color: #1d2327;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px var(--edrm-sp-sm);
  border-radius: 20px;
}

/* Card body */
.edrm-ebook-card__body {
  padding: var(--edrm-sp-md);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--edrm-sp-sm);
}

.edrm-ebook-meta {
  display: flex;
  align-items: center;
  gap: var(--edrm-sp-xs);
  font-size: 0.8rem;
  color: var(--edrm-text-muted);
}

.edrm-ebook-meta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

.edrm-ebook-meta--authors a {
  color: var(--edrm-primary);
  text-decoration: none;
  font-weight: 500;
}

.edrm-ebook-meta--authors a:hover {
  text-decoration: underline;
}

/* Download progress bar */
.edrm-download-progress {
  margin-top: var(--edrm-sp-xs);
}

.edrm-download-progress__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--edrm-text-muted);
  margin-bottom: 4px;
}

.edrm-download-progress__bar {
  height: 6px;
  background: var(--edrm-border);
  border-radius: 3px;
  overflow: hidden;
}

.edrm-download-progress__fill {
  height: 100%;
  background: var(--edrm-primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.edrm-download-progress__fill--full {
  background: var(--edrm-danger);
}

/* Reading progress bar */
.edrm-reading-progress {
  margin-top: var(--edrm-sp-xs);
}

.edrm-reading-progress__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--edrm-text-muted);
  margin-bottom: 4px;
}

.edrm-reading-progress__bar {
  height: 6px;
  background: var(--edrm-border);
  border-radius: 3px;
  overflow: hidden;
}

.edrm-reading-progress__fill {
  height: 100%;
  background: #16a34a;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.edrm-reading-progress__fill--complete {
  background: #15803d;
}

/* Card footer — actions */
.edrm-ebook-card__footer {
  padding: var(--edrm-sp-sm) var(--edrm-sp-md) var(--edrm-sp-md);
  display: flex;
  flex-direction: column;
  gap: var(--edrm-sp-sm);
}

/* =========================================================
   Buttons
   ========================================================= */
.edrm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--edrm-sp-xs);
  padding: 9px var(--edrm-sp-md);
  border-radius: var(--edrm-radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background var(--edrm-transition),
    border-color var(--edrm-transition),
    box-shadow var(--edrm-transition);
  line-height: 1.2;
  width: 100%;
}

.edrm-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.edrm-btn--primary {
  background: linear-gradient(180deg, #c99721 0%, #9e7412 100%);
  color: #fff !important;
  border-color: #9e7412;
  box-shadow: 0 8px 18px rgba(158, 116, 18, 0.22);
}

.edrm-btn--primary:hover {
  background: linear-gradient(180deg, #b88718 0%, #76540c 100%);
  border-color: #76540c;
  color: #fff !important;
}

.edrm-btn--outline {
  background: transparent;
  color: var(--edrm-danger);
  border-color: var(--edrm-danger);
}

.edrm-btn--outline:hover {
  background: var(--edrm-danger);
  color: #fff;
}

.edrm-btn--secondary {
  background: transparent;
  color: var(--edrm-primary);
  border-color: var(--edrm-primary);
}

.edrm-btn--secondary:hover {
  background: var(--edrm-primary);
  color: #fff;
}

.edrm-btn--disabled {
  background: var(--edrm-bg);
  color: var(--edrm-text-muted);
  border-color: var(--edrm-border);
  cursor: not-allowed;
  pointer-events: none;
}

.edrm-extra-files-toggle__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--edrm-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.edrm-btn--disabled .edrm-extra-files-toggle__count {
  background: var(--edrm-border);
  color: var(--edrm-text-muted);
}

/* =========================================================
   Piracy report panel
   ========================================================= */
.edrm-report-panel {
  background: #fff8f8;
  border: 1px solid #ffc4c4;
  border-radius: var(--edrm-radius-md);
  margin-top: var(--edrm-sp-sm);
  overflow: hidden;
  /* JS toggles display */
}

.edrm-report-panel__inner {
  padding: var(--edrm-sp-md);
}

.edrm-report-panel__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--edrm-danger);
  margin: 0 0 var(--edrm-sp-md);
  display: flex;
  align-items: center;
  gap: var(--edrm-sp-xs);
}

.edrm-report-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--edrm-sp-md);
}

@media (max-width: 520px) {
  .edrm-report-form {
    grid-template-columns: 1fr;
  }
}

.edrm-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.edrm-form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--edrm-text);
}

.edrm-form-group input,
.edrm-form-group textarea {
  padding: 7px 10px;
  border: 1px solid var(--edrm-border);
  border-radius: var(--edrm-radius-sm);
  font-size: 0.875rem;
  color: var(--edrm-text);
  background: #fff;
  transition: border-color var(--edrm-transition);
  width: 100%;
  box-sizing: border-box;
}

.edrm-form-group input:focus,
.edrm-form-group textarea:focus {
  border-color: var(--edrm-border-focus);
  outline: none;
  box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.edrm-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.edrm-report-form__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: var(--edrm-sp-sm);
  justify-content: flex-end;
}

/* =========================================================
   Empty / notice states
   ========================================================= */
.edrm-empty-state {
  text-align: center;
  padding: var(--edrm-sp-xl) var(--edrm-sp-lg);
  background: var(--edrm-bg-card);
  border: 1px dashed var(--edrm-border);
  border-radius: var(--edrm-radius-md);
  color: var(--edrm-text-muted);
}

.edrm-empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.35;
  display: block;
  margin: 0 auto var(--edrm-sp-md);
}

.edrm-empty-state p {
  font-size: 0.95rem;
  margin: 0;
}

/* =========================================================
   Alerts / flash messages
   ========================================================= */
.edrm-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--edrm-sp-sm);
  padding: var(--edrm-sp-md);
  border-radius: var(--edrm-radius-sm);
  border-left: 4px solid;
  margin-bottom: var(--edrm-sp-lg);
  font-size: 0.875rem;
}

.edrm-alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.edrm-alert--success {
  background: #ecfdf5;
  border-color: var(--edrm-success);
  color: #065f46;
}

.edrm-alert--error {
  background: #fff1f2;
  border-color: var(--edrm-danger);
  color: #9b1c1c;
}

/* =========================================================
   Single product — ebook feature badges
   ========================================================= */
.edrm-ebook-features {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--edrm-sp-sm);
  list-style: none;
  margin: var(--edrm-sp-md) 0;
  padding: var(--edrm-sp-md) 0;
  border-top: 1px solid var(--edrm-border);
  border-bottom: 1px solid var(--edrm-border);
}

/* reset qualquer estilo de li que o tema possa aplicar */
.edrm-ebook-features__item,
.edrm-ebook-features__item:first-child,
.edrm-ebook-features__item:last-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f7ff;
  border: 1px solid #c8e0f4;
  color: var(--edrm-primary-dark);
  font-size: 0.8rem;
  font-weight: 600;
  /* padding igual nos quatro lados para garantir altura uniforme */
  padding: 7px 14px;
  border-radius: 20px;
  white-space: nowrap;
  line-height: 1;
  height: auto;
  min-height: 0;
  box-sizing: border-box;
  margin: 0;
  transition:
    background var(--edrm-transition),
    border-color var(--edrm-transition);
  vertical-align: middle;
}

.edrm-ebook-features__item:hover {
  background: #dceeff;
  border-color: #a8cef0;
}

.edrm-ebook-features__item svg {
  width: 15px;
  height: 15px;
  fill: var(--edrm-primary);
  flex-shrink: 0;
  display: block;
}

/* =========================================================
   Single product — trust/guarantee strip
   ========================================================= */
.edrm-trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--edrm-border);
  border-radius: var(--edrm-radius-md);
  overflow: hidden;
  margin: var(--edrm-sp-sm) 0 var(--edrm-sp-md);
  background: var(--edrm-bg-card);
}

.edrm-trust-strip__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--edrm-sp-md);
  border-right: 1px solid var(--edrm-border);
  background: var(--edrm-bg);
}

.edrm-trust-strip__item:last-child {
  border-right: none;
}

.edrm-trust-strip__item svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  fill: var(--edrm-primary);
  opacity: 0.85;
}

.edrm-trust-strip__item div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.edrm-trust-strip__item strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--edrm-text);
  white-space: nowrap;
  line-height: 1.3;
}

.edrm-trust-strip__item span {
  display: block;
  font-size: 0.65rem;
  color: var(--edrm-text-muted);
  line-height: 1.3;
  white-space: nowrap;
}

@media (max-width: 780px) {
  .edrm-trust-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .edrm-trust-strip__item:nth-child(2) {
    border-right: none;
  }

  .edrm-trust-strip__item:nth-child(1),
  .edrm-trust-strip__item:nth-child(2) {
    border-bottom: 1px solid var(--edrm-border);
  }
}

@media (max-width: 420px) {
  .edrm-trust-strip {
    grid-template-columns: 1fr;
  }

  .edrm-trust-strip__item {
    border-right: none;
    border-bottom: 1px solid var(--edrm-border);
  }

  .edrm-trust-strip__item:last-child {
    border-bottom: none;
  }
}

/* =========================================================
   Single product — author mini-card
   ========================================================= */
.edrm-author-mini-card {
  background: var(--edrm-bg-card);
  border: 1px solid var(--edrm-border);
  border-left: 4px solid var(--edrm-primary);
  border-radius: var(--edrm-radius-md);
  padding: var(--edrm-sp-md) var(--edrm-sp-md) var(--edrm-sp-md)
    calc(var(--edrm-sp-md) - 3px);
  margin-top: var(--edrm-sp-md);
  box-shadow: var(--edrm-shadow-sm);
}

.edrm-author-mini-card__header {
  display: flex;
  align-items: center;
  gap: var(--edrm-sp-sm);
  margin-bottom: var(--edrm-sp-sm);
}

.edrm-author-mini-card__avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
}

.edrm-author-mini-card__avatar img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid var(--edrm-border);
}

.edrm-author-mini-card__initial {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--edrm-primary);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edrm-author-mini-card__identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.edrm-author-mini-card__role {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--edrm-text-muted);
}

.edrm-author-mini-card__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--edrm-text);
  text-decoration: none;
  line-height: 1.2;
}

a.edrm-author-mini-card__name:hover {
  color: var(--edrm-primary);
}

.edrm-author-mini-card__bio {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--edrm-text-muted);
  margin: 0 0 var(--edrm-sp-sm);
}

.edrm-author-mini-card__link {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--edrm-primary);
  text-decoration: none;
  transition: gap var(--edrm-transition);
}

.edrm-author-mini-card__link:hover {
  color: var(--edrm-primary-dark);
  gap: 6px;
}

/* =========================================================
   Single product — byline "por Autor" abaixo do título
   ========================================================= */
.edrm-byline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -4px 0 14px;
  font-size: 0.875rem;
  color: var(--edrm-text-muted);
  line-height: 1.4;
}

.edrm-byline__label {
  font-style: italic;
}

.edrm-byline__link {
  color: var(--edrm-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--edrm-transition);
}

.edrm-byline__link:hover {
  color: var(--edrm-primary-dark);
  text-decoration: underline;
}

.edrm-byline__sep {
  color: var(--edrm-text-muted);
}

/* Meta section (SKU / Categorias / Tags) — mesmo estilo Woodmart */
.edrm-meta-author {
  display: block;
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--edrm-text-muted);
}

.edrm-meta-author .meta-label {
  font-weight: 600;
  color: var(--edrm-text);
  margin-right: 4px;
}

.edrm-meta-author a {
  color: var(--edrm-primary);
  text-decoration: none;
}

.edrm-meta-author a:hover {
  text-decoration: underline;
}

/* =========================================================
   Author archive card (.edrm-author-card)
   Renderizado ANTES do wrapper do Woodmart (woocommerce_before_main_content
   prio 5) → ocupa 100% da largura do viewport naturalmente.
   ========================================================= */
.edrm-author-card {
  width: 100%;
  background: linear-gradient(
    135deg,
    var(--edrm-primary) 0%,
    var(--edrm-primary-dark) 100%
  );
  color: #fff;
  padding: var(--edrm-sp-xl) var(--edrm-sp-lg);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

/* subtle geometric accent behind the card */
.edrm-author-card::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.edrm-author-card::after {
  content: "";
  position: absolute;
  bottom: -90px;
  right: 200px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

/* Inner container — centraliza e limita a largura do conteúdo */
.edrm-author-card__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--edrm-sp-xl);
  position: relative;
  z-index: 1;
}

/* Photo / initials */
.edrm-author-card__photo {
  flex-shrink: 0;
}

.edrm-author-card__photo img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  display: block;
}

.edrm-author-card__initials {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 3px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
}

/* Body */
.edrm-author-card__body {
  flex: 1;
  min-width: 0;
}

.edrm-author-card__meta {
  display: flex;
  align-items: center;
  gap: var(--edrm-sp-sm);
  margin-bottom: var(--edrm-sp-sm);
}

.edrm-author-card__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 10px;
  border-radius: 20px;
}

.edrm-author-card__count {
  font-size: 0.82rem;
  opacity: 0.8;
}

.edrm-author-card__name {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 var(--edrm-sp-sm);
  color: #fff;
  line-height: 1.2;
}

.edrm-author-card__bio {
  font-size: 0.9rem;
  line-height: 1.65;
  opacity: 0.9;
  max-width: 640px;
}

.edrm-author-card__bio p:last-child {
  margin-bottom: 0;
}

/* =========================================================
   Responsive overrides
   ========================================================= */
@media (max-width: 600px) {
  .edrm-ebook-grid {
    grid-template-columns: 1fr;
  }

  .edrm-author-card {
    padding: var(--edrm-sp-lg);
  }

  .edrm-author-card__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--edrm-sp-lg);
  }

  .edrm-author-card__meta {
    justify-content: center;
  }

  .edrm-author-card__bio {
    max-width: 100%;
  }

  .edrm-author-card__name {
    font-size: 1.5rem;
  }
}

/* =========================================================
   Single product — preço com desconto em destaque
   ========================================================= */
.single-product .summary .price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

/* Preço original riscado — menor e apagado */
.single-product .summary .price del,
.single-product .summary .price del .woocommerce-Price-amount {
  font-size: 1rem !important;
  opacity: 0.55;
  font-weight: 400;
}

/* Preço com desconto — grande e em destaque */
.single-product .summary .price ins {
  text-decoration: none;
  background: none;
}

.single-product .summary .price ins .woocommerce-Price-amount {
  font-size: 2rem !important;
  font-weight: 800 !important;
  color: var(--edrm-primary-dark) !important;
  line-height: 1;
}

/* Badge de desconto gerado via PHP */
.edrm-discount-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--edrm-sp-sm);
  margin: -2px 0 var(--edrm-sp-sm);
  flex-wrap: wrap;
}

.edrm-discount-badge__percent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.edrm-discount-badge__saving {
  font-size: 0.82rem;
  color: var(--edrm-text-muted);
}

.edrm-discount-badge__saving .woocommerce-Price-amount {
  color: #2e7d32;
  font-weight: 700;
}

/* =========================================================
   Contador regressivo de lançamento (pré-compra)
   ========================================================= */
.edrm-release-countdown {
  display: flex;
  flex-direction: column;
  gap: var(--edrm-sp-sm);
  margin: var(--edrm-sp-sm) 0 var(--edrm-sp-md);
  padding: var(--edrm-sp-md);
  background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
  border: 1px solid #f0d78c;
  border-radius: var(--edrm-radius-md);
}

.edrm-release-countdown__label {
  margin: 0;
  font-size: 0.95rem;
  color: var(--edrm-text);
}

.edrm-release-countdown__label strong {
  color: var(--edrm-orange);
}

.edrm-release-countdown__timer {
  display: flex;
  gap: var(--edrm-sp-sm);
  flex-wrap: wrap;
}

.edrm-release-countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: var(--edrm-sp-xs) var(--edrm-sp-sm);
  background: var(--edrm-bg-card);
  border: 1px solid #f0d78c;
  border-radius: var(--edrm-radius-sm);
}

.edrm-release-countdown__value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--edrm-orange);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.edrm-release-countdown__unit-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--edrm-text-muted);
}

.edrm-release-countdown__note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--edrm-text-muted);
}

/* Botão "Aguarde lançamento" no card de eBook (Minha Conta) */
.edrm-btn--preorder {
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.edrm-btn--preorder small {
  font-size: 0.72rem;
  color: var(--edrm-text-muted);
}

/* =========================================================
   Modal de "gerando PDF" (exibido ao clicar em Baixar PDF)
   ========================================================= */
.edrm-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  background: rgba(29, 35, 39, 0.6);
  padding: var(--edrm-sp-md);
}

.edrm-modal-overlay--visible {
  display: flex;
}

.edrm-modal {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--edrm-bg-card);
  border-radius: var(--edrm-radius-lg);
  padding: 32px var(--edrm-sp-lg) var(--edrm-sp-lg);
  text-align: center;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.edrm-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--edrm-text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}

.edrm-modal__close:hover {
  background: var(--edrm-bg);
  color: var(--edrm-text);
}

.edrm-modal__spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--edrm-sp-md);
  border: 4px solid var(--edrm-border);
  border-top-color: var(--edrm-primary);
  border-radius: 50%;
  animation: edrm-spin 0.8s linear infinite;
}

.edrm-modal__title {
  margin: 0 0 var(--edrm-sp-xs);
  font-size: 1.05rem;
  color: var(--edrm-text);
}

.edrm-modal__text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--edrm-text-muted);
}

@keyframes edrm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Modal "Arquivos Adicionais" (lista de downloads sem DRM) */
.edrm-modal--files {
  max-width: 420px;
  text-align: left;
}

.edrm-extra-files-modal__list {
  list-style: none;
  margin: var(--edrm-sp-md) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--edrm-sp-xs);
}

.edrm-extra-files-modal__link {
  display: flex;
  align-items: center;
  gap: var(--edrm-sp-sm);
  padding: var(--edrm-sp-sm) var(--edrm-sp-md);
  border: 1px solid var(--edrm-border);
  border-radius: var(--edrm-radius-sm);
  color: var(--edrm-text);
  text-decoration: none;
  font-size: 0.9rem;
}

.edrm-extra-files-modal__link:hover {
  border-color: var(--edrm-primary);
  color: var(--edrm-primary);
  background: var(--edrm-bg);
}

.edrm-extra-files-modal__link::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 9h-4V3H9v6H5l7 7 7-7zm-8 2V5h2v6h1.17L12 13.17 9.83 11H11zm-6 7h14v2H5z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 9h-4V3H9v6H5l7 7 7-7zm-8 2V5h2v6h1.17L12 13.17 9.83 11H11zm-6 7h14v2H5z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* Respect motion preference */
@media (prefers-reduced-motion: reduce) {
  .edrm-ebook-card,
  .edrm-btn,
  .edrm-download-progress__fill {
    transition: none;
  }
  .edrm-ebook-card:hover {
    transform: none;
  }
  .edrm-modal__spinner {
    animation: none;
    border-top-color: var(--edrm-border);
  }
}

/* =========================================================
   Single product — conversion-focused ebook layout
   ========================================================= */
.single-product .product-type-ebook .onsale {
  display: none;
}

.single-product .product-type-ebook .summary-inner {
  --wd-tags-mb: 16px;
}

.single-product .product-type-ebook .product_title {
  max-width: 820px;
  margin-bottom: 10px;
  color: #172033;
  font-family: var(--wd-text-font, Arial, sans-serif);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.18;
}

.single-product .product-type-ebook .woocommerce-product-gallery {
  max-width: 430px;
  margin-inline: auto;
}

.single-product
  .product-type-ebook
  .woocommerce-product-details__short-description {
  max-width: 800px;
  color: #566074;
  font-size: 1rem;
  line-height: 1.65;
}

.single-product .product-type-ebook .woocommerce-product-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #697386;
  font-size: 0.82rem;
}

.single-product .product-type-ebook .summary .price {
  margin: 6px 0 10px;
}

.single-product
  .product-type-ebook
  .summary
  .price
  ins
  .woocommerce-Price-amount {
  font-size: 2.35rem !important;
  color: #075d86 !important;
}

.single-product .product-type-ebook .edrm-discount-badge {
  margin: 0 0 14px;
}

.single-product .product-type-ebook .edrm-discount-badge__percent {
  border-radius: 5px;
  background: #edf8ef;
  border-color: #b9dfc0;
}

.single-product .product-type-ebook .edrm-ebook-features {
  gap: 10px 0;
  margin: 18px 0;
  padding: 12px 0;
}

/*
 * Cada item tem borda própria (em vez de border-right ligando um item ao
 * próximo): com 6 itens e rótulos de tamanho variável (ex.: "Bônus: <nome
 * do arquivo>"), a lista quebra em mais de uma linha em telas normais, e um
 * separador "de coluna" fica com metade sobrando quando isso acontece. Com
 * borda própria, cada item é autocontido e a quebra de linha não fica feia.
 */
.single-product .product-type-ebook .edrm-ebook-features__item,
.single-product .product-type-ebook .edrm-ebook-features__item:first-child,
.single-product .product-type-ebook .edrm-ebook-features__item:last-child {
  min-height: 30px;
  padding: 8px 14px;
  border: 1px solid var(--edrm-border);
  border-radius: var(--edrm-radius-sm);
  background: var(--edrm-bg-card);
  color: #344054;
}

/* Rótulo de bônus pode ser longo (nome do arquivo) — trunca em vez de esticar o item. */
.single-product .product-type-ebook .edrm-ebook-features__item--bonus {
  max-width: 260px;
}

.single-product .product-type-ebook .edrm-ebook-features__item--bonus span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.single-product .product-type-ebook form.cart {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin: 20px 0 14px;
}

.single-product .product-type-ebook form.cart .quantity {
  display: none !important;
}

.single-product .product-type-ebook form.cart .single_add_to_cart_button,
.single-product .product-type-ebook form.cart .ebook-drm-trial-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin: 0;
  padding: 12px 22px;
  border-radius: 6px;
  letter-spacing: 0;
  white-space: normal;
  text-align: center;
}

.single-product .product-type-ebook form.cart .single_add_to_cart_button {
  flex: 1 1 270px;
  background: #d4a514;
  color: #172033;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(169, 126, 0, 0.2);
}

.single-product .product-type-ebook form.cart .single_add_to_cart_button:hover {
  background: #e2b72f;
  color: #111827;
}

.single-product .product-type-ebook form.cart .ebook-drm-trial-button {
  flex: 0 1 210px;
  border: 1px solid #0b78ad;
  background: #fff;
  color: #075d86;
  font-size: 0.84rem;
  font-weight: 700;
}

.single-product .product-type-ebook form.cart .ebook-drm-trial-button:hover {
  background: #eef8fc;
  color: #064d70;
}

.single-product .product-type-ebook .edrm-trust-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 20px;
  border-radius: 6px;
  background: #f8fafc;
}

.single-product .product-type-ebook .edrm-trust-strip__item {
  justify-content: center;
  padding: 13px 12px;
  background: transparent;
}

.single-product .product-type-ebook .product_meta {
  padding-top: 18px;
  color: #788397;
  font-size: 0.82rem;
}

.single-product .product-type-ebook .product-share {
  opacity: 0.65;
  font-size: 0.82rem;
}

.single-product .product-tabs-wrapper {
  margin-top: 38px;
  padding: 32px 0;
  border-top: 1px solid #e7eaf0;
  background: #fbfcfd;
}

.single-product .product-type-ebook .woocommerce-Tabs-panel--description,
.single-product .product-type-ebook .edrm-author-mini-card {
  max-width: 920px;
  margin-inline: auto;
}

.single-product .product-type-ebook .woocommerce-Tabs-panel--description {
  color: #3f4a5c;
  font-size: 1rem;
  line-height: 1.75;
}

.single-product .product-type-ebook .edrm-author-mini-card {
  margin-top: 30px;
  padding: 20px;
  border-left: 0;
  border-radius: 6px;
  box-shadow: none;
}

.single-product .related-and-upsells {
  padding-top: 34px;
}

.single-product .whb-header [class*="wd-header-search-form"] {
  max-width: 680px;
}

.edrm-mobile-purchase {
  display: none;
}

@media (max-width: 780px) {
  body.single-product {
    padding-bottom: 72px;
  }

  .single-product .product-type-ebook .product_title {
    font-size: 1.75rem;
  }

  .single-product .product-type-ebook form.cart {
    flex-direction: column;
  }

  .single-product .product-type-ebook form.cart .single_add_to_cart_button,
  .single-product .product-type-ebook form.cart .ebook-drm-trial-button {
    flex: 0 0 auto;
    width: 100%;
  }

  .single-product .product-type-ebook .edrm-trust-strip {
    grid-template-columns: 1fr;
  }

  .single-product .product-type-ebook .edrm-trust-strip__item {
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid var(--edrm-border);
  }

  .single-product .product-type-ebook .edrm-trust-strip__item:last-child {
    border-bottom: 0;
  }

  .single-product .product-tabs-wrapper {
    padding: 20px 0 88px;
  }

  .edrm-mobile-purchase {
    position: fixed;
    z-index: 999;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #dfe3e8;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -5px 18px rgba(17, 24, 39, 0.12);
  }

  .edrm-mobile-purchase__price {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .edrm-mobile-purchase__price > span {
    color: #697386;
    font-size: 0.68rem;
    font-weight: 600;
  }

  .edrm-mobile-purchase__price .price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    color: #075d86;
    font-size: 1rem;
    font-weight: 800;
  }

  .edrm-mobile-purchase__price del {
    display: none;
  }

  .edrm-mobile-purchase__price ins {
    text-decoration: none;
  }

  .edrm-mobile-purchase__button {
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 6px;
    background: #d4a514;
    color: #172033;
    font-size: 0.8rem;
    font-weight: 800;
  }
}

@media (max-width: 520px) {
  .single-product .product-type-ebook .edrm-ebook-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .single-product .product-type-ebook .edrm-ebook-features__item,
  .single-product .product-type-ebook .edrm-ebook-features__item:first-child,
  .single-product .product-type-ebook .edrm-ebook-features__item:last-child {
    padding: 7px 8px;
    border-right: 0;
    white-space: normal;
  }
}
