/* Product notify sheet: bottom sheet on mobile, centered dialog on desktop. Bootstrap owns focus, backdrop and dismissal; z-index is left to the theme's modal rules. */
#bakala_product_notify.bk-notify-sheet {
    --bk-notify-accent: var(--m_accent_color2, var(--accent_color2, #ef3743));
    --bk-notify-accent-soft: color-mix(in srgb, var(--bk-notify-accent) 9%, white);
    --bk-notify-ink: #03174d;
    --bk-notify-text: #42507a;
    --bk-notify-muted: #7986a9;
    --bk-notify-line: #e8ebf2;
    --bk-notify-soft: #f3f4f7;
    --bk-notify-ease: cubic-bezier(.22, 1, .36, 1);
    padding: 0 !important;
    overflow: hidden;
    border-radius: 0;
}

#bakala_product_notify.bk-notify-sheet.fade { opacity: 1; }

#bakala_product_notify.bk-notify-sheet .modal-dialog {
    position: absolute;
    inset: auto 0 0;
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
    margin: 0 auto;
    opacity: 1;
    pointer-events: none;
}

#bakala_product_notify.bk-notify-sheet.fade .modal-dialog {
    transform: translateY(100%);
    transition: transform .34s var(--bk-notify-ease) !important;
}

#bakala_product_notify.bk-notify-sheet.show .modal-dialog { transform: translateY(0); }

#bakala_product_notify.bk-notify-sheet .modal-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    margin: 0 !important;
    padding: 0;
    border: 0;
    border-radius: 20px 20px 0 0 !important;
    background: #fff;
    color: var(--bk-notify-ink);
    box-shadow: 0 -8px 32px hsl(210 8% 40% / .18);
    overflow: hidden;
    text-align: start;
    font-family: inherit;
    pointer-events: auto;
}

.bk-notify-sheet__handle {
    flex-shrink: 0;
    width: 40px;
    height: 4px;
    margin: 10px auto 14px;
    border-radius: 4px;
    background: #d5dbe8;
}

/* Header */
.bk-notify-sheet__header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding: 0 20px 18px;
}

.bk-notify-sheet__bell {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--bk-notify-accent-soft);
    color: var(--bk-notify-accent);
}

.bk-notify-sheet__bell svg { transform-origin: 50% 10%; animation: bk-notify-ring 1.1s ease .35s both; }

#bakala_product_notify.bk-notify-sheet h2 {
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.6;
    color: var(--bk-notify-ink);
}

#bakala_product_notify .bk-notify-sheet__header p {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--bk-notify-muted);
}

#bakala_product_notify .bk-notify-sheet__close {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin-inline-start: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--bk-notify-soft);
    color: var(--bk-notify-muted);
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

#bakala_product_notify .bk-notify-sheet__close:hover { background: var(--bk-notify-line); color: var(--bk-notify-ink); }

/* Body */
#bakala_product_notify.bk-notify-sheet #white_catnotification {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0 20px max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--bk-notify-line);
    background: #fff;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-bottom: 130px;
    -webkit-overflow-scrolling: touch;
}

.bk-notify-sheet__product {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 22px;
    padding: 10px;
    border-radius: 14px;
    background: var(--bk-notify-soft);
}

.bk-notify-sheet__product > div { min-width: 0; }

#bakala_product_notify .bk-notify-sheet__product img {
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    margin: 0;
    padding: 4px;
    border-radius: 11px;
    background: #fff;
    object-fit: contain;
}

#bakala_product_notify .bk-notify-sheet__product span {
    display: block;
    margin-bottom: 2px;
    font-size: 11.5px;
    color: var(--bk-notify-muted);
}

#bakala_product_notify .bk-notify-sheet__product strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.9;
    color: var(--bk-notify-ink);
}

#bakala_product_notify.bk-notify-sheet fieldset {
    min-width: 0;
    margin: 0 0 22px;
    padding: 0;
    border: 0;
}

#bakala_product_notify.bk-notify-sheet legend {
    float: none;
    width: auto;
    margin: 0 0 10px;
    padding: 0;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.8;
    color: var(--bk-notify-ink);
}

/* Event toggles */
#bakala_product_notify .bk-notify-sheet__event {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0 0 10px;
    padding: 12px;
    border: 1.5px solid var(--bk-notify-line);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, background-color .2s;
}

#bakala_product_notify .bk-notify-sheet__event:last-of-type { margin-bottom: 0; }
#bakala_product_notify .bk-notify-sheet__event:hover { border-color: #d5dbe8; }

#bakala_product_notify .bk-notify-sheet__event:has(input:checked) {
    border-color: var(--bk-notify-accent);
    background: color-mix(in srgb, var(--bk-notify-accent) 4%, white);
}

.bk-notify-sheet__event-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bk-notify-soft);
    color: var(--bk-notify-ink);
    transition: background-color .2s, color .2s;
}

.bk-notify-sheet__event:has(input:checked) .bk-notify-sheet__event-icon { background: var(--bk-notify-accent-soft); color: var(--bk-notify-accent); }

.bk-notify-sheet__event-copy { flex: 1; min-width: 0; text-align: start; }

#bakala_product_notify .bk-notify-sheet__event-copy strong { display: block; font-size: 14px; font-weight: 700; line-height: 1.8; color: var(--bk-notify-ink); }
#bakala_product_notify .bk-notify-sheet__event-copy small { display: block; margin-top: 1px; font-size: 12px; line-height: 1.8; color: var(--bk-notify-muted); }

#bakala_product_notify .bk-notify-sheet__event input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    overflow: hidden;
}

.bk-notify-sheet__switch {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 24px;
    border-radius: 24px;
    background: #d5dbe8;
    transition: background-color .2s;
}

