@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Cormorant+Garamond:wght@500;600;700&family=Montserrat:wght@400;500;600;700;800&display=swap');

/* =========================================================
   FLYERS GASTRONÓMICOS HIP · DIRECCIÓN DE ARTE PREMIUM
   Base nueva inspirada en las referencias de Capriccio e Irineo.
   ========================================================= */

.flyer-canvas {
    --flyer-brand: #C5913B;
    --flyer-brand-soft: #EBCB8B;
    --flyer-bg: #0C0908;
    --flyer-bg-alt: #17110D;
    --flyer-surface: rgba(17, 11, 9, 0.84);
    --flyer-surface-soft: rgba(31, 22, 17, 0.58);
    --flyer-text: #FFF7EB;
    --flyer-muted: #E2C58A;
    --flyer-price-bg: #090707;
    --flyer-price-text: #FFF8EF;
    --flyer-frame: #C5913B;
    --flyer-shadow: rgba(0, 0, 0, 0.38);
    --flyer-tint: rgba(0, 0, 0, 0.18);
    --flyer-footer-bg: #090707;
    --flyer-footer-text: #F3E2BE;
    --flyer-title-font: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --flyer-accent-font: "Cinzel", Georgia, "Times New Roman", serif;
    --flyer-body-font: "Montserrat", Arial, sans-serif;

    position: relative;
    width: 100%;
    aspect-ratio: 210 / 297;
    overflow: hidden;
    color: var(--flyer-text);
    background:
        radial-gradient(circle at 16% 18%, rgba(255, 202, 112, 0.18), transparent 26%),
        radial-gradient(circle at 80% 70%, rgba(197, 145, 59, 0.12), transparent 24%),
        linear-gradient(180deg, var(--flyer-bg) 0%, var(--flyer-bg-alt) 100%);
    box-shadow: 0 2.6cqw 7.5cqw rgba(0, 0, 0, 0.28);
    isolation: isolate;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.flyer-canvas,
.flyer-canvas * {
    box-sizing: border-box;
}

.flyer-canvas::before,
.flyer-canvas::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.flyer-canvas::before {
    inset: 1.1cqw;
    border: 0.24cqw solid color-mix(in srgb, var(--flyer-frame) 88%, white 12%);
    z-index: 1;
}

.flyer-canvas::after {
    inset: 3.2cqw 2.4cqw auto;
    height: 1.8cqw;
    background:
        linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent),
        radial-gradient(circle at left, var(--flyer-frame) 0 0.26cqw, transparent 0.28cqw),
        radial-gradient(circle at right, var(--flyer-frame) 0 0.26cqw, transparent 0.28cqw);
    opacity: 0.65;
    z-index: 1;
}

.flyer-header,
.flyer-gallery,
.flyer-offer,
.flyer-price,
.flyer-footer {
    position: absolute;
    z-index: 2;
}

.flyer-header {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flyer-local-logo {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.flyer-local-logo img {
    display: block;
    width: auto;
    max-width: 25cqw;
    max-height: 8.8cqw;
    object-fit: contain;
    filter: drop-shadow(0 0.45cqw 1cqw rgba(0, 0, 0, 0.2));
}

.flyer-local-logo span {
    color: var(--flyer-text);
    font-family: var(--flyer-title-font);
    font-size: 4.2cqw;
    font-style: italic;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.flyer-edition {
    position: absolute;
    right: 0;
    top: 0.35cqw;
    color: color-mix(in srgb, var(--flyer-muted) 85%, white 15%);
    font-family: var(--flyer-body-font);
    font-size: 0.74cqw;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.78;
}

.flyer-offer {
    text-align: center;
}

.flyer-eyebrow {
    margin: 0 0 0.8cqw;
    color: var(--flyer-text);
    font-family: var(--flyer-accent-font);
    font-size: 2.15cqw;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.flyer-title {
    margin: 0;
    color: var(--flyer-brand-soft);
    font-family: var(--flyer-title-font);
    font-size: 7.25cqw;
    font-weight: 700;
    line-height: 0.94;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.flyer-description {
    max-width: 100%;
    margin: 1.25cqw auto 0;
    color: var(--flyer-text);
    font-family: var(--flyer-body-font);
    font-size: 1.45cqw;
    font-weight: 500;
    line-height: 1.42;
    text-wrap: pretty;
}

.flyer-product-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6cqw;
    margin-top: 1.2cqw;
}

.flyer-product-pill {
    padding: 0.45cqw 1cqw;
    color: var(--flyer-text);
    font-family: var(--flyer-body-font);
    font-size: 0.9cqw;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.06);
    border: 0.11cqw solid rgba(235, 203, 139, 0.3);
    border-radius: 999px;
    backdrop-filter: blur(0.3cqw);
}

.flyer-gallery {
    display: grid;
    gap: 0.85cqw;
}

.flyer-gallery::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    box-shadow: inset 0 0 0 0.12cqw rgba(235, 203, 139, 0.18);
    pointer-events: none;
}

.flyer-gallery-item {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 1.4cqw;
    background: rgba(255, 255, 255, 0.04);
}

.flyer-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
}

.flyer-gallery-vacia {
    display: grid;
    grid-column: 1 / -1;
    place-items: center;
    min-height: 100%;
    color: rgba(255, 247, 235, 0.72);
    font-family: var(--flyer-body-font);
    font-size: 1.55cqw;
    font-weight: 600;
    text-align: center;
    padding: 0 3cqw;
}

.flyer-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55cqw;
}

