:root {
    --fxmc-bg: #ffffff;
    --fxmc-fg: #0f1729;
    --fxmc-muted: #7b8499;
    --fxmc-border: #eef0f4;
    --fxmc-soft: #f4f5f8;
    --fxmc-accent: #6a7dff;
    --fxmc-accent-dark: #4257e0;
    --fxmc-danger: #ef4444;
    --fxmc-radius: 14px;
    --fxmc-width: 420px;
    --fxmc-z: 9999;
}

.fxmc-overlay { display: none; }
.fxmc-overlay.is-closing {
    display: block !important;
    position: fixed !important; inset: 0 !important;
    background: rgba(15, 23, 42, .45) !important;
    z-index: 99998 !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    animation: fxmc-fadeout .3s ease-in both !important;
    pointer-events: none !important;
}
.fxmc-overlay.is-open {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, .45) !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 99998 !important;
    margin: 0 !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    animation: fxmc-fadein .35s ease-out both !important;
}
@keyframes fxmc-fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fxmc-fadeout { from { opacity: 1; } to { opacity: 0; } }

.fxmc-drawer { display: none; }
.fxmc-drawer.is-closing {
    display: flex !important;
    position: fixed !important;
    top: 0 !important; right: 0 !important; left: auto !important; bottom: 0 !important;
    width: 420px !important; max-width: 100vw !important;
    background: #fff !important;
    box-shadow: -10px 0 30px rgba(0,0,0,.12) !important;
    z-index: 99999 !important;
    flex-direction: column !important;
    margin: 0 !important;
    animation: fxmc-slideout .32s cubic-bezier(.4,0,.7,.4) both !important;
    pointer-events: none !important;
}
@keyframes fxmc-slideout {
    0%   { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(100%); opacity: .3; }
}
aside#fxmc-drawer.is-open,
.fxmc-drawer.is-open {
    display: flex !important;
    position: fixed !important;
    top: 0 !important; right: 0 !important; left: auto !important; bottom: 0 !important;
    width: 420px !important; max-width: 100vw !important;
    background: #fff !important; color: #1f2937 !important;
    box-shadow: -10px 0 30px rgba(0,0,0,.12) !important;
    z-index: 99999 !important;
    flex-direction: column !important;
    visibility: visible !important;
    margin: 0 !important;
    animation: fxmc-slidein .42s cubic-bezier(.16,.84,.44,1) both !important;
    will-change: transform, opacity;
}
@keyframes fxmc-slidein {
    0%   { transform: translateX(100%); opacity: .4; }
    60%  { opacity: 1; }
    100% { transform: translateX(0); opacity: 1; }
}

