/* =========================================================
   CAPA PREMIUM 2026
   Mejora la dirección de arte sin cambiar la estructura de datos.
   Referencias visuales: Capriccio e Irineo.
   ========================================================= */

/* ---------- Editor: opciones comprensibles y visuales ---------- */
.opciones-plantilla-premium {
    gap: 14px;
}

.opciones-plantilla-premium .tarjeta-plantilla {
    min-height: 190px;
    padding: 14px;
}

.opciones-plantilla-premium .tarjeta-plantilla strong {
    margin-top: 10px;
}

.opciones-plantilla-premium .tarjeta-plantilla small {
    line-height: 1.35;
}

.mini-premium-foto,
.mini-editorial-duo,
.mini-coleccion {
    position: relative;
    display: block;
    height: 92px;
    overflow: hidden;
    background:
        radial-gradient(circle at 70% 68%, rgba(207, 154, 67, 0.34), transparent 25%),
        linear-gradient(180deg, #140e0a 0 42%, #2b1b10 42% 100%);
    border: 1px solid rgba(185, 132, 43, 0.55);
    border-radius: 8px;
}

.mini-premium-foto::before,
.mini-editorial-duo::before,
.mini-coleccion::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(220, 174, 91, 0.72);
}

.mini-premium-foto::after {
    content: "PROMO";
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    color: #f6ead7;
    font: 700 11px Georgia, serif;
    text-align: center;
    letter-spacing: 0.12em;
}

.mini-premium-foto span {
    position: absolute;
    right: 14px;
    bottom: 11px;
    width: 44px;
    height: 39px;
    background: radial-gradient(ellipse at center, #d49c45 0 38%, #7f4e17 40% 62%, transparent 64%);
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
}

.mini-editorial-duo {
    background: #120d09;
}

.mini-editorial-duo span,
.mini-editorial-duo span::after {
    content: "";
    position: absolute;
    top: 39px;
    bottom: 8px;
    width: calc(50% - 9px);
    background:
        radial-gradient(circle at 50% 58%, #d89f45 0 17%, #714115 19% 35%, transparent 37%),
        linear-gradient(180deg, #2c1d12, #100c09);
    border: 1px solid rgba(197, 144, 56, 0.45);
}

.mini-editorial-duo span {
    left: 7px;
}

.mini-editorial-duo span::after {
    top: 0;
    right: calc(-100% - 4px);
    bottom: 0;
    width: 100%;
}

.mini-coleccion {
    background: #110c09;
}

.mini-coleccion span {
    position: absolute;
    inset: 39px 8px 8px;
    background:
        linear-gradient(90deg, rgba(199, 144, 54, 0.8) 0 31%, transparent 31% 34%, rgba(231, 196, 132, 0.65) 34% 65%, transparent 65% 68%, rgba(153, 95, 28, 0.8) 68% 100%);
    border-radius: 3px;
}

.direccion-arte-automatica {
    display: grid;
    gap: 4px;
    margin-top: 16px;
    padding: 14px 16px;
    color: #f6ead5;
    background: linear-gradient(135deg, #14100d, #261a11);
    border: 1px solid rgba(190, 137, 48, 0.48);
    border-radius: 12px;
}

.direccion-arte-automatica strong {
    font-size: 14px;
}

.direccion-arte-automatica span {
    color: rgba(246, 234, 213, 0.76);
    font-size: 12px;
    line-height: 1.45;
}

/* ---------- Lienzo común ---------- */
.flyer-canvas {
    container-type: size;
    --frame-gap: 1.22cqw;
    font-family: var(--flyer-body-font);
    background:
        radial-gradient(circle at 14% 14%, color-mix(in srgb, var(--flyer-brand) 18%, transparent), transparent 24%),
        radial-gradient(circle at 82% 72%, color-mix(in srgb, var(--flyer-brand) 12%, transparent), transparent 26%),
        linear-gradient(180deg, var(--flyer-bg) 0%, var(--flyer-bg-alt) 100%);
}

.flyer-canvas::before {
    inset: var(--frame-gap);
    z-index: 30;
    border: 0;
    background: var(--flyer-frame);
    -webkit-mask: url('../img/design/ornamental-frame.svg') center / 100% 100% no-repeat;
    mask: url('../img/design/ornamental-frame.svg') center / 100% 100% no-repeat;
    opacity: 0.96;
}

.flyer-canvas::after {
    inset: 0;
    z-index: 6;
    height: auto;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.46) 0%, transparent 31%, transparent 70%, rgba(0, 0, 0, 0.36) 100%),
        radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.28) 100%);
    opacity: 1;
}