.flyer-price-label {
    color: var(--flyer-brand-soft);
    font-family: var(--flyer-body-font);
    font-size: 0.92cqw;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.flyer-price-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28cqw;
    padding: 1.55cqw 2.8cqw 1.3cqw;
    color: var(--flyer-price-text);
    font-family: var(--flyer-accent-font);
    font-size: 6.35cqw;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    white-space: nowrap;
    background: linear-gradient(180deg, rgba(10, 8, 7, 0.96), rgba(16, 12, 10, 0.94));
    border: 0.28cqw solid color-mix(in srgb, var(--flyer-frame) 90%, white 10%);
    box-shadow: 0 1.1cqw 3.2cqw var(--flyer-shadow);
}

.flyer-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1cqw;
}

.flyer-footer img {
    width: auto;
    max-width: 9cqw;
    max-height: 3.7cqw;
    padding: 0.2cqw 0.5cqw;
    object-fit: contain;
    background: #fff;
    border-radius: 0.3cqw;
}

.flyer-footer span {
    color: var(--flyer-footer-text);
    font-family: var(--flyer-body-font);
    font-size: 0.72cqw;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Tratamientos de imagen */
.flyer-canvas.modo-fotografia .flyer-gallery-item img {
    object-fit: cover;
    filter: saturate(1.03) contrast(1.02) brightness(0.98);
}

.flyer-canvas.modo-fotografia .flyer-gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 20%, rgba(0,0,0,0.12) 100%);
    pointer-events: none;
}

.flyer-canvas.modo-producto .flyer-gallery-item {
    background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.12), rgba(255,255,255,0.02) 70%);
}

.flyer-canvas.modo-producto .flyer-gallery-item img {
    object-fit: contain;
    padding: 1.2cqw;
    filter: drop-shadow(0 1.5cqw 1.8cqw rgba(0, 0, 0, 0.24));
}

.flyer-gallery.cantidad-0 {
    grid-template-columns: 1fr;
}

.flyer-gallery.cantidad-1 {
    grid-template-columns: 1fr;
}

.flyer-gallery.cantidad-2 {
    grid-template-columns: 1fr 1fr;
}

.flyer-gallery.cantidad-3 {
    grid-template-columns: 1.18fr 0.82fr;
    grid-template-rows: 1fr 1fr;
}

.flyer-gallery.cantidad-3 .flyer-gallery-item:first-child {
    grid-row: 1 / 3;
}

.flyer-gallery.cantidad-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.flyer-gallery.cantidad-1 .flyer-gallery-item {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}

/* =========================================================
   PLANTILLA 1 · PROMO PREMIUM (Capriccio-like)
   ========================================================= */

.flyer-canvas.plantilla-impacto .flyer-header {
    top: 4.1%;
    left: 9%;
    width: 82%;
    min-height: 8%;
}

.plantilla-impacto .flyer-offer {
    top: 12.8%;
    left: 10%;
    width: 80%;
}

.plantilla-impacto .flyer-title {
    font-size: 7.9cqw;
}

.plantilla-impacto .flyer-description {
    max-width: 74%;
}

.plantilla-impacto .flyer-product-list {
    max-width: 78%;
    margin-inline: auto;
}

.plantilla-impacto .flyer-gallery {
    left: 6.8%;
    top: 48.8%;
    width: 86.4%;
    height: 35.7%;
    border-radius: 2.2cqw;
}

.plantilla-impacto.modo-fotografia .flyer-gallery {
    border-radius: 1.6cqw;
}

.plantilla-impacto.modo-producto .flyer-gallery.cantidad-1 .flyer-gallery-item img {
    padding-inline: 8cqw;
}

.plantilla-impacto.modo-producto .flyer-gallery.cantidad-2 .flyer-gallery-item:first-child img {
    transform: rotate(-3deg) scale(1.06);
}

