/* CLAW & WAG — Formulario público al cliente
 *
 * Tono: profesional UX/UI, premium por espacio y jerarquía (no por tipografía).
 * Tipografía única: Inter (alineada con panel interno). La marca la carga el
 * logo + paleta lila + 💜 en momentos clave, no la familia tipográfica.
 * Mobile-first: la mayoría de clientes lo abren en el celular.
 */

/* Box-sizing universal — evita overflow de inputs (padding + border vs width:100%) */
.pd-app *, .pd-app *::before, .pd-app *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--ft-system);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(215, 183, 244, 0.18), transparent 70%),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Customer-facing: oscurecer muted foreground para pasar WCAG AA en small text */
  --ink-muted-pd: #5E5E5E;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Layout container ───────────────────────────────────────────────── */
.pd-app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.pd-header {
  text-align: center;
  padding: var(--sp-6) 0 var(--sp-4);
}
.pd-header img { height: 24px; margin: 0 auto; opacity: 0.92; }
.pd-greeting {
  margin-top: var(--sp-5);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink-strong);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.pd-subgreeting {
  color: var(--ink-muted-pd);
  font-size: 14px;
  margin-top: 6px;
  line-height: 1.5;
}

/* ─── Sections ───────────────────────────────────────────────────────── */
.pd-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-4);
  margin-bottom: var(--sp-4);
}
.pd-section-title {
  font-family: var(--ft-system);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
  margin: 0 0 var(--sp-4);
  line-height: 1.3;
}

