/* AF Personaliza tu pedido — v2.2.0 (visual unificado con Hub + Paquete + Caja) */
:root{
  --afp-navy: #121040;        /* unificado con Hub y Caja */
  --afp-brand: #121040;
  --afp-red: #ef1b13;          /* unificado con botón Añadir de Caja */
  --afp-red-dark: #d81711;
  --afp-blue: #2563eb;
  --afp-gold: #facc15;
  --afp-gold-soft: #fff7d6;
  --afp-ink: rgba(17,24,39,.82);
  --afp-line: rgba(17,24,39,.10);
  --afp-text: #181818;
  --afp-text-soft: #6b7280;
  --afp-text-muted: #9ca3af;
  --afp-border: #e5e7eb;
  --afp-border-soft: #f3f4f6;
  --afp-bg-soft: #fafafa;
  --afp-success: #16a34a;
  --afp-success-bg: #f0fdf4;
  --afp-success-border: #bbf7d0;
}

#afp.afp{
  margin: 0 0 18px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.afp-mount{
  clear: both;
  width: 100%;
  display: block;
  margin: 0;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product{
  position: relative;
}

.afp__heading{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.afp__eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 9px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--afp-gold-soft) 0%, #ffe998 100%);
  color: #3b2f00;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
  box-shadow: 0 10px 24px rgba(250,204,21,.24);
}

.afp__eyebrowStar,
.afp__loopBadgeStar,
.afp__serviceFlagStar{
  font-size: 12px;
  line-height: 1;
}

.afp__loopBadge{
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,247,214,.96) 0%, rgba(250,204,21,.92) 100%);
  color: #3b2f00;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .01em;
  box-shadow: 0 6px 14px rgba(250,204,21,.16);
  max-width: calc(100% - 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.afp__serviceFlag{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--afp-gold-soft) 0%, #ffe998 100%);
  color: #3b2f00;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(250,204,21,.20);
}

.afp__title{
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--afp-navy);
}

.afp__grid{
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 360px;
  grid-template-areas: "upload preview summary";
  gap: 20px;
  align-items: start;
}

.afp__grid > *{
  min-width: 0;
}

.afp__grid > .afp__box--dash{
  grid-area: upload;
}

.afp__grid > .afp__previewBox{
  grid-area: preview;
}

.afp__grid > .afp__right{
  grid-area: summary;
}

.afp__box{
  border-radius: 20px;
  padding: 18px;
  min-height: 260px;
  background: #fff;
  min-width: 0;
}

.afp__box--dash{
  border: 2px dashed rgba(17,24,39,.16);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  text-align: left;
}

