/**
 * DataFirefly - PWA
 * @author    DataFirefly
 * @copyright DataFirefly
 * @license   Commercial
 */

/* ---- Shared bottom sheet (install banner + push prompt) ---- */
.dfpwa-banner,
.dfpwa-push {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translate(-50%, 140%);
    width: calc(100% - 32px);
    max-width: 460px;
    z-index: 99990;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #ffffff;
    color: #1a1a2e;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
    opacity: 0;
    transition: transform .38s cubic-bezier(.16, 1, .3, 1), opacity .3s ease;
    font-size: 14px;
    line-height: 1.4;
}

.dfpwa-banner.dfpwa-show,
.dfpwa-push.dfpwa-show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.dfpwa-banner img,
.dfpwa-push img {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    flex: 0 0 auto;
}

.dfpwa-banner-txt {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.dfpwa-banner-txt strong {
    font-size: 15px;
    font-weight: 600;
}

.dfpwa-banner-txt span {
    color: #5b5b73;
    font-size: 12.5px;
}

.dfpwa-banner-act,
.dfpwa-push-act {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}

/* ---- Buttons ---- */
.dfpwa-btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: filter .15s ease, background .15s ease;
}

.dfpwa-btn-primary {
    background: #1a1a2e;
    color: #fff;
}

.dfpwa-btn-primary:hover {
    filter: brightness(1.18);
}

.dfpwa-btn-ghost {
    background: transparent;
    color: #5b5b73;
}

.dfpwa-btn-ghost:hover {
    background: rgba(0, 0, 0, .05);
}

/* ---- iOS install instructions overlay ---- */
.dfpwa-ios {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translate(-50%, 140%);
    width: calc(100% - 32px);
    max-width: 420px;
    z-index: 99991;
    padding: 22px 20px 20px;
    background: #fff;
    color: #1a1a2e;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
    opacity: 0;
    transition: transform .38s cubic-bezier(.16, 1, .3, 1), opacity .3s ease;
}

.dfpwa-ios.dfpwa-show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.dfpwa-ios strong {
    display: block;
    font-size: 16px;
    margin-bottom: 6px;
}

.dfpwa-ios p {
    margin: 0 0 10px;
    color: #5b5b73;
    font-size: 13px;
}

.dfpwa-ios ol {
    margin: 0;
    padding-left: 20px;
    font-size: 13.5px;
}

.dfpwa-ios ol li {
    margin-bottom: 6px;
}

.dfpwa-ios-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: #9a9ab0;
    cursor: pointer;
}

/* iOS share glyph (square with up arrow) */
.dfpwa-share-ico {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: -3px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007aff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v13M8 7l4-4 4 4'/%3E%3Cpath d='M5 12v7a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-7'/%3E%3C/svg%3E");
}

/* ---- Native share button ---- */
.dfpwa-share {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, .12);
    background: #fff;
    color: #1a1a2e;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
}

.dfpwa-share:hover {
    background: rgba(0, 0, 0, .04);
}

@media (max-width: 480px) {
    .dfpwa-banner,
    .dfpwa-push {
        flex-wrap: wrap;
    }
    .dfpwa-banner-act,
    .dfpwa-push-act {
        flex-direction: row;
        width: 100%;
    }
    .dfpwa-btn {
        flex: 1 1 auto;
    }
}

/* ---- Floating subscribe bell ---- */
.dfpwa-bell {
    position: fixed;
    z-index: 99980;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: #1a1a2e;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
    transition: transform .15s ease, background .2s ease;
}

.dfpwa-bell:hover {
    transform: scale(1.06);
}

/* Placement variants, set from the back office. */
.dfpwa-bell-bottom-right { right: 18px; bottom: 18px; }
.dfpwa-bell-bottom-left  { left: 18px;  bottom: 18px; }
.dfpwa-bell-top-right    { right: 18px; top: 90px; }
.dfpwa-bell-top-left     { left: 18px;  top: 90px; }

.dfpwa-bell-middle-right { right: 18px; top: 50%; transform: translateY(-50%); }
.dfpwa-bell-middle-left  { left: 18px;  top: 50%; transform: translateY(-50%); }