/* ─── Pedido card (resumen del producto comprado) ────────────────────── */
.pd-order {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}
.pd-order-img {
  width: 96px; height: 96px;
  border-radius: var(--r-lg);
  background: #FAFAFA;
  border: 1px solid var(--line);
  flex-shrink: 0;
  overflow: hidden;
}
.pd-order-img img { width: 100%; height: 100%; object-fit: contain; }
.pd-order-info { flex: 1; min-width: 0; }
.pd-order-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}
.pd-order-color { color: var(--ink-muted); font-size: 14px; margin-top: 2px; }
.pd-order-price {
  margin-top: 4px;
  font-weight: 600;
  color: var(--brand-ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.pd-order-code {
  font-family: var(--ft-mono);
  font-size: 11px;
  color: var(--ink-subtle);
  margin-top: 6px;
}

.pd-payment-status {
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.pd-payment-row { display: flex; justify-content: space-between; padding: 4px 0; }
.pd-payment-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink-strong);
}
.pd-payment-amount.is-paid { color: var(--success); }
.pd-payment-amount.is-pending { color: var(--warning); }

/* ─── Add-on grabado (la card UPSELL más importante) ──────────────────── */
.pd-addon {
  background: linear-gradient(135deg, #F5EFFB 0%, #FFFFFF 100%);
  border: 1.5px solid var(--brand-soft);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-4);
  margin-bottom: var(--sp-4);
  position: relative;
  overflow: hidden;
}
.pd-addon::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(215, 183, 244, 0.4), transparent 70%);
  border-radius: 50%;
}
.pd-addon-toggle {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.pd-addon-checkbox {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border: 2px solid var(--brand);
  border-radius: 6px;
  background: var(--surface);
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  margin-top: 2px;
}
.pd-addon-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pd-addon-toggle input:checked ~ .pd-addon-checkbox {
  background: var(--brand);
}
.pd-addon-toggle input:checked ~ .pd-addon-checkbox::after {
  content: '';
  position: absolute;
  left: 7px; top: 3px;
  width: 6px; height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.pd-addon-title {
  font-family: var(--ft-system);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pd-addon-price {
  background: var(--brand);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0;
}
.pd-addon-desc {
  font-size: 14px;
  color: var(--ink-muted-pd);
  margin-top: 6px;
  line-height: 1.5;
}

.pd-addon-fields {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--brand-soft);
  position: relative;
  z-index: 1;
}
.pd-addon-fields.is-hidden { display: none; }

/* Live preview del grabado */
.pd-engraving-preview {
  display: flex;
  justify-content: center;
  margin-bottom: var(--sp-4);
}
.pd-engraving-disc {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 32px;
  box-shadow:
    inset 0 6px 12px rgba(255, 255, 255, 0.4),
    inset 0 -6px 12px rgba(0, 0, 0, 0.08),
    0 4px 14px rgba(0, 0, 0, 0.08);
}
.pd-engraving-disc.color-silver {
  background:
    radial-gradient(circle at 30% 30%, #FFFFFF, #F5F5F5 30%, #D8D8D8 70%, #B8B8B8);
}
.pd-engraving-disc.color-gold {
  background:
    radial-gradient(circle at 30% 30%, #FFF6D6, #F5DDA0 30%, #D9B870 70%, #B89548);
}
.pd-engraving-disc.color-rose-gold {
  background:
    radial-gradient(circle at 30% 30%, #FFEFE6, #F0CFC0 30%, #D9A597 70%, #B88573);
}
.pd-engraving-text {
  font-family: 'Georgia', 'Playfair Display', Garamond, serif;
  font-size: 16px;
  font-weight: 500;
  color: rgba(40, 30, 20, 0.85);
  text-align: center;
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  min-height: 40px;
  letter-spacing: 0.02em;
}
.pd-engraving-text.is-empty { color: rgba(40, 30, 20, 0.3); font-style: italic; }
.pd-engraving-line { display: block; }

.pd-charcount {
  font-size: 11px;
  color: var(--ink-subtle);
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

/* ─── Section head (title + acción auxiliar como "Ver guía de fotos") ── */
.pd-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.pd-section-head .pd-section-title { margin-bottom: 0; flex: 1 1 auto; }

.pd-photo-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-soft);
  color: var(--brand-ink);
  font-family: var(--ft-system);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  min-height: 36px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  letter-spacing: -0.005em;
}
.pd-photo-guide-link:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}
.pd-photo-guide-link:active { transform: translateY(1px); }
.pd-photo-guide-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(175, 154, 202, 0.35);
}
.pd-photo-guide-link .cw-icon { flex-shrink: 0; opacity: 0.85; }

/* ─── Photo upload ───────────────────────────────────────────────────── */
.pd-photo-section {
  background: linear-gradient(180deg, var(--surface) 0%, #FCFBFE 100%);
}

.pd-photo-lead {
  text-align: center;
  font-size: 14px;
  color: var(--ink-muted-pd);
  margin: 0 auto var(--sp-4);
  line-height: 1.55;
  max-width: 380px;
}

/* Link inline tipo "mira nuestra guía de fotos" — abre modal */
.pd-inline-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: var(--brand-ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(107, 86, 137, 0.4);
  transition: text-decoration-color 0.15s ease;
}
.pd-inline-link:hover {
  text-decoration-color: var(--brand-ink);
}
.pd-inline-link:focus-visible {
  outline: none;
  text-decoration-color: var(--brand-ink);
  box-shadow: 0 0 0 3px rgba(175, 154, 202, 0.30);
  border-radius: 2px;
}

/* Nombre de la mascota debajo del uploader — agrupado con la foto */
.pd-pet-name-field {
  margin-top: var(--sp-5);
  margin-bottom: 0;
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--line);
}

/* ─── "Es un regalo" — toggle + campos condicionales del destinatario ─── */
.pd-gift-wrap {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--line);
}
.pd-gift-toggle {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  cursor: pointer;
  user-select: none;
  position: relative;
}
.pd-gift-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pd-gift-check {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  margin-top: 2px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.pd-gift-toggle input:checked ~ .pd-gift-check {
  background: var(--brand);
  border-color: var(--brand);
}
.pd-gift-toggle input:checked ~ .pd-gift-check::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.pd-gift-toggle input:focus-visible ~ .pd-gift-check {
  box-shadow: 0 0 0 3px rgba(175, 154, 202, 0.30);
}
.pd-gift-text { flex: 1; }
.pd-gift-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-strong);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.pd-gift-desc {
  display: block;
  font-size: 13px;
  color: var(--ink-muted-pd);
  margin-top: 3px;
}
.pd-gift-fields {
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--line);
}
.pd-gift-fields.is-hidden { display: none; }