.plantilla-impacto.modo-producto .flyer-gallery.cantidad-2 .flyer-gallery-item:last-child img {
    transform: rotate(2.5deg) scale(0.95);
}

.plantilla-impacto .flyer-price {
    right: 7.2%;
    bottom: 6.2%;
}

.plantilla-impacto .flyer-footer {
    left: 0;
    bottom: 2.2%;
    width: 100%;
}

/* =========================================================
   PLANTILLA 2 · EDITORIAL DE PRODUCTOS (Irineo-like)
   ========================================================= */

.flyer-canvas.plantilla-editorial .flyer-header {
    top: 3.8%;
    left: 8%;
    width: 84%;
    min-height: 8%;
}

.plantilla-editorial .flyer-offer {
    top: 12%;
    left: 9%;
    width: 82%;
}

.plantilla-editorial .flyer-eyebrow {
    color: var(--flyer-text);
    font-size: 1.9cqw;
    line-height: 1.18;
}

.plantilla-editorial .flyer-title {
    font-family: var(--flyer-accent-font);
    font-size: 8.5cqw;
    line-height: 0.92;
    text-transform: uppercase;
    letter-spacing: -0.04em;
}

.plantilla-editorial .flyer-description {
    max-width: 70%;
}

.plantilla-editorial .flyer-gallery {
    left: 4.6%;
    top: 48.5%;
    width: 90.8%;
    height: 36.6%;
    border-radius: 0.8cqw;
}

.plantilla-editorial .flyer-gallery::before {
    box-shadow: inset 0 0 0 0.11cqw rgba(235, 203, 139, 0.22);
    border-radius: 0.8cqw;
}

.plantilla-editorial .flyer-gallery-item {
    border-radius: 0.6cqw;
}

.plantilla-editorial.modo-fotografia .flyer-gallery-item {
    border: 0.1cqw solid rgba(235, 203, 139, 0.24);
}

.plantilla-editorial .flyer-price {
    right: 7.2%;
    bottom: 5.8%;
}

.plantilla-editorial .flyer-price-value {
    min-width: 25cqw;
    font-size: 5.55cqw;
}

.plantilla-editorial .flyer-footer {
    left: 0;
    bottom: 2%;
    width: 100%;
}

/* =========================================================
   PLANTILLA 3 · VITRINA GASTRONÓMICA
   ========================================================= */

.flyer-canvas.plantilla-mosaico .flyer-header {
    top: 4%;
    left: 8%;
    width: 84%;
    min-height: 8%;
}

.plantilla-mosaico .flyer-offer {
    top: 12%;
    left: 8.5%;
    width: 83%;
}

.plantilla-mosaico .flyer-title {
    font-family: var(--flyer-accent-font);
    font-size: 7.4cqw;
    text-transform: uppercase;
}

.plantilla-mosaico .flyer-description {
    max-width: 78%;
}

.plantilla-mosaico .flyer-gallery {
    left: 6.7%;
    top: 40%;
    width: 86.6%;
    height: 43%;
    border-radius: 1.5cqw;
}

.plantilla-mosaico .flyer-gallery-item {
    border-radius: 1.2cqw;
}

.plantilla-mosaico .flyer-price {
    right: 7.2%;
    bottom: 6.2%;
}

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

.plantilla-mosaico .flyer-footer {
    left: 0;
    bottom: 2.2%;
    width: 100%;
}

/* Ajustes de perfil */
.flyer-canvas[data-local-profile="capriccio"] .flyer-local-logo img {
    max-height: 9.4cqw;
}

.flyer-canvas[data-local-profile="capriccio"] .flyer-eyebrow {
    font-size: 2.05cqw;
}

.flyer-canvas[data-local-profile="capriccio"].plantilla-impacto .flyer-title {
    font-size: 8.2cqw;
}

.flyer-canvas[data-local-profile="irineo"].plantilla-editorial .flyer-title {
    font-size: 8.9cqw;
}

.flyer-canvas[data-local-profile="irineo"].plantilla-editorial .flyer-description {
    max-width: 82%;
}

.flyer-canvas[data-local-profile="irineo"] .flyer-header,
.flyer-canvas[data-local-profile="capriccio"] .flyer-header {
    justify-content: center;
}

.flyer-canvas[data-local-profile="irineo"] .flyer-product-list,
.flyer-canvas[data-local-profile="capriccio"] .flyer-product-list {
    margin-top: 1.45cqw;
}

/* Vista previa y PDF */
@media print {
    .flyer-canvas,
    .flyer-canvas::before,
    .flyer-canvas::after,
    .flyer-gallery::before,
    .flyer-price-value,
    .flyer-footer,
    .flyer-product-pill {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
}