.dfpwa-bell-middle-right:hover,
.dfpwa-bell-middle-left:hover {
    transform: translateY(-50%) scale(1.06);
}

/* Bottom corners are crowded on small screens by cookie bars and sticky
   add-to-cart bars, so lift the bell a little there. */
@media (max-width: 767px) {
    .dfpwa-bell-bottom-right,
    .dfpwa-bell-bottom-left { bottom: 74px; }
}

/* Never let the bell sit on top of the install banner or push prompt. */
.dfpwa-bell-bottom-right,
.dfpwa-bell-bottom-left {
    transition: transform .15s ease, background .2s ease, opacity .2s ease;
}

.dfpwa-bell-ico {
    display: block;
    width: 22px;
    height: 22px;
    margin: 0 auto;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
}

.dfpwa-bell.dfpwa-bell-on {
    background: #ff6b35;
}

/* ---- Product alerts (back in stock / price drop) ---- */
.dfpwa-alerts {
    margin: 14px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.dfpwa-alert-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, .15);
    background: #fff;
    color: #1a1a2e;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    transition: background .15s ease, border-color .15s ease;
}

.dfpwa-alert-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, .04);
    border-color: rgba(0, 0, 0, .28);
}

.dfpwa-alert-btn:disabled {
    opacity: .65;
    cursor: default;
}

.dfpwa-alert-btn.dfpwa-alert-done {
    border-color: #2ecc71;
    color: #1e8449;
    background: rgba(46, 204, 113, .08);
}

.dfpwa-alert-ico {
    display: inline-block;
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a2e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
}

.dfpwa-alert-msg {
    width: 100%;
    margin: 4px 0 0;
    font-size: 13px;
    color: #1e8449;
}

.dfpwa-push-txt {
    flex: 1 1 auto;
    min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
    .dfpwa-banner,
    .dfpwa-push,
    .dfpwa-ios,
    .dfpwa-bell {
        transition: none;
    }
}

/* ---- Customer notification preferences (My account) ----
   Selectors are scoped under .dfpwa-prefs and kept specific enough to win
   over theme rules on label/strong without resorting to !important. */

.dfpwa-prefs {
    max-width: 720px;
}

.dfpwa-prefs .dfpwa-prefs-intro {
    margin: 0 0 20px;
    color: #5b5b73;
    text-align: left;
}

.dfpwa-prefs .dfpwa-pref-list {
    margin: 0 0 24px;
}

.dfpwa-prefs .dfpwa-pref-row {
    margin: 0 0 10px;
}

/* The whole row is the label, so tapping anywhere toggles the switch. */
.dfpwa-prefs .dfpwa-pref-label {
    position: relative;
    margin: 0;
    padding: 0;
    cursor: pointer;
    font-weight: 400;
}

.dfpwa-prefs .dfpwa-pref-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    text-align: left;
    background: #fff;
    border: 1px solid rgba(26, 26, 46, .12);
    border-radius: 14px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.dfpwa-prefs .dfpwa-pref-label:hover .dfpwa-pref-inner {
    border-color: rgba(26, 26, 46, .3);
    box-shadow: 0 4px 14px rgba(26, 26, 46, .07);
}

/* Keyboard focus has to stay visible even though the input is hidden. */
.dfpwa-prefs .dfpwa-pref-input:focus-visible ~ .dfpwa-pref-inner,
.dfpwa-prefs .dfpwa-pref-input:focus ~ .dfpwa-pref-inner {
    outline: 2px solid #1a1a2e;
    outline-offset: 2px;
}

.dfpwa-prefs .dfpwa-pref-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.dfpwa-prefs .dfpwa-pref-icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: .45;
    transition: opacity .18s ease;
}

.dfpwa-prefs .dfpwa-pref-input:checked ~ .dfpwa-pref-inner .dfpwa-pref-icon {
    opacity: 1;
}

.dfpwa-prefs .dfpwa-pref-text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.dfpwa-prefs .dfpwa-pref-title {
    display: block;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
}

.dfpwa-prefs .dfpwa-pref-desc {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 400;
    color: #6b6b80;
    margin-top: 3px;
    line-height: 1.4;
}

