/* ================================================================
   首页购物车弹窗 · 二次元 / 玻璃质感
   public/plugins/addons/cart_popup/assets/cart_popup.css
   ================================================================ */

#mfc-cart-popup,
#mfc-cart-popup * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

#mfc-cart-popup {
    --mfc-a: #ff8fc7;
    --mfc-b: #a78bfa;
    --mfc-c: #7dd3fc;
    --mfc-text: #3b2b47;
    --mfc-radius: 22px;
    position: fixed;
    z-index: 99990;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: var(--mfc-text);
}

/* 配色主题 */
#mfc-cart-popup.mfc-style-sakura { --mfc-a: #ff8fc7; --mfc-b: #c084fc; --mfc-c: #ffd6e8; --mfc-text: #4a2b3d; }
#mfc-cart-popup.mfc-style-miku   { --mfc-a: #39d0d8; --mfc-b: #6ea8fe; --mfc-c: #d6f6ff; --mfc-text: #17394a; }
#mfc-cart-popup.mfc-style-galaxy { --mfc-a: #a78bfa; --mfc-b: #60a5fa; --mfc-c: #e9e2ff; --mfc-text: #2f2a52; }
#mfc-cart-popup.mfc-style-mint   { --mfc-a: #6ee7b7; --mfc-b: #38bdf8; --mfc-c: #dcfff1; --mfc-text: #16403a; }
#mfc-cart-popup.mfc-style-amber  { --mfc-a: #fbbf24; --mfc-b: #fb7185; --mfc-c: #ffe9d1; --mfc-text: #4a3320; }

/* 位置 */
#mfc-cart-popup.mfc-bottom-right { right: 24px; bottom: 24px; }
#mfc-cart-popup.mfc-bottom-left  { left: 24px; bottom: 24px; }
#mfc-cart-popup.mfc-top-right    { right: 24px; top: 96px; }
#mfc-cart-popup.mfc-top-left     { left: 24px; top: 96px; }

/* ---------------- 悬浮按钮 ---------------- */
#mfc-cart-popup .mfc-fab {
    position: relative;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--mfc-a), var(--mfc-b));
    box-shadow: 0 10px 26px -8px var(--mfc-a), 0 4px 14px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .22s;
}
#mfc-cart-popup .mfc-fab:hover { transform: translateY(-3px) scale(1.06); }
#mfc-cart-popup .mfc-fab:active { transform: scale(.94); }

#mfc-cart-popup .mfc-fab-icon svg { width: 27px; height: 27px; display: block; }

/* 光晕呼吸 */
#mfc-cart-popup .mfc-fab-glow {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--mfc-a) 0%, transparent 68%);
    opacity: .55;
    animation: mfc-breath 2.8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes mfc-breath {
    0%, 100% { transform: scale(.86); opacity: .38; }
    50%      { transform: scale(1.12); opacity: .7; }
}

/* 角标 */
#mfc-cart-popup .mfc-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 11px;
    background: linear-gradient(135deg, #ff5d8f, #ff8b3d);
    color: #fff;
    font-size: 12px;
    line-height: 21px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 3px 10px rgba(255, 93, 143, .5);
    animation: mfc-pop .35s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes mfc-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ---------------- 弹窗面板 ---------------- */
#mfc-cart-popup .mfc-panel {
    position: absolute;
    width: 330px;
    max-width: calc(100vw - 32px);
    max-height: min(70vh, 560px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--mfc-radius);
    padding: 4px;

    background: linear-gradient(150deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .58));
    backdrop-filter: blur(18px) saturate(1.7);
    -webkit-backdrop-filter: blur(18px) saturate(1.7);
    border: 1px solid rgba(255, 255, 255, .85);
    box-shadow: 0 24px 60px -18px rgba(80, 60, 120, .45), 0 8px 24px rgba(0, 0, 0, .08), inset 0 1px 0 #fff;

    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(.94);
    transform-origin: bottom right;
    transition: opacity .26s ease, transform .3s cubic-bezier(.34, 1.4, .64, 1), visibility .26s;
}
#mfc-cart-popup.mfc-bottom-left  .mfc-panel { transform-origin: bottom left; }
#mfc-cart-popup.mfc-top-right    .mfc-panel { transform-origin: top right; }
#mfc-cart-popup.mfc-top-left     .mfc-panel { transform-origin: top left; }

