/**
 * DirectPrint for WooCommerce
 *
 * @author    Pixelorigin <contact@pixelorigin.com>
 * @copyright Since 2025 Pixelorigin
 * @license   GPL-2.0-or-later
 */

/* Shop closed: banner pinned at the top of every page. */
.directprint-closed-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    margin: 0;
    border-radius: 0;
    padding: 12px 20px;
    text-align: center;
    font-size: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* The banner is fixed, so it is followed by a spacer that pushes the page content down. */
.directprint-closed-banner-spacer {
    height: 56px;
}

/* Notice shown bottom right when the customer tries to order while the shop is closed.
   It appears, stays a few seconds, then fades away on its own. */
.directprint-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 250px;
    max-width: 340px;
    margin: 0;
    z-index: 100000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s ease-out, transform .25s ease-out;
}

.directprint-popup--shown {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 767px) {
    .directprint-popup {
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: 0;
        max-width: none;
    }
}

/* The banner blinks a few times to draw the eye, then settles down. */
@keyframes directprint-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
}

.directprint-closed-banner--blink {
    animation: directprint-blink .45s ease-in-out 3;
}

/* Nothing moves for a visitor who asked for reduced motion. */
@media (prefers-reduced-motion: reduce) {
    .directprint-popup {
        transition: none;
    }

    .directprint-closed-banner--blink {
        animation: none;
    }
}

/* ---------------------------------------------------------------------------
 * WooCommerce: colours of the banner and of the notice, which on PrestaShop came
 * from the Bootstrap "alert alert-danger" classes of the theme.
 * ------------------------------------------------------------------------- */
.directprint-closed-banner,
.directprint-popup {
    background: #fdecea;
    color: #8a1c1c;
    border: 1px solid #f5c2c0;
    line-height: 1.4;
}

.directprint-popup {
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
}

/* Logged in visitors: the banner sits below the WordPress toolbar. */
.admin-bar .directprint-closed-banner {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .directprint-closed-banner {
        top: 46px;
    }
}

/* Message shown in the cart and the checkout while the shop is closed. */
.directprint-block p {
    margin: 0 0 4px;
}