/* Input de "inicial" (Pet Face Double): 1 letra grande, centrada */
.pd-initial-input {
  max-width: 120px;
  text-align: center;
  font-size: 28px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--ft-system);
}

/* Bloque "mascota 1 / mascota 2" para productos dual_photo */
.pd-pet-block {
  padding: 0;
  margin-bottom: var(--sp-5);
}
.pd-pet-block:last-child { margin-bottom: 0; }
.pd-pet-block-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-strong);
  margin-bottom: var(--sp-2);
  letter-spacing: -0.005em;
}
.pd-pet-block .pd-pet-name-field { margin-top: var(--sp-3); padding-top: var(--sp-3); }
.pd-field-help {
  font-size: 13px;
  color: var(--ink-muted-pd);
  margin-top: 6px;
  line-height: 1.5;
}

/* Drop zone — borde sólido con sombra discreta para que se vea como card */
.pd-photo-drop {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(20, 14, 30, 0.04);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.pd-photo-drop:hover, .pd-photo-drop.is-dragover {
  border-color: var(--brand);
  background: linear-gradient(180deg, #FBF8FE 0%, var(--surface) 100%);
  box-shadow: 0 4px 12px rgba(175, 154, 202, 0.18);
}
.pd-photo-drop:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(175, 154, 202, 0.30);
}
.pd-photo-drop input[type=file] { display: none; }
.pd-photo-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand);
  margin: 0 auto var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-photo-icon .cw-icon { width: 28px; height: 28px; }
.pd-photo-prompt {
  color: var(--ink-strong);
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.pd-photo-hint {
  color: var(--ink-muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.pd-photo-preview {
  display: none;
}
.pd-photo-preview img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  margin: 0 auto;
}
.pd-photo-replace-hint {
  margin-top: var(--sp-2);
  font-size: 12px;
  color: var(--ink-subtle);
  letter-spacing: 0.02em;
}

/* Foto previamente guardada */
.pd-photo-current {
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg);
  border-radius: var(--r-md);
  text-align: center;
}
.pd-photo-current-label {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.pd-photo-current img {
  max-width: 160px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  display: block;
  margin: 0 auto;
}
.pd-photo-current-hint {
  font-size: 12px;
  color: var(--ink-subtle);
  margin-top: 8px;
}


/* ─── Form fields ───────────────────────────────────────────────────── */
.pd-field {
  margin-bottom: var(--sp-4);
}
.pd-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.pd-field input,
.pd-field select,
.pd-field textarea {
  width: 100%;
  font-family: var(--ft-system);
  font-weight: 400;
  font-size: 16px; /* anti-zoom iOS */
  color: var(--ink-strong);
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pd-field input:focus,
.pd-field select:focus,
.pd-field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(175, 154, 202, 0.18);
}
.pd-field input.is-invalid,
.pd-field select.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12);
}
.pd-field-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 4px;
}

.pd-field-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--sp-2);
}
@media (max-width: 480px) {
  .pd-field-row { grid-template-columns: 1fr; }
}

/* ─── Shipping kind selector ────────────────────────────────────────── */
.pd-radio-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.pd-radio-card {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pd-radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
/* Fallback con clase JS para navegadores sin :has() (iOS < 15.4) */
.pd-radio-card.is-checked {
  border-color: var(--brand);
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.pd-radio-card.is-focused {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(175, 154, 202, 0.30);
}
@supports selector(:has(*)) {
  .pd-radio-card:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-tint);
    color: var(--brand-ink);
  }
  .pd-radio-card:has(input:focus-visible) {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(175, 154, 202, 0.30);
  }
}
.pd-radio-card-title {
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 15px;
  color: var(--ink-strong);
}
.pd-radio-card-desc {
  font-size: 13px;
  color: var(--ink-muted-pd);
  margin-top: 3px;
}

