/* PDF Guard — delivery options, owned-book notice and free claim on product pages.
   Colours follow --spv-accent; a theme can override it on .spv-choice. */

.spv-choice {
  --spv-accent: #4f46e5;
  --spv-accent-soft: #eef0ff;
  --spv-line: #e5e7eb;
  --spv-ink: #111827;
  --spv-muted: #6b7280;
  --spv-ship: #b45309;
  --spv-ship-soft: #fff7ed;
  --spv-instant: #047857;
  --spv-instant-soft: #ecfdf5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  margin: 0 0 18px;
  direction: rtl;
  text-align: right;
  color: var(--spv-ink);
}
.spv-choice__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; font-weight: 700; line-height: 1.7; }
.spv-choice__title small { color: var(--spv-muted); font-size: 0.82em; font-weight: 400; }

.spv-choice__included { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 14px; border: 1px dashed #c7d2fe; border-radius: 12px; background: #fafaff; line-height: 1.8; }
.spv-choice__included-icon { display: grid; flex: 0 0 26px; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--spv-accent); color: #fff; }
.spv-choice__included-icon svg { width: 16px; height: 16px; }
.spv-choice__included-price { margin-inline-start: auto; font-weight: 700; white-space: nowrap; }
.spv-choice__included-price.is-owned { color: var(--spv-instant); font-size: 0.86em; }

.spv-choice__list { display: flex; flex-direction: column; gap: 8px; }

.spv-option { position: relative; display: grid; grid-template-columns: 22px 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--spv-line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s; }
.spv-option input { position: absolute; inset: 0; width: 100% !important; height: 100% !important; margin: 0 !important; opacity: 0 !important; cursor: inherit; -webkit-appearance: none; appearance: none; z-index: 2; }
.spv-option input::before, .spv-option input::after { display: none !important; }
.spv-option:hover { border-color: #c7d2fe; }
.spv-option.is-selected { border-color: var(--spv-accent); background: #fbfbff; box-shadow: inset 0 0 0 1px var(--spv-accent); }
.spv-option:focus-within { outline: 3px solid rgba(79, 70, 229, 0.28); outline-offset: 1px; }

.spv-option__mark { position: relative; z-index: 1; box-sizing: border-box; flex: none; justify-self: center; align-self: center; display: grid !important; place-items: center; width: 22px !important; min-width: 22px; height: 22px !important; min-height: 22px; border: 1.5px solid #9ca3af; border-radius: 6px; background: #fff; transition: background-color 0.15s, border-color 0.15s; }
.spv-option input[type="radio"] ~ .spv-option__mark { border-radius: 50%; }
.spv-option.is-selected .spv-option__mark { border-color: var(--spv-accent); background: var(--spv-accent); }
.spv-option.is-selected .spv-option__mark::after { content: ""; width: 9px; height: 5px; margin-top: -2px; border-bottom: 2px solid #fff; border-left: 2px solid #fff; transform: rotate(-45deg); }
.spv-option.is-selected input[type="radio"] ~ .spv-option__mark::after { width: 8px; height: 8px; margin: 0; border: 0; border-radius: 50%; background: #fff; transform: none; }

.spv-option__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--spv-accent-soft); color: var(--spv-accent); }
.spv-option--physical .spv-option__icon { background: var(--spv-ship-soft); color: var(--spv-ship); }
.spv-option--download .spv-option__icon { background: var(--spv-instant-soft); color: var(--spv-instant); }

.spv-option__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spv-option__text strong { font-size: 1em; font-weight: 700; line-height: 1.6; }
.spv-option__text small { color: var(--spv-muted); font-size: 0.84em; line-height: 1.7; }
.spv-option__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.spv-option__tags:empty { display: none; }
.spv-option__tag { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 0.76em; font-style: normal; font-weight: 600; line-height: 1.9; }
.spv-option__tag--ship { background: var(--spv-ship-soft); color: var(--spv-ship); }
.spv-option__tag--instant { background: var(--spv-instant-soft); color: var(--spv-instant); }
.spv-option__tag--muted { background: #f3f4f6; color: var(--spv-muted); }

.spv-option__price { display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; line-height: 1.5; white-space: nowrap; text-align: left; }
.spv-option__price del { order: -1; color: #9ca3af; font-size: 0.82em; font-weight: 400; }
.spv-option__price ins { background: none; color: inherit; text-decoration: none; }
.spv-option__price .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.spv-option.is-owned,
.spv-option.is-unavailable { cursor: not-allowed; background: #f9fafb; }
.spv-option.is-owned .spv-option__price { color: var(--spv-instant); font-size: 0.86em; }
.spv-option.is-unavailable .spv-option__text,
.spv-option.is-unavailable .spv-option__price { opacity: 0.6; }

.spv-choice__summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; background: #f3f4f6; }
.spv-choice__summary span { color: #374151; }
.spv-choice__summary strong { font-size: 1.2em; font-weight: 800; white-space: nowrap; }
.spv-choice.is-empty .spv-choice__summary { background: var(--spv-ship-soft); }
.spv-choice.is-empty .spv-choice__summary span { color: var(--spv-ship); }

.spv-choice__note { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--spv-ship-soft); color: #92400e; font-size: 0.88em; line-height: 1.8; }
.spv-choice__note[hidden] { display: none; }
/* Digital copies are sold one at a time; themes often give .quantity its own display, which would override [hidden]. */
form.cart .quantity[hidden] { display: none !important; }

/* Variable products: the option rows replace the attribute fields and the duplicate variation price. */
.spv-has-options table.variations,
.spv-has-options .woocommerce-variation-price,
.spv-has-options .reset_variations { display: none !important; }

.spv-owned-box,
.spv-free-claim { margin: 0 0 16px; padding: 14px 16px; border-radius: 12px; direction: rtl; }
.spv-owned-box { display: flex; align-items: center; gap: 12px; border: 1px solid #bbf7d0; background: #f0fdf4; }
.spv-owned-box__icon { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #16a34a; color: #fff; font-weight: 700; }
.spv-owned-box__body { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.spv-owned-box__body strong { font-weight: 600; line-height: 1.8; }
.spv-free-claim { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; border: 1px solid #c7d2fe; background: #f5f7ff; }
.spv-free-claim form { margin: 0; }
.spv-free-claim small { color: #4b5563; line-height: 1.8; }
.spv-owned-inline { margin: 8px 0; color: #15803d; }

.spv-option__tag { white-space: nowrap; }

/* Phones: the price moves under the text so the name and hint keep the full width. */
@media (max-width: 520px) {
  .spv-option { grid-template-columns: 20px minmax(0, 1fr); gap: 6px 10px; padding: 12px; }
  .spv-option__icon { display: none; }
  .spv-option__price { grid-column: 2; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 8px; text-align: right; }
  .spv-option__price del { order: 1; }
}

/* Small screens: the selection mark keeps its size and stays visible on every row, whatever the theme does to spans. */
@media (max-width: 640px) {
  .spv-option { grid-template-columns: 22px minmax(0, 1fr); align-items: start; }
  .spv-option__mark { margin-top: 3px; }
}