.afp__box--solid{
  border: 1px solid var(--afp-line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.afp__icon{
  width: 74px;
  height: 74px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(17,24,39,.55);
  background: linear-gradient(180deg, rgba(248,250,252,.9) 0%, rgba(255,255,255,.7) 100%);
}

.afp__help{
  font-size: 12px;
  line-height: 1.5;
  color: rgba(17,24,39,.68);
}

.afp__help--center{
  text-align: center;
  margin-top: 10px;
}

.afp__actions{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.afp__file{
  max-width: 260px;
  width: 100%;
}

.afp__stepInline{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(11,18,32,.06);
}

.afp__stepInline--top{
  align-self: flex-start;
  margin-top: 0;
  margin-bottom: 2px;
}

.afp__stepInline--left{
  justify-content: flex-start;
}

.afp__stepCaption{
  font-size: 13px;
  font-weight: 800;
  color: var(--afp-navy);
}

.afp__fileMeta{
  font-size: 13px;
  color: rgba(17,24,39,.7);
  overflow-wrap: anywhere;
}

.afp__btn{
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, filter .12s ease;
  box-shadow: 0 12px 24px rgba(17,24,39,.08);
}

.afp__btn:disabled,
.afp__btn.is-loading{
  cursor: wait;
  opacity: .72;
  transform: none;
}

.afp__btn:disabled:hover,
.afp__btn.is-loading:hover{
  transform: none;
}

.afp__btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(17,24,39,.12);
}

.afp__btn:focus-visible,
.afp__step:focus-visible,
.afp__qty:focus-visible{
  outline: 3px solid rgba(215,29,36,.18);
  outline-offset: 2px;
}

.afp__btn:active{
  transform: translateY(1px);
}

.afp__btn--dark{
  background: linear-gradient(180deg, #172033 0%, var(--afp-navy) 100%);
  color: #fff;
}

.afp__btn--red{
  background: linear-gradient(180deg, #ef3b43 0%, var(--afp-red) 100%);
  color: #fff;
}

.afp__btn--red:hover{
  background: linear-gradient(180deg, #eb3139 0%, var(--afp-red-dark) 100%);
}

.afp__preview{
  position: relative;
  border-radius: 18px;
  min-height: 240px;
  background: radial-gradient(circle at top, rgba(237,242,247,.8), #fff 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: crosshair;
}

.afp__previewTools{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.afp__rangeWrap{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  flex: 1 1 240px;
}

/* Variante con botón reset (rotación) */
.afp__rangeWrap--rotation{
  grid-template-columns: 1fr auto auto;
}

.afp__rangeLabel{
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 800;
  color: var(--afp-navy);
}

.afp__rangeWrap input[type="range"]{
  width: 100%;
  accent-color: #2563eb;
}

.afp__rangeValue{
  min-width: 48px;
  text-align: right;
  color: var(--afp-navy);
  font-variant-numeric: tabular-nums;
}

.afp__rangeReset{
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: var(--afp-navy);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .12s ease;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.afp__rangeReset:hover{
  background: var(--afp-navy);
  color: #fff;
  border-color: var(--afp-navy);
}

.afp__rangeReset:active{
  transform: scale(0.96);
}

.afp__product{
  max-width: 86%;
  max-height: 210px;
  object-fit: contain;
  opacity: .96;
  position: relative;
  z-index: 0;
}

.afp__logo{
  position: absolute;
  top: 75%;
  left: 50%;
  transform:
    translate(-50%, -50%)
    rotate(var(--afp-logo-user-rotate, 0deg))
    perspective(700px)
    rotateY(var(--afp-logo-rotate, 0deg))
    scaleX(var(--afp-logo-squeeze, 1));
  transform-origin: center center;
  width: 88px;
  max-width: none;
  max-height: none;
  object-fit: contain;
  display: none;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.12));
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 3;
  --afp-logo-curve: 18px;
  --afp-logo-squeeze: 1;
  --afp-logo-rotate: 0deg;
  --afp-logo-user-rotate: 0deg;
  border-radius: var(--afp-logo-curve);
  clip-path: inset(0 round var(--afp-logo-curve));
}

.afp__preview.has-logo .afp__logo{
  display: block;
}

.afp__preview.is-dragging .afp__logo{
  cursor: grabbing;
}

.afp__cartFlyer{
  position: fixed;
  z-index: 999999;
  pointer-events: none;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 46px rgba(15,23,42,.22);
  overflow: hidden;
  transform-origin: center center;
  opacity: 1;
  will-change: transform, opacity;
}

.afp__cartFlyer.is-flying{
  transition: transform .72s cubic-bezier(.2,.8,.24,1), opacity .72s ease;
}

.afp__cartFlyerProduct{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 12px;
}

.afp__cartFlyerLogo{
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.12));
}

.afp-cart-breakdown{
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  color: #111827;
  font-size: 11px;
  line-height: 1.25;
  max-width: 100%;
}

.afp-cart-breakdown__row{
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.afp-cart-breakdown__label{
  color: rgba(17,24,39,.62);
}

.afp-cart-breakdown__value{
  color: #111827;
  font-weight: 800;
  text-align: right;
}

.afp__btn--ghost{
  background: #fff;
  color: var(--afp-navy);
  border: 1px solid rgba(17,24,39,.12);
  box-shadow: none;
}

.afp__btn--ghost:hover{
  background: #f8fafc;
}

/* ─── Quitar fondo (alpha) ─── */
.afp__bgRemove{
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.afp__btn--bgRemove{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  width: 100%;
  justify-content: center;
}

.afp__btn--bgRemove .afp__btnIcon{
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.afp__btn--bgRemove.is-loading{
  opacity: .6;
  pointer-events: none;
}

.afp__btn--bgRemove.is-loading::after{
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: afp-spin .7s linear infinite;
  margin-left: 6px;
}

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

.afp__bgRemoveStatus{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f0f9ff;
  color: #075985;
  border: 1px solid #bae6fd;
  line-height: 1.4;
}

.afp__bgRemoveStatus.is-error{
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.afp__btn--linkSmall{
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: var(--afp-text-soft);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
  align-self: flex-start;
}

.afp__btn--linkSmall:hover{
  color: var(--afp-brand);
}

/* ─── Texto Curvo (v2.4.0) ─── */
.afp__curvedText{
  margin-top: 12px;
}

.afp__btn--curveText{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  width: 100%;
  justify-content: center;
}

.afp__btn--curveText .afp__btnIcon{
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Layer del texto curvo en el preview */
.afp__curvedTextLayer{
  position: absolute;
  top: 32%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  max-width: 240px;
  pointer-events: none;
  z-index: 4;
}

.afp__curvedTextLayer svg{
  display: block;
  width: 100%;
  height: auto;
}

/* Modal de texto curvo */
.afp__modal--curveText .afp__modalDialog--form{
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 720px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
}

.afp__curveTitle{
  font-size: 20px;
  font-weight: 800;
  color: var(--afp-brand);
  margin: 0 0 4px;
}

.afp__curveDesc{
  font-size: 13px;
  color: var(--afp-text-soft);
  margin: 0 0 20px;
}

.afp__curveBody{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

@media (max-width: 600px){
  .afp__curveBody{
    grid-template-columns: 1fr;
  }
}

.afp__curveControls{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.afp__curveField{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.afp__curveField--row{
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.afp__curveFieldLabel{
  font-size: 12px;
  font-weight: 600;
  color: var(--afp-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.afp__curveField input[type="text"]{
  padding: 10px 12px;
  border: 1px solid var(--afp-border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}

.afp__curveField input[type="text"]:focus{
  outline: 0;
  border-color: var(--afp-brand);
  box-shadow: 0 0 0 3px rgba(18, 16, 64, 0.08);
}

.afp__curveField input[type="range"]{
  accent-color: var(--afp-brand);
}

.afp__curveField input[type="color"]{
  width: 50px;
  height: 32px;
  border: 1px solid var(--afp-border);
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
  background: #fff;
}

.afp__curveField select{
  padding: 8px 10px;
  border: 1px solid var(--afp-border);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  min-width: 140px;
}

.afp__curveField input[type="checkbox"]{
  width: 18px;
  height: 18px;
  accent-color: var(--afp-brand);
}

.afp__curveFieldValue{
  font-size: 12px;
  color: var(--afp-brand);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  align-self: flex-end;
  margin-top: -22px;
}

.afp__curvePreview{
  background: var(--afp-bg-soft);
  border: 1px solid var(--afp-border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
}

.afp__curvePreviewLabel{
  font-size: 11px;
  font-weight: 600;
  color: var(--afp-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.afp__curveSvgWrap{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 6px;
  padding: 12px;
  min-height: 120px;
}

.afp__curveSvgWrap svg{
  max-width: 100%;
  height: auto;
}

.afp__curveActions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.afp__curveActions .afp__btn--linkSmall{
  margin-right: auto;
}

.afp__dragHelp{
  margin-top: 6px;
  opacity: .72;
}

.afp__dragHelp.is-active{
  color: var(--afp-navy);
  opacity: 1;
}

.afp__row{
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.afp__row--cards{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.afp__pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--afp-line);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--afp-navy);
  background: #fff;
}

.afp__pill input{
  margin: 0;
  accent-color: var(--afp-red);
}

.afp__inkCard{
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 100px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.10);
  background: #fff;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}

.afp__inkCard:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15,23,42,.05);
}

.afp__inkCard.is-selected{
  border-color: rgba(215,29,36,.35);
  background: linear-gradient(180deg, #fff 0%, #fff8f8 100%);
  box-shadow: 0 14px 26px rgba(215,29,36,.08);
}

.afp__inkCard input{
  margin-top: 4px;
}

.afp__inkCardBody{
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.afp__inkCardTitle{
  font-size: 16px;
  font-weight: 800;
  color: var(--afp-navy);
  overflow-wrap: anywhere;
}

.afp__inkCardPrice{
  font-size: 15px;
  font-weight: 900;
  color: #111827;
  line-height: 1.2;
  word-break: keep-all;
}

.afp__inkCardMeta{
  font-size: 11px;
  line-height: 1.45;
  color: rgba(17,24,39,.52);
}

.afp__plateNote{
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(250,204,21,.26);
  background: linear-gradient(180deg, rgba(255,247,214,.82) 0%, rgba(255,252,235,.95) 100%);
  color: rgba(59,47,0,.9);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.afp__right{
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--afp-line);
  background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
  box-shadow: 0 18px 38px rgba(15,23,42,.06);
  min-width: 0;
  overflow: hidden;
}

.afp__rightTitle{
  font-size: 15px;
  font-weight: 900;
  color: var(--afp-navy);
}

.afp__stepper{
  display: inline-flex;
  align-items: center;
  border-radius: 16px;
  border: 1px solid rgba(17,24,39,.12);
  overflow: hidden;
  background: #f7f7f8;
}

.afp__step{
  width: 46px;
  height: 46px;
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--afp-navy);
  transition: background .12s ease;
}

.afp__step:hover{
  background: rgba(17,24,39,.05);
}

.afp__qty{
  width: 78px;
  height: 46px;
  text-align: center;
  border: 0;
  background: #fff;
  font-weight: 900;
  outline: none;
}

.afp__minnote{
  font-size: 14px;
  color: var(--afp-navy);
}

.afp__cta{
  width: 100%;
  font-size: 15px;
}

.afp__summary{
  font-size: 14px;
  color: var(--afp-ink);
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.afp__summary--total{
  padding-top: 12px;
  border-top: 1px solid rgba(17,24,39,.08);
  font-size: 15px;
}

.afp__summary strong{
  color: var(--afp-navy);
  overflow-wrap: anywhere;
}

#afp .afp__calculator{
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(17,24,39,.08);
  background: #fbfcff;
}

.afp__calculatorTitle{
  font-size: 15px;
  font-weight: 900;
  color: var(--afp-navy);
  margin-bottom: 12px;
}

.afp__calculatorGrid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.afp__calcItem{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(17,24,39,.06);
  min-width: 0;
}

.afp__calcItem--wide{
  grid-column: 1 / -1;
}

.afp__calcLabel{
  font-size: 12px;
  line-height: 1.4;
  color: rgba(17,24,39,.6);
}

.afp__calcValue{
  font-size: 17px;
  line-height: 1.35;
  color: var(--afp-navy);
  overflow-wrap: anywhere;
}

#afp_breakdown{
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(17,24,39,.08);
}

.afp__alert{
  padding: 10px 12px;
  border-radius: 12px;
  display: none;
  font-weight: 800;
  width: 100%;
  box-sizing: border-box;
}

.afp__alert--err{
  color: #b91c1c;
  border: 1px solid rgba(185,28,28,.25);
  background: rgba(185,28,28,.06);
}

.afp__alert--ok{
  color: #047857;
  border: 1px solid rgba(4,120,87,.25);
  background: rgba(4,120,87,.06);
}

.afp__steps{
  display: none;
}

.afp__modal[hidden]{
  display: none !important;
}

.afp__modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.afp__modalBackdrop{
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.72);
}

.afp__modalDialog{
  position: relative;
  z-index: 1;
  width: min(92vw, 980px);
  margin: 4vh auto;
  background: #fff;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.22);
}

.afp__modalClose{
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(15,23,42,.08);
  color: var(--afp-navy);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.afp__modalPreview{
  position: relative;
  min-height: min(78vh, 860px);
  border-radius: 18px;
  background: radial-gradient(circle at top, rgba(237,242,247,.9), #fff 72%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.afp__modalProduct{
  max-width: 84%;
  max-height: 72vh;
  object-fit: contain;
}

.afp__modalLogo{
  position: absolute;
  transform:
    translate(-50%, -50%)
    rotate(var(--afp-logo-user-rotate, 0deg))
    perspective(900px)
    rotateY(var(--afp-logo-rotate, 0deg))
    scaleX(var(--afp-logo-squeeze, 1));
  transform-origin: center center;
  width: 88px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.12));
  --afp-logo-curve: 18px;
  --afp-logo-squeeze: 1;
  --afp-logo-rotate: 0deg;
  --afp-logo-user-rotate: 0deg;
  border-radius: var(--afp-logo-curve);
  clip-path: inset(0 round var(--afp-logo-curve));
}

.afp__stepItem{
  text-align: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(17,24,39,.08);
  background: linear-gradient(180deg, #fff 0%, #f9fafb 100%);
  min-width: 0;
  overflow-wrap: anywhere;
}

.afp__bubble{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
}

.afp__stepTitle{
  margin-top: 10px;
  font-weight: 900;
  color: var(--afp-navy);
}

@media (max-width: 1180px){
  .afp__grid{
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "upload preview"
      "summary summary";
  }
}

@media (max-width: 980px){
  #afp.afp{
    padding: 18px;
  }

  .afp__grid,
  .afp__row--cards{
    grid-template-columns: 1fr;
  }

  .afp__grid{
    grid-template-areas:
      "upload"
      "preview"
      "summary";
  }

  .afp__title{
    font-size: 28px;
  }

  .afp__calculatorGrid{
    grid-template-columns: 1fr;
  }

  .afp__actions{
    width: 100%;
  }

  .afp__previewTools{
    flex-direction: column;
    align-items: stretch;
  }

  .afp__box--dash{
    text-align: center;
  }

  .afp__btn,
  .afp__file{
    width: 100%;
    max-width: none;
  }

  .afp__stepper{
    width: 100%;
    justify-content: space-between;
  }

  .afp__qty{
    width: 100%;
  }
}

@media (max-width: 640px){
  #afp.afp{
    padding: 14px;
    border-radius: 18px;
  }

  .afp__box,
  .afp__right{
    padding: 16px;
    min-height: auto;
  }

  .afp__preview{
    min-height: 210px;
  }

  .afp__title{
    font-size: 24px;
  }

  .afp__stepInline{
    width: 100%;
    justify-content: center;
  }

  .afp__stepInline--top{
    align-self: stretch;
  }
}

/* ═══════════════════════════════════════════════════════════════
   EDITOR DE DISEÑO v2.5.0 — modal con panel lateral
   ═══════════════════════════════════════════════════════════════ */

/* Botón Editor (reemplaza "Vista previa grande") */
.afp__btn--editor{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--afp-brand);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, transform .12s ease;
}

.afp__btn--editor:hover{
  background: #1a1860;
  color: #fff;
}

.afp__btn--editor:active{
  transform: scale(0.97);
}

.afp__btn--editor .afp__btnIcon{
  display: inline-flex;
  width: 16px;
  height: 16px;
}

/* Modal del editor: layout fullscreen-friendly */
.afp__modal--editor{
  z-index: 99999;
}

.afp__modalDialog--editor{
  width: min(96vw, 1180px);
  margin: 2vh auto;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.afp__editorLayout{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  height: min(94vh, 800px);
  max-height: 94vh;
}

.afp__editorCanvas{
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-right: 1px solid var(--afp-border);
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.afp__editorCanvas .afp__modalPreview{
  flex: 1;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  margin: 0;
}

.afp__editorHelp{
  padding: 10px 18px;
  font-size: 12px;
  color: var(--afp-text-muted);
  background: #fafafa;
  border-top: 1px solid var(--afp-border);
  text-align: center;
}

/* Panel lateral derecho */
.afp__editorPanel{
  background: #fff;
  border-left: 1px solid var(--afp-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px;
  gap: 18px;
}

.afp__editorTitle{
  font-size: 16px;
  font-weight: 800;
  color: var(--afp-brand);
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--afp-border-soft);
}

.afp__editorSection{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.afp__editorSectionLabel{
  font-size: 11px;
  font-weight: 700;
  color: var(--afp-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Lista de capas */
.afp__editorLayers{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.afp__editorLayer{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--afp-bg-soft);
  cursor: pointer;
  font-size: 13px;
  transition: all .12s ease;
}

.afp__editorLayer:hover{
  background: #f3f4f6;
}

.afp__editorLayer.is-selected{
  background: rgba(18, 16, 64, 0.08);
  border-color: var(--afp-brand);
  font-weight: 600;
}

.afp__editorLayerEmpty{
  padding: 12px;
  color: var(--afp-text-muted);
  font-size: 12px;
  text-align: center;
  border: 1px dashed var(--afp-border);
  border-radius: 6px;
  background: #fafafa;
}

.afp__editorLayerIcon{
  font-size: 14px;
}

.afp__editorLayerLabel{
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.afp__editorAddRow{
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.afp__btn--small{
  flex: 1;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
}

/* Propiedades del elemento */
.afp__editorProps{
  border-top: 1px solid var(--afp-border-soft);
  padding-top: 14px;
}

.afp__editorField{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.afp__editorField--row{
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.afp__editorFieldLabel{
  font-size: 12px;
  font-weight: 600;
  color: var(--afp-text);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.afp__editorFieldLabel strong{
  color: var(--afp-brand);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.afp__editorField input[type="text"],
.afp__editorField select{
  padding: 8px 10px;
  border: 1px solid var(--afp-border);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  width: 100%;
}

.afp__editorField input[type="text"]:focus,
.afp__editorField select:focus{
  outline: 0;
  border-color: var(--afp-brand);
  box-shadow: 0 0 0 3px rgba(18,16,64,.08);
}

.afp__editorField input[type="range"]{
  accent-color: var(--afp-brand);
  width: 100%;
}

.afp__editorField input[type="color"]{
  width: 50px;
  height: 32px;
  border: 1px solid var(--afp-border);
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
  background: #fff;
}

.afp__editorField input[type="checkbox"]{
  width: 18px;
  height: 18px;
  accent-color: var(--afp-brand);
}

/* Botones extra */
.afp__btn--danger{
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-weight: 600;
}

.afp__btn--danger:hover{
  background: #fee2e2;
}

.afp__editorFooter{
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--afp-border-soft);
  display: flex;
  justify-content: flex-end;
}

/* Elementos en el canvas: estado seleccionado */
.afp__editorEl{
  outline: 2px solid transparent;
  outline-offset: 4px;
  transition: outline-color .12s ease;
}

.afp__editorEl:hover{
  outline-color: rgba(18,16,64,.3);
}

/* Layer del texto en mini preview también arrastrable */
.afp__curvedTextLayer .afp__editorEl{
  pointer-events: auto;
}

/* Responsive: panel abajo en móvil */
@media (max-width: 760px){
  .afp__editorLayout{
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    height: auto;
    max-height: 96vh;
  }

  .afp__editorCanvas{
    border-right: 0;
    border-bottom: 1px solid var(--afp-border);
    min-height: 50vh;
  }

  .afp__editorPanel{
    max-height: 45vh;
    border-left: 0;
  }

  .afp__modalDialog--editor{
    margin: 2vh auto;
    width: 96vw;
  }
}

/* ═══════════════════════════════════════════════════════════════
   v2.6.0: PDP simplificado — controles movidos al editor
   ═══════════════════════════════════════════════════════════════ */

/* Tools del PDP ahora solo tienen el CTA grande */
.afp__previewTools--cta{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 0;
}

.afp__btn--editorBig{
  width: 100%;
  max-width: 360px;
  padding: 14px 24px;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(18,16,64,.18);
}

.afp__btn--editorBig:hover{
  box-shadow: 0 8px 22px rgba(18,16,64,.26);
  transform: translateY(-1px);
}

.afp__previewSubhint{
  font-size: 11px;
  color: var(--afp-text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Hacer que el logo del PDP se sienta más interactivo (drag obvio) */
.afp__preview.has-logo .afp__logo{
  cursor: grab;
}

.afp__preview.has-logo .afp__logo:active{
  cursor: grabbing;
}

/* En el modal editor: el logo es draggable también */
.afp__editorEl[data-afp-el-type="logo"]{
  cursor: grab;
}

.afp__editorEl[data-afp-el-type="logo"]:active{
  cursor: grabbing;
}