.pd-shipping-fields { display: none; }
.pd-shipping-fields.is-active { display: block; }

/* ─── Submit button ─────────────────────────────────────────────────── */
.pd-submit {
  width: 100%;
  padding: 16px 24px;
  background: var(--brand-ink);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--ft-system);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 18px rgba(107, 86, 137, 0.32);
  margin-top: var(--sp-5);
}
.pd-submit:hover {
  background: #5A4575;
  box-shadow: 0 8px 22px rgba(107, 86, 137, 0.40);
}
.pd-submit:active { transform: translateY(1px); }
.pd-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(175, 154, 202, 0.45), 0 6px 18px rgba(107, 86, 137, 0.32);
}
.pd-submit:disabled {
  background: var(--ink-subtle);
  cursor: not-allowed;
  box-shadow: none;
}

.pd-footer {
  text-align: center;
  padding: var(--sp-6) 0;
  color: var(--ink-subtle);
  font-size: 12px;
}
.pd-footer-heart { color: var(--brand); }

/* ─── Already submitted notice ──────────────────────────────────────── */
.pd-banner {
  background: var(--success-soft);
  border: 1px solid rgba(46, 125, 50, 0.2);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: 14px;
  color: var(--success);
  text-align: center;
}

.pd-alert {
  background: var(--danger-soft);
  border: 1px solid rgba(198, 40, 40, 0.2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: var(--sp-3);
  font-size: 14px;
  color: var(--danger);
}

/* ─── Confirmacion / Inactive pages ─────────────────────────────────── */
.pd-result {
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
}
.pd-result-icon {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand);
  margin: 0 auto var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.pd-result-icon img {
  width: 58px; height: 58px;
  object-fit: contain;
}
.pd-result-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--ink-strong);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3);
}
.pd-result-message {
  font-size: 16px;
  color: var(--ink-muted);
  margin-bottom: var(--sp-5);
  line-height: 1.6;
}
.pd-result-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin: var(--sp-4) auto;
  text-align: left;
}

/* Acciones después del submit (botón "Escríbenos por WhatsApp" a la empresa) */
.pd-postsubmit-actions {
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--line);
  text-align: center;
}
.pd-postsubmit-hint {
  font-size: 14px;
  color: var(--ink-muted-pd);
  margin-bottom: var(--sp-3);
}
.pd-postsubmit-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: stretch;
  max-width: 320px;
  margin: 0 auto;
}
.pd-btn-wa,
.pd-btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--r-md);
  font-family: var(--ft-system);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.pd-btn-wa {
  background: #25D366;
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.30);
}
.pd-btn-wa:hover {
  background: #1FB957;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.42);
}
.pd-btn-wa:active { transform: translateY(1px); }

.pd-btn-download {
  background: var(--brand-ink);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 14px rgba(107, 86, 137, 0.30);
}
.pd-btn-download:hover {
  background: #5A4575;
  box-shadow: 0 6px 18px rgba(107, 86, 137, 0.42);
}
.pd-btn-download:active { transform: translateY(1px); }
.pd-btn-download:disabled {
  background: var(--ink-subtle);
  cursor: wait;
  box-shadow: none;
}

