/* ============================================================
   MINI CART DRAWER - Mobalix
   ============================================================ */

/* Overlay */
.mcd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.mcd-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Drawer Panel */
.mcd-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 92vw;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
}
.mcd-drawer.open {
    transform: translateX(0);
}

/* Header */
.mcd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.mcd-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mcd-header-left svg {
    color: #1a1a2e;
}
.mcd-header-title {
    font-family: 'Bomstad Display';
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
}
.mcd-header-count {
    background: #e07322;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    font-family: 'Bomstad Display';
}
.mcd-close {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #64748b;
    border-radius: 8px;
    transition: all 0.2s;
}
.mcd-close:hover {
    background: #f1f5f9;
    color: #1a1a2e;
}

/* Body - scrollable area */
.mcd-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}
.mcd-body::-webkit-scrollbar {
    width: 4px;
}
.mcd-body::-webkit-scrollbar-track {
    background: transparent;
}
.mcd-body::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

/* ---- Shipping Progress Bar ---- */
.mcd-shipping-bar {
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}
.mcd-shipping-msg {
    font-size: 13px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
}
.mcd-shipping-msg svg {
    flex-shrink: 0;
    color: #94a3b8;
}
.mcd-shipping-free {
    color: #059669;
}
.mcd-shipping-free svg {
    color: #059669;
}
.mcd-progress-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}
.mcd-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e07322, #f59e0b);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.mcd-progress-fill.complete {
    background: linear-gradient(90deg, #059669, #10b981);
}

/* ---- Cart Items ---- */
.mcd-items {
    padding: 12px 20px;
}
.mcd-empty {
    text-align: center;
    padding: 40px 20px 30px;
}
.mcd-empty svg {
    margin-bottom: 12px;
}
.mcd-empty p {
    color: #94a3b8;
    font-size: 15px;
    margin: 0 0 16px;
}
.mcd-shop-link {
    display: inline-block;
    padding: 10px 24px;
    background: #1a1a2e;
    color: #fff;
    border-radius: 10px;
    font-family: 'Bomstad Display';
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.mcd-shop-link:hover {
    background: #2d3748;
    color: #fff;
    text-decoration: none;
}

/* Individual item */
.mcd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    transition: opacity 0.2s;
}
.mcd-item:last-child {
    border-bottom: none;
}
.mcd-item-img {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mcd-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
.mcd-item-info {
    flex: 1;
    min-width: 0;
}
.mcd-item-name {
    font-family: 'Bomstad Display';
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mcd-item-variant {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}
.mcd-item-qty {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}
.mcd-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.mcd-item-price {
    font-family: 'Bomstad Display';
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
}
.mcd-item-remove {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #cbd5e1;
    border-radius: 6px;
    transition: all 0.2s;
}
.mcd-item-remove:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* ---- Footer (Subtotal + Checkout) ---- */
.mcd-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}
.mcd-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    font-size: 15px;
    color: #475569;
}
.mcd-subtotal strong {
    font-family: 'Bomstad Display';
    font-size: 20px;
    color: #1a1a2e;
}
.mcd-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d3748 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Bomstad Display';
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.mcd-checkout-btn:hover {
    background: linear-gradient(135deg, #2d3748 0%, #1a1a2e 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 26, 46, 0.25);
    color: #fff;
    text-decoration: none;
}

/* ---- Upsell Section ---- */
.mcd-upsells {
    padding: 16px 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
.mcd-upsells-title {
    font-family: 'Bomstad Display';
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.mcd-upsell-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}
.mcd-upsell-item:last-child {
    border-bottom: none;
}
.mcd-upsell-img {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
}
.mcd-upsell-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
.mcd-upsell-info {
    flex: 1;
    min-width: 0;
}
.mcd-upsell-name {
    font-family: 'Bomstad Display';
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mcd-upsell-tagline {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 1px;
    font-style: italic;
}
.mcd-upsell-price {
    font-size: 13px;
    font-weight: 700;
    color: #e07322;
    margin-top: 3px;
}
.mcd-upsell-variation {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    margin-top: 3px;
    width: 100%;
    max-width: 160px;
    cursor: pointer;
    font-weight: 500;
}
.mcd-upsell-variation:focus {
    outline: none;
    border-color: #e07322;
}
.mcd-upsell-add {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 2px solid #e07322;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #e07322;
    transition: all 0.2s;
}
.mcd-upsell-add:hover {
    background: #e07322;
    color: #fff;
}
.mcd-upsell-add:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.mcd-upsell-add svg {
    transition: transform 0.2s;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    .mcd-drawer {
        width: 100vw;
        max-width: 100vw;
    }
    .mcd-item-img {
        width: 52px;
        height: 52px;
    }
    .mcd-upsell-img {
        width: 48px;
        height: 48px;
    }
}
