.print-flyer-btn img {
    display: none;
}

.print-flyer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.print-flyer-modal {
    width: min(1120px, 100%);
    max-height: 100%;
    min-height: 0;
    background: var(--color-charcoal-dark, #1d2027);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
}

.print-flyer-head,
.print-flyer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.print-flyer-foot {
    border-bottom: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    background: var(--color-charcoal-dark, #1d2027);
}

.print-flyer-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-family: "Ysabeau SC", sans-serif;
}

.print-flyer-body {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 0;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.print-flyer-settings {
    padding: 16px 18px 20px;
    overflow: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
}

.print-flyer-settings label,
.print-flyer-settings .form-label {
    color: #d8d8d8;
    font-size: 0.86rem;
}

.print-flyer-settings .form-control,
.print-flyer-settings .form-select {
    background: #252935;
    border-color: #3f445b;
    color: #fff;
}

.print-flyer-settings .form-check-input:checked {
    background-color: var(--color-orange, #ff6600);
    border-color: var(--color-orange, #ff6600);
}

.print-flyer-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.print-flyer-layout button {
    flex: 1 1 30%;
    min-width: 88px;
}

.print-flyer-layout button.active {
    background: var(--color-orange, #ff6600) !important;
    border-color: var(--color-orange, #ff6600) !important;
    color: #fff !important;
}

.print-flyer-goods {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.print-flyer-goods li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.86rem;
}

.print-flyer-goods li.is-off {
    opacity: 0.45;
}

.print-flyer-goods .pf-order {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.print-flyer-goods .pf-order button {
    line-height: 1;
    padding: 0 6px;
}

.print-flyer-hint {
    font-size: 0.8rem;
    color: #b9b3c7;
    margin: 0;
}

.print-flyer-preview-col {
    padding: 18px;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #111318;
}

.print-flyer-preview-wrap {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 210 / 297;
    background: #4a4e5c;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
}

.print-flyer-preview-wrap .print-flyer-sheet {
    transform-origin: top left;
}

.print-flyer-sheet {
    width: 210mm;
    height: 297mm;
    padding: 8mm;
    box-sizing: border-box;
    background: #fff;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
}

.print-flyer-sheet--1 {
    display: flex;
    flex-direction: column;
}

.print-flyer-sheet--2 {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 0;
}

.print-flyer-sheet--4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
}

.pf-card {
    box-sizing: border-box;
    padding: 4mm;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.print-flyer-sheet--2 .pf-card:first-child {
    border-bottom: 1px dashed #888;
}

.print-flyer-sheet--2 .pf-card:first-child::after {
    content: "✂";
    position: absolute;
    left: 50%;
    bottom: -0.7em;
    transform: translateX(-50%);
    background: #fff;
    color: #666;
    font-size: 12px;
    line-height: 1;
    padding: 0 4px;
    z-index: 2;
}

.print-flyer-sheet--4 .pf-card:nth-child(odd) {
    border-right: 1px dashed #888;
}

.print-flyer-sheet--4 .pf-card:nth-child(-n+2) {
    border-bottom: 1px dashed #888;
}

.pf-kicker {
    font-size: 11px;
    letter-spacing: 0.16em;
    font-weight: 700;
    color: #c2410c;
    margin-bottom: 2mm;
}

.pf-title {
    font-size: 18px;
    line-height: 1.15;
    margin: 0 0 3mm;
    font-weight: 800;
    color: #111;
}

.print-flyer-sheet--1 .pf-title {
    font-size: 28px;
}

.print-flyer-sheet--4 .pf-title {
    /* ice.css: h2 { font-size: 28px !important } */
    font-size: 14px !important;
    margin-bottom: 1.5mm;
}

.pf-item-main {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr 0.9fr;
    gap: 3mm;
    align-items: stretch;
    min-height: 0;
    flex: 1;
}

.print-flyer-sheet--1 .pf-item-main {
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
    min-height: 90mm;
}

.print-flyer-sheet--nophoto:not(.print-flyer-sheet--4) .pf-item-main {
    grid-template-columns: 1fr 1fr;
}

.print-flyer-sheet--4 .pf-item-main {
    grid-template-columns: 1fr;
    flex: 1;
}

.pf-photo {
    border: 1px solid #222;
    overflow: hidden;
    background: #f3f3f3;
    min-height: 0;
}

.pf-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pf-price-block {
    border: 2px solid #111;
    background: #111;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2mm;
}

.pf-price-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.8;
}

.pf-price {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    word-break: break-word;
}

.print-flyer-sheet--1 .pf-price {
    font-size: 34px;
}

.print-flyer-sheet--4 .pf-price {
    font-size: 16px;
}

.pf-qr-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 0;
}

.pf-qr {
    width: 35mm;
    height: 35mm;
    padding: 1.5mm;
    border: 1px solid #111;
    background: #fff;
    box-sizing: border-box;
}

.print-flyer-sheet--1 .pf-qr {
    width: 52mm;
    height: 52mm;
}

.print-flyer-sheet--4 .pf-qr {
    width: 28mm;
    height: 28mm;
}

.pf-qr svg {
    display: block;
    width: 100%;
    height: 100%;
}

.pf-qr-caption {
    margin-top: 1.5mm;
    font-size: 9px;
    line-height: 1.25;
    color: #333;
    max-width: 42mm;
}

.print-flyer-sheet--4 .pf-qr-caption {
    font-size: 8px;
    max-width: 36mm;
}

.pf-desc {
    margin: 3mm 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #222;
}

.print-flyer-sheet--4 .pf-desc {
    font-size: 10px;
}

.pf-contacts {
    margin-top: 2.5mm;
    font-size: 12px;
    font-weight: 700;
    color: #111;
}

.print-flyer-sheet--4 .pf-contacts {
    font-size: 10px;
}

.pf-sale-title {
    margin: 0 0 2mm;
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.print-flyer-sheet--2 .pf-sale-title {
    font-size: 16px;
}

.pf-sale-sub {
    text-align: center;
    font-size: 13px;
    margin-bottom: 4mm;
    color: #333;
}

.pf-profile-main {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 6mm;
    flex: 1;
    min-height: 0;
    border-top: 1px solid #111;
    border-bottom: 1px solid #111;
    padding: 5mm 0;
}

.print-flyer-sheet--2 .pf-profile-main {
    gap: 3mm;
    padding: 3mm 0;
}

.pf-goods-print {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pf-goods-print li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4mm;
    align-items: baseline;
    font-size: 14px;
    line-height: 1.55;
}

.print-flyer-sheet--2 .pf-goods-print li {
    font-size: 12px;
}

.pf-goods-name {
    overflow: hidden;
    position: relative;
}

.pf-goods-name::after {
    content: " ................................................................";
    color: #888;
    letter-spacing: 1px;
}

.pf-goods-price {
    font-weight: 800;
    white-space: nowrap;
}

.pf-tearoff {
    display: flex;
    margin-top: auto;
    border-top: 1px dashed #888;
    padding-top: 2mm;
}

.pf-tearoff-tab {
    flex: 1;
    border-right: 1px dashed #bbb;
    padding: 1.5mm 1mm;
    text-align: center;
    min-width: 0;
}

.pf-tearoff-tab:last-child {
    border-right: 0;
}

.pf-tearoff-qr {
    width: 14mm;
    height: 14mm;
    margin: 0 auto 1mm;
}

.pf-tearoff-title {
    font-size: 7px;
    line-height: 1.2;
    overflow: hidden;
    max-height: 2.4em;
}

.pf-tearoff-price,
.pf-tearoff-phone {
    font-size: 8px;
    font-weight: 700;
}

.print-flyer-sheet--eco .pf-price-block {
    background: #fff;
    color: #111;
}

.print-flyer-sheet--eco .pf-kicker {
    color: #111;
}

.print-flyer-sheet--eco .pf-photo img {
    filter: grayscale(100%);
}

.print-flyer-print-root {
    display: none;
}

body.print-flyer-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .print-flyer-overlay {
        align-items: stretch;
        justify-content: stretch;
        padding: 8px;
        padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    }

    .print-flyer-modal {
        width: 100%;
        height: 100%;
        max-height: none;
        min-height: 0;
        flex: 1 1 auto;
        border-radius: 16px;
    }

    .print-flyer-body {
        grid-template-columns: 1fr;
        overflow: auto;
        min-height: 0;
        flex: 1 1 0;
    }

    .print-flyer-settings {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        max-height: none;
        overflow: visible;
    }

    .print-flyer-preview-col {
        padding: 12px;
        overflow: visible;
    }

    .print-flyer-foot {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
    }

    .print-flyer-foot > .print-flyer-hint {
        min-height: 0;
    }

    .print-flyer-foot .d-flex {
        width: 100%;
        margin-left: 0;
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .print-flyer-foot .d-flex .btn {
        flex: 1 1 0;
        min-width: 0;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    html,
    body {
        background: #fff !important;
        color: #000 !important;
        height: auto !important;
        min-width: 0 !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body * {
        visibility: hidden !important;
    }

    .print-flyer-print-root,
    .print-flyer-print-root * {
        visibility: visible !important;
    }

    .print-flyer-overlay,
    .print-flyer-modal,
    .no-print,
    header,
    footer,
    nav,
    .left-menu,
    .user-menu,
    .admin-menu-fixed,
    .admin-menu-after {
        display: none !important;
    }

    .print-flyer-print-root {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 210mm;
        height: 297mm;
        background: #fff;
    }

    .print-flyer-print-root .print-flyer-sheet {
        transform: none !important;
        width: 210mm;
        height: 297mm;
        page-break-after: avoid;
        page-break-inside: avoid;
        box-shadow: none;
    }
}