/* ─── Modal: guía de fotos ───────────────────────────────────────────── */
.pd-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}
.pd-modal[hidden] { display: none; }
.pd-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 14, 30, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.pd-modal-panel {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: var(--sp-6) var(--sp-5);
  max-width: 520px;
  width: 100%;
  max-height: calc(100vh - var(--sp-7));
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(40, 30, 60, 0.25);
  animation: pdModalIn 0.2s ease;
}
@keyframes pdModalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.pd-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.pd-modal-close:hover {
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.pd-modal-title {
  font-family: var(--ft-system);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
  margin-bottom: 6px;
  padding-right: var(--sp-6);
}
.pd-modal-lead {
  font-size: 14px;
  color: var(--ink-muted-pd);
  margin-bottom: var(--sp-4);
  line-height: 1.55;
}

.pd-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
@media (max-width: 480px) {
  .pd-guide-grid { grid-template-columns: 1fr; }
}
.pd-guide-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pd-guide-card.is-good { border-color: rgba(46, 125, 50, 0.22); }
.pd-guide-card.is-bad  { border-color: rgba(198, 40, 40, 0.22); }

.pd-guide-photo {
  position: relative;
  background: #FAFAFA;
  overflow: hidden;
  /* Fallback para navegadores sin aspect-ratio (iOS < 14.6) */
  padding-bottom: 100%;
  height: 0;
}
.pd-guide-photo > * {
  position: absolute;
  top: 0; left: 0;
}
@supports (aspect-ratio: 1 / 1) {
  .pd-guide-photo {
    aspect-ratio: 1 / 1;
    padding-bottom: 0;
    height: auto;
  }
  .pd-guide-photo > * {
    position: static;
  }
  .pd-guide-photo .pd-guide-icon { position: absolute; }
}
.pd-guide-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pd-guide-card.is-bad .pd-guide-photo img {
  filter: saturate(0.85);
}
/* La card "Evita el borroso" recibe un blur extra del CSS aunque la foto base
   no sea suficientemente borrosa — comunica el concepto sin depender del AI */
.pd-guide-card.is-blurry .pd-guide-photo img {
  filter: blur(3px) saturate(0.85);
}
.pd-guide-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
}
.pd-guide-card.is-good .pd-guide-icon { background: var(--success); color: white; }
.pd-guide-card.is-bad  .pd-guide-icon { background: var(--danger);  color: white; }

.pd-guide-card-body {
  padding: var(--sp-3);
}
.pd-guide-card-title {
  font-family: var(--ft-system);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-strong);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.pd-guide-card p {
  font-size: 13px;
  color: var(--ink-muted-pd);
  line-height: 1.5;
  margin: 0;
}

.pd-modal-footnote {
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-muted-pd);
  line-height: 1.55;
  text-align: center;
}

/* ─── Modal: Revisar pedido (resumen pre-confirm) ───────────────────── */
.pd-review-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.pd-review-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px dashed var(--line);
  align-items: baseline;
}
.pd-review-row:last-child { border-bottom: none; }
.pd-review-lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-muted-pd);
}
.pd-review-val {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-strong);
  line-height: 1.35;
  letter-spacing: -0.005em;
}
.pd-review-meta {
  font-size: 13px;
  color: var(--ink-muted-pd);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pd-review-row .pd-review-meta {
  grid-column: 2 / -1;
  margin-top: 2px;
  text-align: left;
  font-size: 12px;
}
.pd-review-row:has(.pd-review-meta:only-of-type) .pd-review-meta:nth-child(3) {
  /* fallback para precios alineados a la derecha en la 3ra columna */
  text-align: right;
}

/* Par foto+nombre/inicial dentro del modal de revisión */
.pd-review-pair {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) 0;
  border-bottom: 1px dashed var(--line);
}
.pd-review-pair:last-of-type { border-bottom: none; }
.pd-review-pair-head {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-muted-pd);
}
.pd-review-pair-body {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.pd-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--r-md);
  background: #FAFAFA;
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumb-empty,
.pd-thumb-heic {
  font-size: 10px;
  color: var(--ink-muted-pd);
  text-align: center;
  line-height: 1.2;
  font-weight: 500;
  padding: 4px;
}
.pd-thumb-heic { background: var(--brand-tint); color: var(--brand-ink); }
.pd-review-pair-info { flex: 1; min-width: 0; }
.pd-review-pair-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-strong);
  letter-spacing: -0.005em;
}
.pd-review-pair-initial {
  font-size: 32px;
  font-weight: 700;
  color: var(--ink-strong);
  line-height: 1;
  letter-spacing: 0.02em;
}
.pd-review-pair-meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-muted-pd);
  margin-top: 2px;
  font-weight: 500;
}