#mfc-cart-popup.mfc-bottom-right .mfc-panel,
#mfc-cart-popup.mfc-bottom-left  .mfc-panel { bottom: 74px; }
#mfc-cart-popup.mfc-top-right    .mfc-panel,
#mfc-cart-popup.mfc-top-left     .mfc-panel { top: 74px; }
#mfc-cart-popup.mfc-bottom-right .mfc-panel,
#mfc-cart-popup.mfc-top-right    .mfc-panel { right: 0; }
#mfc-cart-popup.mfc-bottom-left  .mfc-panel,
#mfc-cart-popup.mfc-top-left     .mfc-panel { left: 0; }

#mfc-cart-popup.mfc-open .mfc-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 内部装饰光斑（二次元感） */
#mfc-cart-popup .mfc-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(22px);
    opacity: .5;
    pointer-events: none;
}
#mfc-cart-popup .mfc-blob-a { width: 130px; height: 130px; background: var(--mfc-a); top: -46px; right: -32px; }
#mfc-cart-popup .mfc-blob-b { width: 110px; height: 110px; background: var(--mfc-c) ; bottom: -44px; left: -30px; opacity: .55; }

/* 头部 */
#mfc-cart-popup .mfc-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
}
#mfc-cart-popup .mfc-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .3px;
    background: linear-gradient(100deg, var(--mfc-a), var(--mfc-b));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}
#mfc-cart-popup .mfc-spark {
    font-size: 13px;
    color: var(--mfc-a);
    animation: mfc-twinkle 1.9s ease-in-out infinite;
    -webkit-text-fill-color: var(--mfc-a);
}
@keyframes mfc-twinkle {
    0%, 100% { opacity: .35; transform: rotate(0) scale(.85); }
    50%      { opacity: 1; transform: rotate(35deg) scale(1.15); }
}
#mfc-cart-popup .mfc-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .9);
    background: rgba(255, 255, 255, .6);
    color: var(--mfc-text);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, transform .2s;
}
#mfc-cart-popup .mfc-close:hover { background: rgba(255, 255, 255, .95); transform: rotate(90deg); }

/* 内容区 */
#mfc-cart-popup .mfc-body {
    position: relative;
    padding: 0 12px 6px;
    overflow-y: auto;
    flex: 1;
    min-height: 40px;
}
#mfc-cart-popup .mfc-body::-webkit-scrollbar { width: 6px; }
#mfc-cart-popup .mfc-body::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--mfc-a), var(--mfc-b));
    border-radius: 3px;
}

#mfc-cart-popup .mfc-loading,
#mfc-cart-popup .mfc-empty {
    padding: 22px 8px;
    text-align: center;
    font-size: 13px;
    color: #8b7d96;
}

#mfc-cart-popup .mfc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .62);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 6px 16px -10px rgba(90, 70, 130, .5);
    transition: transform .2s, box-shadow .2s;
}
#mfc-cart-popup .mfc-item:hover { transform: translateX(3px); box-shadow: 0 8px 20px -10px var(--mfc-a); }

#mfc-cart-popup .mfc-dot {
    flex: 0 0 26px;
    width: 26px; height: 26px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--mfc-a), var(--mfc-b));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px -4px var(--mfc-a);
}
#mfc-cart-popup .mfc-info { flex: 1; min-width: 0; }
#mfc-cart-popup .mfc-name {
    font-size: 13px;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 可点击的商品标题（跳转产品介绍/配置页） */
#mfc-cart-popup a.mfc-name-link {
    color: var(--mfc-text);
    text-decoration: none;
    cursor: pointer;
    transition: color .18s;
}
#mfc-cart-popup a.mfc-name-link:hover,
#mfc-cart-popup a.mfc-name-link:active {
    color: var(--mfc-a);
}
#mfc-cart-popup a.mfc-name-link:hover .mfc-arrow { opacity: 1; transform: translateX(2px); }
#mfc-cart-popup .mfc-arrow {
    display: inline-block;
    margin-left: 4px;
    font-style: normal;
    font-size: 15px;
    line-height: 1;
    color: var(--mfc-a);
    opacity: .45;
    transition: opacity .18s, transform .18s;
}
#mfc-cart-popup .mfc-sub { font-size: 11px; color: #9a8ea6; margin-top: 2px; }
#mfc-cart-popup .mfc-price {
    font-size: 13px;
    font-weight: 800;
    color: var(--mfc-a);
    white-space: nowrap;
}