.bk-notify-sheet__switch::after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px #03174d33;
    transition: transform .25s var(--bk-notify-ease);
}

.bk-notify-sheet__event input:checked + .bk-notify-sheet__switch { background: var(--bk-notify-accent); }
.bk-notify-sheet__event input:checked + .bk-notify-sheet__switch::after { transform: translateX(16px); }
.bk-notify-sheet__event input:checked + .bk-notify-sheet__switch:dir(rtl)::after { transform: translateX(-16px); }
.bk-notify-sheet__event input:focus-visible + .bk-notify-sheet__switch { outline: 2px solid var(--bk-notify-accent); outline-offset: 3px; }

/* Channels */
#bakala_product_notify .bk-notify-sheet__channel {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    background: var(--bk-notify-soft);
    cursor: pointer;
}

#bakala_product_notify .bk-notify-sheet__channel:first-of-type { border-radius: 14px 14px 0 0; }
#bakala_product_notify .bk-notify-sheet__channel:last-of-type { border-radius: 0 0 14px 14px; }
#bakala_product_notify .bk-notify-sheet__channel:only-of-type { border-radius: 14px; }
.bk-notify-sheet__channel + .bk-notify-sheet__channel { border-top: 1px solid #fff; }

#bakala_product_notify .bk-notify-sheet__channel input {
    position: static;
    display: block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    opacity: 1;
    appearance: auto;
    accent-color: var(--bk-notify-accent);
    cursor: pointer;
}

.bk-notify-sheet__channel > span { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
#bakala_product_notify .bk-notify-sheet__channel strong { font-size: 13px; font-weight: 700; color: var(--bk-notify-ink); }
#bakala_product_notify .bk-notify-sheet__channel bdi { min-width: 0; font-size: 14px; color: var(--bk-notify-text); overflow-wrap: anywhere; font-weight: 600;-moz-font-feature-settings: "ss02";-webkit-font-feature-settings: "ss02";font-feature-settings: "ss02";}

/* Footer */
.bk-notify-sheet__footer {
    position: sticky;
    z-index: 2;
    bottom: calc(0px - max(16px, env(safe-area-inset-bottom)));
    margin-bottom: calc(0px - max(16px, env(safe-area-inset-bottom)));
    padding-top: 14px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--bk-notify-line);
    background: #fff;
}

#bakala_product_notify.bk-notify-sheet .message-container {
    margin: 0;
    font-size: 13px;
    line-height: 1.9;
    text-align: center;
}

#bakala_product_notify.bk-notify-sheet .message-container:not(:empty) { margin-bottom: 12px; }

#bakala_product_notify.bk-notify-sheet #notify-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    float: none;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 20px;
    border: 0;
    border-radius: 11px;
    background: var(--bk-notify-accent) !important;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: filter .2s, opacity .2s;
}

#bakala_product_notify.bk-notify-sheet #notify-submit:hover:not(:disabled) { filter: brightness(.95); }
.bk-notify-sheet__submit:disabled { opacity: .55; cursor: default !important; }
.bk-notify-sheet__submit:focus-visible, .bk-notify-sheet__close:focus-visible { outline: 2px solid var(--bk-notify-ink); outline-offset: 3px; }
.bk-notify-sheet__spinner { display: none; width: 16px; height: 16px; border: 2px solid #ffffff66; border-top-color: #fff; border-radius: 50%; animation: bk-notify-spin .7s linear infinite; }
#white_catnotify_form[aria-busy="true"] .bk-notify-sheet__spinner { display: block; }

#bakala_product_notify .bk-notify-sheet__hint { margin: 10px 0 0; padding: 0; border: 0; background: none; font-size: 12px; line-height: 1.9; color: var(--bk-notify-muted); text-align: right; }

@keyframes bk-notify-spin { to { transform: rotate(360deg); } }
@keyframes bk-notify-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(9deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }

/* Desktop: a centered dialog, like the theme's other desktop modals. */
@media (min-width: 768px) {
    #bakala_product_notify.bk-notify-sheet .modal-dialog {
        inset: 50% auto auto 50%;
        max-width: 460px;
    }
    #bakala_product_notify.bk-notify-sheet.fade .modal-dialog {
        opacity: 0;
        transform: translate(-50%, -46%) scale(.97);
        transition: transform .3s var(--bk-notify-ease), opacity .2s ease !important;
    }
    #bakala_product_notify.bk-notify-sheet.show .modal-dialog { opacity: 1; transform: translate(-50%, -50%); }
    #bakala_product_notify.bk-notify-sheet .modal-content {
        max-height: calc(100vh - 80px);
        max-height: calc(100dvh - 80px);
        border-radius: 20px !important;
        box-shadow: 0 24px 64px hsl(210 8% 30% / .22);
    }
    .bk-notify-sheet__handle { display: none; }
    .bk-notify-sheet__header { padding: 22px 24px 18px; }
    #bakala_product_notify.bk-notify-sheet #white_catnotification { padding: 0 24px 22px; }
    .bk-notify-sheet__footer { bottom: -22px; margin-bottom: -22px; padding-bottom: 22px; }
}

@media (max-width: 380px) {
    .bk-notify-sheet__header { padding-inline: 16px; }
    #bakala_product_notify.bk-notify-sheet #white_catnotification { padding-inline: 16px; }
    .bk-notify-sheet__channel > span { flex-direction: column; align-items: flex-start; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
    #bakala_product_notify.bk-notify-sheet .modal-dialog,
    #bakala_product_notify .bk-notify-sheet__event,
    .bk-notify-sheet__switch, .bk-notify-sheet__switch::after { transition: none !important; }
    .bk-notify-sheet__bell svg, .bk-notify-sheet__spinner { animation: none; }
}
