/* ============================================================
   MJ Fashion Gallery - Mini-Cart Sidebar
   ============================================================ */

/* ---- Backdrop Overlay ---- */
.mj-mini-cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mj-mini-cart-overlay.is-active {
    display: block;
    opacity: 1;
}

/* ---- Sidebar Drawer (slides from right) ---- */
.mj-mini-cart {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100dvh;
    z-index: 99999;
    background: #ffffff;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: none;
    overflow: hidden;
}
.mj-mini-cart.is-open {
    transform: translateX(0);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
}

/* ---- Header ---- */
.mj-mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.mj-mini-cart-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}
.mj-mini-cart-header-count {
    color: #e91e63;
}
.mj-mini-cart-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.mj-mini-cart-close:hover {
    color: #e91e63;
    background: rgba(233, 30, 99, 0.06);
}

/* ---- Toast Notification ---- */
.mj-mini-cart-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.85rem;
    font-weight: 600;
    animation: mj-toast-slide 0.3s ease;
}
@keyframes mj-toast-slide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Body (scrollable) ---- */
.mj-mini-cart-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

/* ---- Cart Items ---- */
.mj-mini-cart-items {
    flex: 1;
    padding: 16px 20px;
}
.mj-mini-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
    transition: opacity 0.3s, max-height 0.3s;
}
.mj-mini-cart-item:last-child {
    border-bottom: none;
}
.mj-mini-cart-item-removing {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    border: none;
    transition: opacity 0.3s, max-height 0.3s;
}
.mj-mini-cart-item-img {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
}
.mj-mini-cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mj-mini-cart-item-details {
    flex: 1;
    min-width: 0;
}
.mj-mini-cart-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.35;
    margin-bottom: 2px;
    padding-right: 20px;
}
.mj-mini-cart-item-name a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}
.mj-mini-cart-item-name a:hover {
    color: #e91e63;
}
.mj-mini-cart-item-sku {
    font-size: 0.7rem;
    color: #999;
    margin-bottom: 4px;
}
.mj-mini-cart-item-price {
    font-size: 0.82rem;
    color: #555;
    margin-bottom: 8px;
}
.mj-mini-cart-item-price del {
    color: #aaa;
    font-size: 0.75rem;
}
.mj-mini-cart-item-price ins {
    text-decoration: none;
    font-weight: 700;
    color: #e91e63;
}

/* ---- Quantity Controls ---- */
.mj-mini-cart-item-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
}
.mj-mini-cart-qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f5f5f5;
    color: #1a1a1a;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
    padding: 0;
}
.mj-mini-cart-qty-btn:hover {
    background: #e91e63;
    color: #fff;
}
.mj-mini-cart-qty-value {
    width: 32px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 28px;
}

/* ---- Item Total ---- */
.mj-mini-cart-item-total {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    margin-top: 2px;
    flex-shrink: 0;
}
.mj-mini-cart-item-total ins {
    text-decoration: none;
    color: #e91e63;
}

/* ---- Remove Button ---- */
.mj-mini-cart-item-remove {
    position: absolute;
    top: 14px;
    right: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #ccc;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    padding: 0;
}
.mj-mini-cart-item-remove:hover {
    color: #e53935;
    background: #fce4ec;
}

/* ---- Free Shipping Progress Bar ---- */
.mj-mini-cart-shipping-bar {
    padding: 0 20px 16px;
}
.mj-shipping-progress {
    background: #fce4ec;
    border-radius: 8px;
    padding: 12px 14px;
}
.mj-shipping-progress-text {
    font-size: 0.78rem;
    color: #1a1a1a;
    margin: 0 0 8px;
    font-weight: 500;
}
.mj-shipping-progress-text strong {
    color: #e91e63;
}
.mj-shipping-progress-success {
    color: #4caf50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.mj-shipping-progress-bar {
    height: 6px;
    background: rgba(233, 30, 99, 0.15);
    border-radius: 3px;
    overflow: hidden;
}
.mj-shipping-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e91e63, #f06292);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Summary ---- */
.mj-mini-cart-summary {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    flex-shrink: 0;
}
.mj-mini-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a1a;
}
.mj-mini-cart-subtotal-value {
    font-size: 1.1rem;
    color: #e91e63;
}
.mj-mini-cart-shipping-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #888;
    margin-top: 8px;
}

/* ---- Action Buttons ---- */
.mj-mini-cart-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.mj-mini-cart-view-cart {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: border-color 0.2s, color 0.2s;
}
.mj-mini-cart-view-cart:hover {
    border-color: #e91e63;
    color: #e91e63;
}
.mj-mini-cart-checkout {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #e91e63;
    border: 2px solid #e91e63;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, border-color 0.2s;
}
.mj-mini-cart-checkout:hover {
    background: #c2185b;
    border-color: #c2185b;
}

/* ---- Trust Badges ---- */
.mj-mini-cart-trust {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px 20px 16px;
    font-size: 0.72rem;
    color: #888;
    font-weight: 500;
    flex-shrink: 0;
}
.mj-mini-cart-trust span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- Empty State ---- */
.mj-mini-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    flex: 1;
}
.mj-mini-cart-empty-icon {
    margin-bottom: 16px;
}
.mj-mini-cart-empty-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}
.mj-mini-cart-empty-text {
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 20px;
}
.mj-mini-cart-empty-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: #e91e63;
    color: #ffffff;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.2s;
}
.mj-mini-cart-empty-btn:hover {
    background: #c2185b;
    transform: translateY(-1px);
}

/* ---- Cart Badge Bounce ---- */
.mj-cart-count-bounce {
    animation: mj-badge-bounce 0.6s ease;
}
@keyframes mj-badge-bounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* ============================================================
   RESPONSIVE - Tablet (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .mj-mini-cart {
        width: 360px;
    }
}

/* ============================================================
   RESPONSIVE - Mobile (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
    .mj-mini-cart {
        width: 320px;
    }
}

/* ============================================================
   RESPONSIVE - Small Mobile (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {
    .mj-mini-cart {
        width: 100%;
    }
}