.flyer-header,
.flyer-offer,
.flyer-price,
.flyer-footer {
    z-index: 18;
}

.flyer-gallery {
    z-index: 3;
}

.flyer-gallery::before {
    z-index: 4;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 38%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.15), transparent 40%);
    box-shadow:
        inset 0 0 0 0.12cqw color-mix(in srgb, var(--flyer-frame) 36%, transparent),
        inset 0 -3cqw 6cqw rgba(0, 0, 0, 0.24);
}

.flyer-gallery-item {
    isolation: isolate;
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.08), transparent 45%),
        rgba(13, 9, 7, 0.58);
}

.flyer-gallery-item::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, 0.18) 100%),
        radial-gradient(ellipse at center, transparent 54%, rgba(0, 0, 0, 0.2) 100%);
}

.flyer-gallery-item img {
    position: relative;
    z-index: 1;
}

.flyer-image-caption {
    position: absolute;
    right: 1.2cqw;
    bottom: 1.1cqw;
    left: 1.2cqw;
    z-index: 5;
    display: none;
    padding: 0.8cqw 1.1cqw;
    color: var(--flyer-text);
    font-family: var(--flyer-accent-font);
    font-size: 1.25cqw;
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
    background: rgba(8, 6, 5, 0.9);
    border: 0.12cqw solid color-mix(in srgb, var(--flyer-frame) 78%, white 22%);
}

.flyer-local-logo {
    position: relative;
}

.flyer-local-logo::after {
    content: "";
    position: absolute;
    top: calc(100% + 0.8cqw);
    left: 50%;
    width: 32cqw;
    height: 2.8cqw;
    background: var(--flyer-frame);
    -webkit-mask: url('../img/design/ornamental-divider.svg') center / contain no-repeat;
    mask: url('../img/design/ornamental-divider.svg') center / contain no-repeat;
    transform: translateX(-50%);
    opacity: 0.82;
}