.pd-review-note {
  display: flex;
  gap: 8px;
  padding: var(--sp-3);
  background: var(--brand-tint);
  border: 1px solid var(--brand-soft);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--brand-ink);
  line-height: 1.5;
  margin: var(--sp-3) 0;
}

/* Nota informativa (form: bajo el input de inicial) */
.pd-note-info {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-3);
  background: var(--brand-tint);
  border: 1px solid var(--brand-soft);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--brand-ink);
  line-height: 1.5;
  margin-bottom: var(--sp-4);
}
.pd-note-info .cw-icon {
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.85;
}

.pd-review-totals {
  margin-top: var(--sp-3);
  padding: var(--sp-4);
  background: linear-gradient(135deg, #F5EFFB 0%, var(--surface) 100%);
  border: 1px solid var(--brand-soft);
  border-radius: var(--r-md);
}
.pd-review-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: 15px;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}
.pd-review-totals-row:first-child {
  font-weight: 600;
  font-size: 16px;
  border-bottom: 1px solid var(--brand-soft);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.pd-review-paid { color: var(--success); }
.pd-review-saldo { color: var(--warning); font-weight: 500; }

.pd-review-actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}
.pd-btn-secondary,
.pd-btn-primary {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--ft-system);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.pd-btn-secondary {
  background: var(--bg);
  color: var(--ink-strong);
  border: 1px solid var(--line-strong);
}
.pd-btn-secondary:hover { background: var(--line); }
.pd-btn-primary {
  background: var(--brand-ink);
  color: white;
  box-shadow: 0 6px 18px rgba(107, 86, 137, 0.32);
}
.pd-btn-primary:hover {
  background: #5A4575;
  box-shadow: 0 8px 22px rgba(107, 86, 137, 0.40);
}
.pd-btn-primary:active { transform: translateY(1px); }
.pd-btn-primary:disabled {
  background: var(--ink-subtle);
  cursor: not-allowed;
  box-shadow: none;
}
.pd-btn-primary:focus-visible,
.pd-btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(175, 154, 202, 0.45);
}

@media (max-width: 480px) {
  .pd-review-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .pd-review-row .pd-review-meta {
    grid-column: 1;
    text-align: left;
  }
  .pd-review-actions { flex-direction: column-reverse; }
}

/* ─── Editar línea del carrito (color + nombre) ───────────────────────────── */
.pc-line-edit { margin-top: 8px; }
.pc-line-edit > summary {
  cursor: pointer; font-size: 12px; font-weight: 600; color: var(--brand-ink);
  list-style: none; user-select: none; display: inline-flex; align-items: center; gap: 4px;
}
.pc-line-edit > summary::-webkit-details-marker { display: none; }
.pc-line-edit > summary::before { content: "✎"; font-size: 11px; }
.pc-line-edit-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px;
}
.pc-line-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.pc-line-swatch { cursor: pointer; line-height: 0; }
.pc-line-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.pc-line-swatch span {
  display: inline-block; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--line); box-shadow: inset 0 0 0 2px #fff; transition: border-color .12s ease, transform .08s ease;
}
.pc-line-swatch input:checked + span { border-color: var(--brand); transform: scale(1.08); }
.pc-line-edit-name {
  flex: 1 1 140px; min-width: 0; padding: 8px 10px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink-strong); background: #fff;
}
.pc-line-edit-save {
  padding: 8px 16px; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  background: var(--brand); color: #fff; border: none; border-radius: var(--r-md);
}
.pc-line-edit-save:hover { background: var(--brand-ink); }