.fxmc-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--fxmc-border);
}
.fxmc-title {
    margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.2px;
    color: var(--fxmc-fg);
    display: flex; align-items: center; gap: 10px;
}
.fxmc-count {
    background: var(--fxmc-accent); color: #fff;
    min-width: 22px; height: 22px; padding: 0 7px;
    border-radius: 11px;
    font-size: 12px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.fxmc-close {
    width: 38px; height: 38px;
    background: var(--fxmc-soft); border: none; cursor: pointer;
    color: var(--fxmc-muted);
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background .2s, color .2s, transform .2s;
}
.fxmc-close:hover { background: #e9ebf2; color: var(--fxmc-fg); transform: rotate(90deg); }

.fxmc-body {
    flex: 1 1 auto; overflow-y: auto;
    display: flex; flex-direction: column;
    scrollbar-width: thin; scrollbar-color: #dfe3ea transparent;
}
.fxmc-body::-webkit-scrollbar { width: 8px; }
.fxmc-body::-webkit-scrollbar-thumb { background: #dfe3ea; border-radius: 4px; }
.fxmc-body::-webkit-scrollbar-thumb:hover { background: #cfd5e0; }

.fxmc-empty {
    flex: 1 1 auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 50px 24px; text-align: center; color: var(--fxmc-muted);
}
.fxmc-empty svg { color: #cdd3e0; margin-bottom: 16px; }
.fxmc-empty p { margin: 0; font-size: 14.5px; }

.fxmc-items {
    list-style: none; margin: 0; padding: 8px 0; flex: 1 1 auto;
}
.fxmc-item {
    display: flex; gap: 14px;
    padding: 16px 24px;
    position: relative;
    transition: background .18s;
}
.fxmc-item + .fxmc-item { border-top: 1px solid var(--fxmc-border); }
.fxmc-item:hover { background: #fafbfc; }
.fxmc-thumb {
    flex-shrink: 0; width: 74px; height: 74px;
    border-radius: 14px; overflow: hidden;
    background: var(--fxmc-soft);
    border: 1px solid var(--fxmc-border);
    display: block;
}
.fxmc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fxmc-info { flex: 1 1 auto; min-width: 0; padding-right: 22px; }
.fxmc-name {
    font-size: 14.5px; font-weight: 600; color: var(--fxmc-fg);
    text-decoration: none; line-height: 1.35;
    margin-bottom: 5px;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    transition: color .15s;
}
#fxmc-drawer .fxmc-name:hover { color: var(--fxmc-accent); }
.fxmc-line { font-size: 13px; color: var(--fxmc-muted); margin-bottom: 10px; }
.fxmc-line .amount { color: var(--fxmc-fg); font-weight: 600; }

.fxmc-qty-row {
    display: flex; align-items: center; gap: 0;
}
.fxmc-qty-btn {
    width: 32px; height: 32px;
    background: var(--fxmc-soft); border: none; cursor: pointer;
    color: var(--fxmc-fg); font-size: 17px; font-weight: 600; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.fxmc-qty-btn[data-action="dec"] { border-radius: 10px 0 0 10px; }
.fxmc-qty-btn[data-action="inc"] { border-radius: 0 10px 10px 0; }
.fxmc-qty-btn:hover { background: #e6e9f2; color: var(--fxmc-accent); }
#fxmc-drawer .fxmc-qty-input {
    flex: 0 0 44px;
    width: 44px; min-width: 0; max-width: 44px;
    height: 32px; min-height: 32px; line-height: 32px;
    border: none;
    box-shadow: inset 1px 0 0 #fff, inset -1px 0 0 #fff;
    text-align: center;
    font-size: 14px; font-weight: 700; padding: 0 2px;
    background: var(--fxmc-soft); color: var(--fxmc-fg);
    box-sizing: border-box;
    -moz-appearance: textfield;
}
.fxmc-qty-input::-webkit-inner-spin-button,
.fxmc-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.fxmc-line-sub {
    margin-left: auto;
    font-size: 14.5px; font-weight: 800; color: var(--fxmc-fg);
}

.fxmc-remove {
    position: absolute; top: 14px; right: 18px;
    width: 26px; height: 26px;
    background: none; border: none; cursor: pointer;
    padding: 0; color: var(--fxmc-muted);
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background .15s, color .15s;
}
.fxmc-remove:hover { color: var(--fxmc-danger); background: #fdecef; }

.fxmc-foot {
    padding: 20px 24px 22px;
    border-top: 1px solid var(--fxmc-border);
    background: var(--fxmc-bg);
    box-shadow: 0 -8px 22px rgba(15, 23, 42, .05);
}
.fxmc-subtotal {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 16px; font-size: 14px; color: var(--fxmc-muted);
    font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
.fxmc-subtotal strong { font-size: 22px; font-weight: 800; color: var(--fxmc-fg); letter-spacing: 0; }
.fxmc-checkout-btn {
    display: block; width: 100%; padding: 15px;
    background: linear-gradient(135deg, var(--fxmc-accent) 0%, var(--fxmc-accent-dark) 100%);
    color: #fff;
    text-align: center; text-decoration: none;
    font-weight: 700; font-size: 15px; letter-spacing: .2px;
    border-radius: var(--fxmc-radius);
    box-shadow: 0 10px 22px rgba(106, 125, 255, .35);
    transition: transform .2s, box-shadow .2s;
    box-sizing: border-box;
}
#fxmc-drawer .fxmc-checkout-btn,
#fxmc-drawer .fxmc-checkout-btn:hover,
#fxmc-drawer .fxmc-checkout-btn:focus {
    color: #fff;
}
.fxmc-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(106, 125, 255, .45);
}
.fxmc-view-cart {
    display: block; text-align: center;
    margin-top: 10px; padding: 11px;
    color: var(--fxmc-muted); text-decoration: none;
    font-size: 13.5px; font-weight: 600;
    border-radius: 12px;
    transition: background .15s, color .15s;
}
#fxmc-drawer .fxmc-view-cart:hover { color: var(--fxmc-fg); background: var(--fxmc-soft); }

.fxmc-loading { opacity: .55; pointer-events: none; }
.fxmc-item.is-removing { opacity: 0; transform: translateX(20px); transition: opacity .2s, transform .2s; }

@media (max-width: 480px) {
    :root { --fxmc-width: 100vw; }
    .fxmc-drawer { box-shadow: none; }
    .fxmc-head, .fxmc-item, .fxmc-foot { padding-left: 18px; padding-right: 18px; }
}