.flyer-local-logo span {
    max-width: 52cqw;
    overflow: hidden;
    font-size: 4.7cqw;
    line-height: 0.9;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flyer-edition {
    display: none;
}

.flyer-eyebrow {
    color: var(--flyer-text);
    text-shadow: 0 0.45cqw 1.1cqw rgba(0, 0, 0, 0.32);
}

.flyer-title {
    text-shadow: 0 0.7cqw 1.7cqw rgba(0, 0, 0, 0.42);
}

.flyer-description {
    color: color-mix(in srgb, var(--flyer-text) 92%, var(--flyer-muted) 8%);
    text-shadow: 0 0.3cqw 0.9cqw rgba(0, 0, 0, 0.48);
}

.flyer-product-pill {
    color: var(--flyer-text);
    background: rgba(6, 5, 4, 0.54);
    border-color: color-mix(in srgb, var(--flyer-frame) 52%, transparent);
}

.flyer-price {
    filter: drop-shadow(0 1.2cqw 2.4cqw rgba(0, 0, 0, 0.42));
}

.flyer-price-label {
    display: none;
}

.flyer-price-value {
    min-width: 30cqw;
    padding: 1.55cqw 2.6cqw 1.35cqw;
    color: var(--flyer-price-text);
    background: linear-gradient(180deg, rgba(8, 6, 5, 0.97), rgba(15, 10, 7, 0.96));
    border: 0.28cqw solid var(--flyer-frame);
    box-shadow:
        inset 0 0 0 0.14cqw rgba(255, 255, 255, 0.04),
        0 1.2cqw 3.2cqw rgba(0, 0, 0, 0.42);
}

.flyer-footer {
    gap: 0.7cqw;
}

.flyer-footer img {
    max-width: 7.4cqw;
    max-height: 3.1cqw;
    padding: 0.18cqw 0.4cqw;
}

.flyer-footer span {
    font-size: 0.62cqw;
    letter-spacing: 0.19em;
}

/* ---------- Ajuste automático de densidad textual ---------- */
.flyer-canvas.titulo-largo .flyer-title {
    font-size: 6.55cqw !important;
    line-height: 0.95;
}

.flyer-canvas.titulo-muy-largo .flyer-title {
    font-size: 5.55cqw !important;
    line-height: 0.98;
}

.flyer-canvas.descripcion-larga .flyer-description {
    font-size: 1.18cqw;
    line-height: 1.32;
}

.flyer-canvas.muchos-productos .flyer-product-pill {
    padding: 0.34cqw 0.72cqw;
    font-size: 0.72cqw;
}

/* =========================================================
   1. PROMO FOTOGRÁFICA PREMIUM · referencia Capriccio
   ========================================================= */
.flyer-canvas.plantilla-impacto .flyer-header {
    top: 3.1%;
    left: 10%;
    width: 80%;
    min-height: 7.7%;
}

.flyer-canvas.plantilla-impacto .flyer-local-logo img {
    max-width: 35cqw;
    max-height: 9.3cqw;
}

.flyer-canvas.plantilla-impacto .flyer-offer {
    top: 13.8%;
    left: 8%;
    width: 84%;
}

.flyer-canvas.plantilla-impacto .flyer-eyebrow {
    margin-bottom: 1.2cqw;
    font-size: 4.4cqw;
    line-height: 0.95;
    letter-spacing: 0.07em;
}

.flyer-canvas.plantilla-impacto .flyer-title {
    max-width: 92%;
    margin-inline: auto;
    color: var(--flyer-brand-soft);
    font-size: 7.5cqw;
    line-height: 0.92;
}

.flyer-canvas.plantilla-impacto .flyer-description {
    max-width: 73%;
    margin-top: 1.2cqw;
    font-family: var(--flyer-title-font);
    font-size: 1.62cqw;
    font-style: italic;
}

.flyer-canvas.plantilla-impacto .flyer-product-list {
    display: none;
}

.flyer-canvas.plantilla-impacto .flyer-gallery {
    top: 37.5%;
    left: 2.8%;
    width: 94.4%;
    height: 57%;
    gap: 0;
    border-radius: 0;
}

.flyer-canvas.plantilla-impacto .flyer-gallery::before {
    border-radius: 0;
    box-shadow:
        inset 0 3.5cqw 5.5cqw rgba(0, 0, 0, 0.34),
        inset 0 -4cqw 7cqw rgba(0, 0, 0, 0.32);
}

.flyer-canvas.plantilla-impacto.modo-fotografia .flyer-gallery-item {
    border-radius: 0;
}

.flyer-canvas.plantilla-impacto.modo-fotografia .flyer-gallery-item img {
    object-fit: cover;
    filter: saturate(1.08) contrast(1.07) brightness(0.83) sepia(0.08);
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery {
    top: 41%;
    left: 5.5%;
    width: 89%;
    height: 48%;
    padding: 2cqw 3cqw 7cqw;
    background:
        radial-gradient(ellipse at 50% 78%, rgba(181, 119, 42, 0.32), transparent 35%),
        radial-gradient(circle at 50% 38%, rgba(255, 241, 211, 0.1), transparent 45%),
        linear-gradient(180deg, rgba(33, 21, 13, 0.2), rgba(8, 6, 5, 0.92));
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery-item {
    overflow: visible;
    background: transparent;
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery-item::after {
    content: "";
    position: absolute;
    z-index: 0;
    right: 13%;
    bottom: 3%;
    left: 13%;
    height: 8%;
    background: rgba(0, 0, 0, 0.48);
    border-radius: 50%;
    filter: blur(1.4cqw);
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery-item img {
    z-index: 2;
    padding: 0.4cqw;
    object-fit: contain;
    mix-blend-mode: normal;
    filter: drop-shadow(0 1.7cqw 1.3cqw rgba(0, 0, 0, 0.5));
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-2 {
    grid-template-columns: 1.18fr 0.82fr;
    align-items: end;
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-2 .flyer-gallery-item:first-child {
    transform: translate(5%, 1%) rotate(-2.4deg) scale(1.08);
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-2 .flyer-gallery-item:last-child {
    transform: translate(-10%, 8%) rotate(3deg) scale(0.88);
}

.flyer-canvas.plantilla-impacto .flyer-price {
    right: 5.2%;
    bottom: 4.1%;
    z-index: 22;
}

.flyer-canvas.plantilla-impacto .flyer-price-value {
    font-size: 6.15cqw;
}

.flyer-canvas.plantilla-impacto .flyer-footer {
    left: 5%;
    bottom: 2.1%;
    width: 38%;
    justify-content: flex-start;
    z-index: 22;
}

/* =========================================================
   2. EDITORIAL DE DOS PRODUCTOS · referencia Irineo
   ========================================================= */
.flyer-canvas.plantilla-editorial .flyer-header {
    top: 2.9%;
    left: 10%;
    width: 80%;
    min-height: 7.5%;
}

.flyer-canvas.plantilla-editorial .flyer-local-logo img {
    max-width: 32cqw;
    max-height: 8.5cqw;
}

.flyer-canvas.plantilla-editorial .flyer-offer {
    top: 12.4%;
    left: 7%;
    width: 86%;
}

.flyer-canvas.plantilla-editorial .flyer-eyebrow {
    max-width: 67%;
    margin: 0 auto 0.7cqw;
    font-family: var(--flyer-title-font);
    font-size: 2.7cqw;
    line-height: 1.02;
    letter-spacing: 0.04em;
}

.flyer-canvas.plantilla-editorial .flyer-title {
    max-width: 91%;
    margin-inline: auto;
    color: var(--flyer-brand);
    font-family: var(--flyer-accent-font);
    font-size: 8.1cqw;
    line-height: 0.86;
    letter-spacing: -0.045em;
    text-transform: uppercase;
}

.flyer-canvas.plantilla-editorial .flyer-description {
    max-width: 66%;
    margin-top: 1.35cqw;
    font-family: var(--flyer-title-font);
    font-size: 1.75cqw;
    line-height: 1.18;
}

.flyer-canvas.plantilla-editorial .flyer-product-list {
    display: none;
}

.flyer-canvas.plantilla-editorial .flyer-gallery {
    top: 38.2%;
    left: 2.2%;
    width: 95.6%;
    height: 55.7%;
    gap: 1.05cqw;
    padding: 0 1cqw;
    border-radius: 0;
}

.flyer-canvas.plantilla-editorial .flyer-gallery::before {
    display: none;
}

.flyer-canvas.plantilla-editorial .flyer-gallery-item {
    border-radius: 0;
    border: 0.11cqw solid color-mix(in srgb, var(--flyer-frame) 60%, transparent);
    background: #0c0907;
}

.flyer-canvas.plantilla-editorial .flyer-gallery-item img {
    padding: 0;
    object-fit: cover;
    filter: saturate(1.06) contrast(1.06) brightness(0.85) sepia(0.07);
}

.flyer-canvas.plantilla-editorial.modo-producto .flyer-gallery-item img {
    padding: 2cqw 1.5cqw 9cqw;
    object-fit: contain;
    filter: drop-shadow(0 1.3cqw 1.4cqw rgba(0, 0, 0, 0.48));
}

.flyer-canvas.plantilla-editorial .flyer-image-caption {
    display: block;
    right: 1.8cqw;
    bottom: 1.6cqw;
    left: 1.8cqw;
    min-height: 5.7cqw;
    padding: 1.05cqw 0.9cqw 0.9cqw;
    font-size: 1.45cqw;
    border-radius: 0.25cqw;
}

.flyer-canvas.plantilla-editorial .flyer-price {
    right: 5.5%;
    bottom: 3.8%;
    z-index: 23;
}

.flyer-canvas.plantilla-editorial .flyer-price-value {
    min-width: 24cqw;
    font-size: 5.1cqw;
}

.flyer-canvas.plantilla-editorial .flyer-footer {
    left: 4.8%;
    bottom: 2%;
    width: 34%;
    justify-content: flex-start;
    z-index: 23;
}

/* Una sola imagen en editorial: conservar composición elegante */
.flyer-canvas.plantilla-editorial .flyer-gallery.cantidad-1 {
    left: 7%;
    width: 86%;
}

/* =========================================================
   3. COLECCIÓN GASTRONÓMICA · tres o cuatro imágenes
   ========================================================= */
.flyer-canvas.plantilla-mosaico .flyer-header {
    top: 3%;
    left: 10%;
    width: 80%;
    min-height: 7.5%;
}

.flyer-canvas.plantilla-mosaico .flyer-offer {
    top: 12.2%;
    left: 7%;
    width: 86%;
}

.flyer-canvas.plantilla-mosaico .flyer-eyebrow {
    font-family: var(--flyer-title-font);
    font-size: 2.4cqw;
}

.flyer-canvas.plantilla-mosaico .flyer-title {
    color: var(--flyer-brand-soft);
    font-size: 6.9cqw;
    line-height: 0.9;
}

.flyer-canvas.plantilla-mosaico .flyer-description {
    max-width: 70%;
    font-family: var(--flyer-title-font);
    font-size: 1.55cqw;
}

.flyer-canvas.plantilla-mosaico .flyer-product-list {
    display: none;
}

.flyer-canvas.plantilla-mosaico .flyer-gallery {
    top: 35.5%;
    left: 4.5%;
    width: 91%;
    height: 56.5%;
    gap: 0.75cqw;
    padding: 0.8cqw;
    border-radius: 0;
    background: rgba(5, 4, 3, 0.46);
    border: 0.11cqw solid color-mix(in srgb, var(--flyer-frame) 48%, transparent);
}

.flyer-canvas.plantilla-mosaico .flyer-gallery-item {
    border-radius: 0.25cqw;
    border: 0.08cqw solid color-mix(in srgb, var(--flyer-frame) 34%, transparent);
}

.flyer-canvas.plantilla-mosaico .flyer-gallery-item img {
    object-fit: cover;
    filter: saturate(1.06) contrast(1.05) brightness(0.88) sepia(0.04);
}

.flyer-canvas.plantilla-mosaico.modo-producto .flyer-gallery-item img {
    padding: 1cqw 1cqw 5.5cqw;
    object-fit: contain;
    filter: drop-shadow(0 1cqw 1.2cqw rgba(0, 0, 0, 0.48));
}

.flyer-canvas.plantilla-mosaico .flyer-image-caption {
    display: block;
    right: 0.8cqw;
    bottom: 0.7cqw;
    left: 0.8cqw;
    padding: 0.55cqw 0.7cqw;
    font-size: 0.86cqw;
}

.flyer-canvas.plantilla-mosaico .flyer-price {
    right: 5.5%;
    bottom: 3.6%;
    z-index: 23;
}

.flyer-canvas.plantilla-mosaico .flyer-price-value {
    min-width: 22cqw;
    font-size: 4.8cqw;
}

.flyer-canvas.plantilla-mosaico .flyer-footer {
    left: 4.8%;
    bottom: 2%;
    width: 34%;
    justify-content: flex-start;
    z-index: 23;
}

/* ---------- Perfil provisional por local ---------- */
.flyer-canvas[data-local-profile="capriccio"] {
    --flyer-brand: #c5913b;
    --flyer-brand-soft: #efc96f;
    --flyer-frame: #c5913b;
    --flyer-bg: #090604;
    --flyer-bg-alt: #1c110b;
}

.flyer-canvas[data-local-profile="capriccio"] .flyer-local-logo span {
    font-style: italic;
    text-transform: none;
}

.flyer-canvas[data-local-profile="irineo"] {
    --flyer-brand: #ad7427;
    --flyer-brand-soft: #ddb05e;
    --flyer-frame: #ad7427;
    --flyer-bg: #090705;
    --flyer-bg-alt: #17100b;
}

.flyer-canvas[data-local-profile="irineo"] .flyer-local-logo span {
    font-style: italic;
    text-transform: none;
}

/* En el editor el A4 debe seguir siendo fiel al PDF */
.hoja-a4 .flyer-canvas {
    transform: translateZ(0);
}

@media print {
    .flyer-canvas::before,
    .flyer-canvas::after,
    .flyer-gallery-item::before,
    .flyer-image-caption {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ---------- Indicador de calidad de impresión ---------- */
.estado-calidad-diseno {
    display: grid;
    gap: 2px;
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #f4f2ec;
    border: 1px solid #d7d2c5;
    border-radius: 10px;
}

.estado-calidad-diseno strong {
    font-size: 12px;
}

.estado-calidad-diseno span {
    color: #687078;
    font-size: 11px;
    line-height: 1.35;
}

.estado-calidad-diseno[data-estado="ok"] {
    background: #eef8f1;
    border-color: #a8d4b4;
}

.estado-calidad-diseno[data-estado="advertencia"] {
    background: #fff8e8;
    border-color: #e5c779;
}

.estado-calidad-diseno[data-estado="error"] {
    background: #fff0ee;
    border-color: #e0a49c;
}

/* =========================================================
   REVISIÓN V2 · COMPOSICIÓN DE PRODUCTOS REAL
   Corrige escala, jerarquía y profundidad para combos de envases.
   ========================================================= */

.flyer-canvas {
    background:
        radial-gradient(ellipse at 50% 64%, color-mix(in srgb, var(--flyer-brand) 24%, transparent) 0%, transparent 38%),
        radial-gradient(circle at 20% 18%, rgba(255, 239, 205, 0.055), transparent 30%),
        linear-gradient(145deg, #080604 0%, var(--flyer-bg) 46%, var(--flyer-bg-alt) 100%);
}

.flyer-canvas::before {
    inset: 1.15cqw;
    background: var(--flyer-frame);
    opacity: 1;
    filter: drop-shadow(0 0 0.35cqw rgba(197, 145, 59, 0.18));
}

.flyer-canvas.plantilla-impacto .flyer-header {
    top: 2.8%;
    left: 13%;
    width: 74%;
    min-height: 7.8%;
}

.flyer-canvas.plantilla-impacto .flyer-local-logo img {
    max-width: 38cqw;
    max-height: 8.4cqw;
}

.flyer-canvas.plantilla-impacto .flyer-local-logo::after {
    top: calc(100% + 0.55cqw);
    width: 27cqw;
    height: 2.15cqw;
    opacity: 0.72;
}

.flyer-canvas.plantilla-impacto .flyer-offer {
    top: 12.2%;
    left: 8%;
    width: 84%;
}

.flyer-canvas.plantilla-impacto .flyer-eyebrow {
    margin-bottom: 0.75cqw;
    font-size: 3.2cqw;
    letter-spacing: 0.13em;
}

.flyer-canvas.plantilla-impacto .flyer-title {
    max-width: 88%;
    font-size: 6.7cqw;
    line-height: 0.94;
    text-wrap: balance;
}

.flyer-canvas.plantilla-impacto .flyer-description {
    max-width: 76%;
    margin-top: 1cqw;
    font-size: 1.85cqw;
    line-height: 1.2;
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery {
    top: 31.5%;
    left: 5.5%;
    width: 89%;
    height: 56.5%;
    display: block;
    overflow: visible;
    padding: 0;
    background:
        radial-gradient(ellipse at 48% 76%, color-mix(in srgb, var(--flyer-brand) 34%, transparent) 0%, transparent 40%),
        radial-gradient(circle at 48% 42%, rgba(255, 246, 224, 0.105) 0%, transparent 50%);
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery::before {
    inset: auto 9% 4.5% 9%;
    height: 8%;
    background: rgba(0, 0, 0, 0.58);
    border-radius: 50%;
    box-shadow: none;
    filter: blur(1.55cqw);
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery-item {
    position: absolute;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    transform: none;
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery-item::before {
    display: none;
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery-item::after {
    right: 15%;
    bottom: 2.5%;
    left: 15%;
    height: 6%;
    background: rgba(0, 0, 0, 0.48);
    filter: blur(1.15cqw);
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery-item img {
    width: 100%;
    height: 100%;
    padding: 0;
    object-fit: contain;
    filter:
        drop-shadow(0 1.4cqw 1.05cqw rgba(0, 0, 0, 0.58))
        drop-shadow(0 0.25cqw 0.32cqw rgba(255, 255, 255, 0.08));
}

/* Un producto: protagonista centrado, sin agrandarlo hasta cortar la pieza. */
.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-1 .flyer-gallery-item {
    top: 1%;
    left: 17%;
    width: 66%;
    height: 92%;
}

/* Dos productos: composición publicitaria, no grilla 50/50. */
.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-2 .flyer-gallery-item:first-child {
    top: 0;
    left: 0;
    width: 61%;
    height: 96%;
    z-index: 2;
    transform: rotate(-1.6deg);
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-2 .flyer-gallery-item:last-child {
    right: 0;
    bottom: 10%;
    width: 50%;
    height: 46%;
    z-index: 3;
    transform: rotate(2.2deg);
}

/* Si el principal es horizontal, se invierte la lógica para no deformar la jerarquía. */
.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-2 .flyer-gallery-item:first-child[data-ratio="horizontal"] {
    top: 10%;
    left: 0;
    width: 58%;
    height: 55%;
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-2 .flyer-gallery-item:last-child[data-ratio="vertical"] {
    right: 2%;
    bottom: 1%;
    width: 54%;
    height: 94%;
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-2 .flyer-gallery-item:first-child[data-ratio="horizontal"] + .flyer-gallery-item[data-ratio="horizontal"] {
    right: 1%;
    bottom: 4%;
    width: 54%;
    height: 52%;
}

/* Tres y cuatro productos: arco visual equilibrado. */
.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-3,
.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: end;
    gap: 0.5cqw;
    padding: 2cqw 1cqw 7cqw;
}

.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-3 .flyer-gallery-item,
.flyer-canvas.plantilla-impacto.modo-producto .flyer-gallery.cantidad-4 .flyer-gallery-item {
    position: relative;
    width: auto;
    height: auto;
    min-height: 18cqw;
}

.flyer-canvas.plantilla-impacto .flyer-price {
    right: 6.8%;
    bottom: 4.8%;
}

.flyer-canvas.plantilla-impacto .flyer-price-value {
    min-width: 26cqw;
    padding: 1.35cqw 2.3cqw 1.15cqw;
    font-size: 5.7cqw;
    border-width: 0.22cqw;
}

.flyer-canvas.plantilla-impacto .flyer-footer {
    left: 6.8%;
    bottom: 3.1%;
    width: 32%;
}

.flyer-canvas.plantilla-impacto .flyer-footer img {
    max-width: 8.5cqw;
    max-height: 3.5cqw;
}

.flyer-canvas.plantilla-impacto .flyer-footer span {
    font-size: 0.7cqw;
}

/* En vista chica, evitar que el texto secundario se vuelva microscópico. */
.flyer-canvas.plantilla-impacto.titulo-largo .flyer-title {
    font-size: 5.8cqw !important;
}

.flyer-canvas.plantilla-impacto.titulo-muy-largo .flyer-title {
    font-size: 4.9cqw !important;
}

.flyer-ornamental-frame {
    position: absolute;
    inset: 1.05cqw;
    z-index: 31;
    display: block;
    width: calc(100% - 2.1cqw);
    height: calc(100% - 2.1cqw);
    pointer-events: none;
    object-fit: fill;
    opacity: 0.98;
    filter: drop-shadow(0 0 0.28cqw rgba(0, 0, 0, 0.42));
}

.flyer-canvas::before {
    display: none;
}
