/* Notice Board: responsive promo modal (home page only). See notice.md. */
[x-cloak] {
    display: none !important;
}

/* Overlay: full viewport, safe area for notched devices */
.nb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    /* Slightly darker for better contrast */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;

}

.nb-overlay::-webkit-scrollbar {
    width: 6px;
}

.nb-overlay::-webkit-scrollbar-thumb {
    background: #fff;
    border-radius: 10px;
}

.nb-overlay::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.nb-no-scroll {
    overflow: hidden !important;
}

/* Modal: two columns on large screens; up-and-down (stacked) on small/medium. Content scrolls so title always visible. */
.nb-modal {
    background: #fff;
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 900px;
    min-height: 320px;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin: auto;
}

/* Left: title first (always visible), then subtitle, content, button. Start from top – no vertical center (fixes title cut-off). */
.nb-modal-left {
    flex: 0 0 auto;
    min-width: 0;
    padding: 2.75rem 1.5rem 1.5rem 1.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
}

/* Title = main heading (e.g. Self Defense), always shown at top in all layouts */
.nb-modal-title {
    margin: 0 0 0.3em;
    padding-top: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.25;
}

/* Subtitle = discount (e.g. 20% OFF), shown below title */
.nb-modal-subtitle {
    margin: 0 0 0.4.7em;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111;
    font-family: Georgia, 'Times New Roman', serif;
}

.nb-modal-text {
    font-size: 15px;
    line-height: 1.65;
    color: #333;
    margin: 0 0 1em;
}

.nb-modal-text p {
    margin: 0 0 1rem;
}

.nb-modal-text p:last-child {
    margin-bottom: 0;
}

.nb-modal-text a {
    color: #f7f8fa;
    text-decoration: underline;
}

/* Button – ultra-micro size, responsive */
.nb-modal-btn {
    background: #4D6A92;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    display: inline-block;
    margin-top: 0.2rem;
    transition: background 0.2s ease;
}

.nb-modal-btn:hover {
    background: #3d5575;
    color: #fff;
}

/* Right: image block – below text on stacked layout, no bg color */
.nb-modal-right {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    position: relative;
    min-height: 200px;
    min-width: 0;
    padding: 0 1rem 1rem;
    overflow: hidden;
}



.nb-modal-right img {
    width: 100%;
    height: auto;
    max-height: 80%;
    object-fit: cover;
    border-radius: 1rem !important;
    display: block;
}

/* Close button: smaller, more rounded */
.nb-modal-close {

    position: absolute;
    top: 10px;
    right: 10px;
    background: #940000;
    color: white;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 25px;
    height: 25px;
    min-width: 25px;
    min-height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;


}

.nb-modal-close:hover {
    background: #940000;
    color: white;
}

/* ================= RESPONSIVE ================= */

/* Common scrollbar for all responsive views with dark overlay */
@media (max-width: 1024px) {
    .nb-modal {
        overflow: visible;
        max-height: none;
    }

    .nb-modal-left {
        overflow-y: visible;
        flex: 0 0 auto;
    }
}

/* Extra small (portrait phones, very narrow) */
@media (max-width: 480px) {
    .nb-overlay {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: max(0.5rem, env(safe-area-inset-top));
    }

    .nb-modal {
        width: 94%;
        max-width: 360px;
        max-height: none;
        flex-direction: column;
        border-radius: 8px;
        margin: auto;
    }

    .nb-modal-left {
        flex: 0 0 auto;
        justify-content: flex-start;
        padding: 1.75rem 1.25rem 1.25rem;
        padding-top: 1.75rem;
        text-align: center;
    }

    .nb-modal-subtitle {
        font-size: 0.9rem;
    }

    .nb-modal-title {
        font-size: 1.35rem;
        line-height: 1.25;
        margin-top: 0;
    }

    .nb-modal-text {
        font-size: 14px;
        margin-bottom: 0.75em;
    }


    .nb-modal-right {
        min-height: auto;
        flex: 0 0 auto;
        padding: 0 0 2.5rem;
    }

    .nb-modal-right img {
        width: 90%;
        max-height: 50vh;
        border-radius: 1rem !important;
        object-fit: cover;
        display: block;
        margin: 0 auto;
    }

    .nb-modal-close {
        top: 8px;
        right: 8px;
        width: 26px;
        height: 26px;
        min-width: 26px;
        min-height: 26px;
    }
}

/* Small (landscape phones, large phones, small tablets) */
@media (min-width: 481px) and (max-width: 768px) {
    .nb-overlay {
        padding: 1rem;
    }

    .nb-modal {
        flex-direction: column;
        max-height: none;
    }

    .nb-modal-left {
        flex: 0 0 auto;
        justify-content: flex-start;
        padding: 2.25rem 2rem 1.25rem;
        padding-top: 2.25rem;
        align-items: center;
        text-align: center;
    }

    .nb-modal-right img {
        width: 100%;
        max-height: 65vh;
        border-radius: 1rem !important;
        object-fit: cover;
        display: block;
    }

    .nb-modal-subtitle {
        font-size: 0.95rem;
    }

    .nb-modal-title {
        font-size: 1.65rem;
    }

    .nb-modal-text {
        font-size: 14px;
    }

}

/* Medium (tablets, small laptops) */
@media (min-width: 769px) and (max-width: 1024px) {
    .nb-overlay {
        padding: 1.5rem;
    }

    .nb-modal {
        max-width: 85%;
        min-height: 360px;
        max-height: none;
    }

    .nb-modal-left {
        justify-content: flex-start;
        padding: 2.75rem 1.5rem 2rem 1.75rem;
        padding-top: 2.75rem;
        align-items: center;
        text-align: center;
    }

    .nb-modal-title {
        font-size: 1.85rem;
    }

    .nb-modal-right {
        min-height: auto;
        flex: 0 0 auto;
        padding: 0 1rem 1rem;
    }

    .nb-modal-right img {
        width: 100%;
        max-height: 70vh;
        border-radius: 1rem !important;
        object-fit: cover;
        display: block;
    }

}

/* Large (desktops) */
@media (min-width: 1025px) {
    .nb-modal {
        flex-direction: row;
        min-height: 380px;
        max-height: 90vh;
        max-height: 90dvh;
    }

    .nb-modal-left {
        flex: 1 1 50%;
        justify-content: flex-start;
        padding: 2.75rem 1.5rem 2.5rem 1.75rem;
        padding-top: 2.75rem;
        align-items: flex-start;
        text-align: left;
    }

    .nb-modal-right {
        flex: 1 1 50%;
        padding: 1rem;
    }

    .nb-modal-right img {
        width: 100%;
        max-height: 75vh;
        border-radius: 1rem !important;
        display: block;
        object-fit: cover;
    }

}