/* 自定义 HTML 区 */
#mfc-cart-popup .mfc-custom {
    position: relative;
    margin: 2px 12px 8px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .5);
    border: 1px dashed rgba(255, 255, 255, .95);
    font-size: 13px;
    line-height: 1.6;
}
#mfc-cart-popup .mfc-custom:empty { display: none; }

/* 底部 */
#mfc-cart-popup .mfc-foot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px 12px;
    border-top: 1px solid rgba(255, 255, 255, .8);
    background: rgba(255, 255, 255, .35);
}
#mfc-cart-popup .mfc-sum { font-size: 12px; color: #7d7189; }
#mfc-cart-popup .mfc-total { font-size: 15px; color: var(--mfc-text); }
#mfc-cart-popup .mfc-go {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--mfc-a), var(--mfc-b));
    box-shadow: 0 8px 18px -8px var(--mfc-a), inset 0 1px 0 rgba(255, 255, 255, .55);
    transition: transform .2s, filter .2s;
}
#mfc-cart-popup .mfc-go:hover { transform: translateY(-2px); filter: brightness(1.06); }
#mfc-cart-popup .mfc-go:active { transform: scale(.97); }

#mfc-cart-popup .mfc-tip {
    position: relative;
    padding: 0 14px 12px;
    font-size: 11px;
    color: #a396ad;
    text-align: center;
}
#mfc-cart-popup .mfc-tip:empty { display: none; }

/* ---------------- 手机端：底部抽屉自适应 ---------------- */
@media (max-width: 640px) {
    #mfc-cart-popup.mfc-bottom-right { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
    #mfc-cart-popup.mfc-bottom-left  { left: 14px;  bottom: calc(14px + env(safe-area-inset-bottom)); }
    #mfc-cart-popup.mfc-top-right    { right: 14px; top: calc(14px + env(safe-area-inset-top)); }
    #mfc-cart-popup.mfc-top-left     { left: 14px;  top: calc(14px + env(safe-area-inset-top)); }

    /* 按钮加大到好点按 */
    #mfc-cart-popup .mfc-fab { width: 54px; height: 54px; }
    #mfc-cart-popup .mfc-fab-icon svg { width: 25px; height: 25px; }

    /* 面板变底部抽屉：全宽、从下往上滑、预留安全区 */
    #mfc-cart-popup .mfc-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100vw;
        max-width: 100vw;
        max-height: 80vh;
        border-radius: 22px 22px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
        transform: translateY(100%) scale(1);
        transform-origin: bottom center;
        box-shadow: 0 -18px 50px -18px rgba(80, 60, 120, .45), inset 0 1px 0 #fff;
    }
    #mfc-cart-popup.mfc-open .mfc-panel { transform: translateY(0) scale(1); }

    /* 抽屉顶部加一条小拉手 */
    #mfc-cart-popup .mfc-panel::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        border-radius: 999px;
        background: rgba(120, 100, 150, .22);
    }

    #mfc-cart-popup .mfc-head { padding: 18px 16px 10px; }
    #mfc-cart-popup .mfc-title { font-size: 17px; }
    #mfc-cart-popup .mfc-close { width: 34px; height: 34px; font-size: 19px; }

    /* 触屏滚动跟手 */
    #mfc-cart-popup .mfc-body { -webkit-overflow-scrolling: touch; }

    #mfc-cart-popup .mfc-item { padding: 12px; border-radius: 16px; }
    #mfc-cart-popup .mfc-name { font-size: 14px; }
    #mfc-cart-popup .mfc-sub { font-size: 12px; }

    #mfc-cart-popup .mfc-foot { padding: 12px 16px 14px; }
    #mfc-cart-popup .mfc-go { padding: 11px 22px; font-size: 14px; }

    #mfc-cart-popup.mfc-hide-mobile { display: none !important; }
}

/* 很窄的屏再收紧一点 */
@media (max-width: 360px) {
    #mfc-cart-popup .mfc-panel { max-height: 84vh; }
    #mfc-cart-popup .mfc-sum { font-size: 11.5px; }
}