/* ---- Toggle ---- */
.dfpwa-prefs .dfpwa-toggle {
    flex: 0 0 auto;
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 13px;
    background: #cfcfda;
    transition: background .2s ease;
}

.dfpwa-prefs .dfpwa-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
}

.dfpwa-prefs .dfpwa-pref-input:checked ~ .dfpwa-pref-inner .dfpwa-toggle {
    background: #2ecc71;
}

.dfpwa-prefs .dfpwa-pref-input:checked ~ .dfpwa-pref-inner .dfpwa-toggle .dfpwa-toggle-knob {
    transform: translateX(20px);
}

.dfpwa-prefs .dfpwa-pref-input:checked ~ .dfpwa-pref-inner .dfpwa-pref-text .dfpwa-pref-title {
    color: #1a1a2e;
}

.dfpwa-prefs .dfpwa-pref-input:not(:checked) ~ .dfpwa-pref-inner .dfpwa-pref-text .dfpwa-pref-title {
    color: #6b6b80;
}

/* ---- Category icons ---- */
.dfpwa-prefs .dfpwa-pref-icon-order {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a2e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 16V4H2v12h14zM16 8h4l3 3v5h-7'/%3E%3Ccircle cx='5.5' cy='18.5' r='1.8'/%3E%3Ccircle cx='18.5' cy='18.5' r='1.8'/%3E%3C/svg%3E");
}

.dfpwa-prefs .dfpwa-pref-icon-alert {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a2e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 13.4 11 3.8V3H4v7h.8l9.6 9.6a1.5 1.5 0 0 0 2.1 0l4.1-4.1a1.5 1.5 0 0 0 0-2.1z'/%3E%3Cpath d='M7.5 6.5h.01'/%3E%3C/svg%3E");
}

.dfpwa-prefs .dfpwa-pref-icon-abandon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a2e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1.5'/%3E%3Ccircle cx='18' cy='20' r='1.5'/%3E%3Cpath d='M1 1h3.5l2.4 12.1a2 2 0 0 0 2 1.6h8.6a2 2 0 0 0 2-1.6L22 6H5.5'/%3E%3C/svg%3E");
}

.dfpwa-prefs .dfpwa-pref-icon-campaign {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a2e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 10 3 0 7-5v14l-7-5-3 0z'/%3E%3Cpath d='M17.5 8.5a5 5 0 0 1 0 7'/%3E%3Cpath d='M20.5 5.5a9 9 0 0 1 0 13'/%3E%3C/svg%3E");
}

/* ---- Actions ---- */
.dfpwa-prefs .dfpwa-prefs-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 4px;
}

.dfpwa-prefs .dfpwa-prefs-back {
    color: #6b6b80;
    text-decoration: underline;
    font-size: 14px;
}

.dfpwa-prefs .dfpwa-prefs-back:hover {
    color: #1a1a2e;
}

.dfpwa-prefs .dfpwa-prefs-devices {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(26, 26, 46, .1);
    font-size: 13px;
    color: #6b6b80;
}

.dfpwa-prefs .dfpwa-prefs-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    flex: 0 0 auto;
}

.dfpwa-prefs .dfpwa-prefs-empty {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(26, 26, 46, .04);
    border: 1px solid rgba(26, 26, 46, .1);
    color: #5b5b73;
    font-size: 14px;
    text-align: left;
}

.dfpwa-prefs .dfpwa-prefs-empty-ico {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b5b73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8h.01M11 12h1v4h1'/%3E%3C/svg%3E");
}

@media (max-width: 575px) {
    .dfpwa-prefs .dfpwa-pref-inner {
        padding: 14px;
        gap: 10px;
    }
    .dfpwa-prefs .dfpwa-pref-icon {
        display: none;
    }
    .dfpwa-prefs .dfpwa-prefs-actions {
        gap: 12px;
    }
    .dfpwa-prefs .dfpwa-prefs-save {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dfpwa-prefs .dfpwa-toggle,
    .dfpwa-prefs .dfpwa-toggle-knob,
    .dfpwa-prefs .dfpwa-pref-label {
        transition: none;
    }
}
