/*
 * DigiMSP native browser print contract
 * Default: ordinary document content remains printable.
 * Opt out UI with .no-print; opt in hidden print content with .print-only.
 * Legacy area-only pages must explicitly set body.storefront-shell.print-area-only.
 */

.print-only {
    display: none !important;
}

@page {
    margin: 12mm;
}

@media print {
    html,
    body.storefront-shell {
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        direction: rtl;
        background: #fff !important;
        color: #111 !important;
        font-size: 10.5pt;
        line-height: 1.65;
    }

    /*
     * Storefront content is visible by default. This explicit reset also
     * neutralizes the previously cached Custom.css print rule that hid every
     * body descendant and made body a centered flex container.
     */
    body.storefront-shell:not(.print-area-only) {
        display: block !important;
        visibility: visible !important;
    }

    body.storefront-shell:not(.print-area-only) > main,
    body.storefront-shell:not(.print-area-only) > main * {
        visibility: visible !important;
    }

    .print-only {
        display: block !important;
    }

    .no-print,
    body > header,
    body > footer,
    .area-footer,
    .container-sidebar-account,
    .navbar,
    .mobile-menu,
    .mobile-menu-overlay,
    .menu-mobile,
    .scrollTo,
    .scroll-To-top,
    .bg-close,
    .bg-searchform,
    .digimsp-chat-widget,
    .digimsp-chat-container,
    [class*="digimsp-chat"],
    .modal,
    .modal-backdrop,
    .offcanvas,
    .offcanvas-backdrop,
    .tooltip,
    .popover,
    .toast-container,
    .swal2-container,
    .cookie-banner,
    .cookie-consent,
    .floating-action,
    button,
    a.btn {
        display: none !important;
    }

    main,
    main.content,
    .content,
    .homepage,
    .container,
    .container-fluid,
    section,
    article {
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin-inline: 0 !important;
        overflow: visible !important;
    }

    .table-responsive,
    .area-table-cart-shop,
    .area-table-shop,
    .overflow-auto,
    .overflow-scroll,
    .print-expand {
        display: block !important;
        position: static !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .sticky-top,
    .sticky-bottom,
    .fixed-top,
    .fixed-bottom {
        position: static !important;
        inset: auto !important;
    }

    body.storefront-shell:not(.print-area-only) > main .collapse,
    body.storefront-shell:not(.print-area-only) > main .collapsing,
    .print-expand.collapse,
    .print-expand.collapsing {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        visibility: visible !important;
        overflow: visible !important;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    li,
    td,
    th,
    a,
    span {
        overflow-wrap: anywhere;
    }

    a,
    a:visited {
        color: inherit !important;
        text-decoration: none !important;
    }

    a[href]::after {
        content: none !important;
    }

    img,
    svg {
        max-width: 100% !important;
        height: auto !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    table {
        width: 100% !important;
        max-width: 100% !important;
        border-collapse: collapse !important;
        table-layout: auto;
        font-size: 8.5pt;
    }

    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }

    tr,
    td,
    th {
        break-inside: avoid;
        page-break-inside: avoid;
        white-space: normal !important;
        word-break: normal;
    }

    td,
    th {
        border-color: #777 !important;
    }

    .card,
    .alert,
    .badge,
    .box-cart-total,
    .box-cart-address {
        color: #111 !important;
        background: #fff !important;
        border: 1px solid #777 !important;
        box-shadow: none !important;
    }

    .card {
        break-inside: auto;
        page-break-inside: auto;
    }

    .card-header,
    .card-body,
    .alert,
    .avoid-print-break {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Homepage: replace animated Owl state with one stable document hero. */
    body.storefront-shell:not(.print-area-only) > main .home-hero-section {
        display: block !important;
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 8mm !important;
    }

    body.storefront-shell:not(.print-area-only) > main .slider_baner-homepage {
        display: none !important;
    }

    body.storefront-shell:not(.print-area-only) > main .homepage-print-hero {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        transform: none !important;
        border: 1px solid #777;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.storefront-shell:not(.print-area-only) > main .homepage-print-hero-media,
    body.storefront-shell:not(.print-area-only) > main .homepage-print-hero-media picture {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: 58mm !important;
        max-height: 58mm !important;
        overflow: hidden !important;
        transform: none !important;
    }

    body.storefront-shell:not(.print-area-only) > main .homepage-print-hero-media img {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: 58mm !important;
        max-height: 58mm !important;
        object-fit: cover !important;
        object-position: center !important;
        transform: none !important;
    }

    body.storefront-shell:not(.print-area-only) > main .homepage-print-hero-content {
        display: block !important;
        position: static !important;
        padding: 4mm 5mm !important;
        overflow: visible !important;
        transform: none !important;
    }

    body.storefront-shell:not(.print-area-only) > main .homepage-print-hero-content h2,
    body.storefront-shell:not(.print-area-only) > main .homepage-print-hero-content h3,
    body.storefront-shell:not(.print-area-only) > main .homepage-print-hero-content p {
        margin: 0 0 2mm !important;
        width: auto !important;
    }

    body.storefront-shell:not(.print-area-only) > main .homepage-print-hero-action {
        display: inline-block !important;
        padding: 1mm 3mm;
        border: 1px solid #777;
        font-weight: 600;
    }

    /* Homepage service SVGs are intrinsically 512px; keep them supporting-size. */
    body.storefront-shell:not(.print-area-only) > main .home-service-benefits .row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3mm;
    }

    body.storefront-shell:not(.print-area-only) > main .home-service-benefits .col-element-multi {
        width: auto !important;
        max-width: none !important;
        padding: 3mm !important;
        border: 1px solid #777 !important;
    }

    body.storefront-shell:not(.print-area-only) > main .home-service-benefits .element-multi {
        display: flex !important;
        align-items: center !important;
        gap: 3mm;
        text-align: right !important;
    }

    body.storefront-shell:not(.print-area-only) > main .home-service-benefits .icon-element-multi {
        flex: 0 0 10mm;
        width: 10mm !important;
        height: 10mm !important;
        margin: 0 !important;
    }

    body.storefront-shell:not(.print-area-only) > main .home-service-benefits .icon-element-multi img {
        display: block !important;
        width: 10mm !important;
        max-width: 10mm !important;
        height: 10mm !important;
        max-height: 10mm !important;
        object-fit: contain !important;
        filter: none !important;
        transform: none !important;
    }

    body.storefront-shell:not(.print-area-only) > main .home-service-benefits .title-element-multi {
        margin: 0 !important;
        font-size: 9pt !important;
        line-height: 1.5;
    }

    /* Component-specific media bounds; category photography stays untouched. */
    body.storefront-shell:not(.print-area-only) > main .slider_product .cart-img-product {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 42mm !important;
        max-height: 42mm !important;
        overflow: hidden !important;
    }

    body.storefront-shell:not(.print-area-only) > main .slider_product .cart-img-product a,
    body.storefront-shell:not(.print-area-only) > main .slider_product .cart-img-product .d-flex {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
    }

    body.storefront-shell:not(.print-area-only) > main .slider_product .cart-img-product img {
        position: static !important;
        width: auto !important;
        max-width: 42mm !important;
        height: auto !important;
        max-height: 38mm !important;
        object-fit: contain !important;
        transform: none !important;
    }

    body.storefront-shell:not(.print-area-only) > main .slider_product .img2-product,
    body.storefront-shell:not(.print-area-only) > main .slider_product .area-button-view-product,
    body.storefront-shell:not(.print-area-only) > main .slider_product .link-wishlist-icon,
    body.storefront-shell:not(.print-area-only) > main .slider_product .star_rating {
        display: none !important;
    }

    body.storefront-shell:not(.print-area-only) > main .slider-Related-posts figure {
        margin: 0 !important;
        overflow: hidden !important;
    }

    body.storefront-shell:not(.print-area-only) > main .slider-Related-posts .card-img-top {
        display: block !important;
        width: 100% !important;
        height: 38mm !important;
        max-height: 38mm !important;
        object-fit: cover !important;
        transform: none !important;
    }

    body.storefront-shell:not(.print-area-only) > main .slider_brand .item_slider_brand img {
        display: block !important;
        width: auto !important;
        max-width: 28mm !important;
        height: auto !important;
        max-height: 12mm !important;
        margin: 0 auto !important;
        object-fit: contain !important;
        opacity: 1 !important;
        transform: none !important;
    }

    body.storefront-shell:not(.print-area-only) > main .owl-nav,
    body.storefront-shell:not(.print-area-only) > main .owl-dots,
    body.storefront-shell:not(.print-area-only) > main .slick-arrow {
        display: none !important;
    }

    .print-break-before {
        break-before: page;
        page-break-before: always;
    }

    .print-break-after {
        break-after: page;
        page-break-after: always;
    }

    body.storefront-shell.print-area-only {
        position: relative !important;
    }

    body.storefront-shell.print-area-only * {
        visibility: hidden !important;
    }

    body.storefront-shell.print-area-only > header,
    body.storefront-shell.print-area-only > footer,
    body.storefront-shell.print-area-only .area-footer {
        display: none !important;
    }

    body.storefront-shell.print-area-only #printable-area,
    body.storefront-shell.print-area-only #printable-area * {
        visibility: visible !important;
    }

    body.storefront-shell.print-area-only #printable-area {
        position: absolute !important;
        top: 0;
        inset-inline: 0;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 8mm !important;
        box-sizing: border-box;
    }
}
