﻿/* mkshop-side-cart.css */
:root {
    --side-cart-width: 400px;
    --side-cart-bg: #fff;
    --side-cart-border: #eee;
    --side-cart-overlay: rgba(0,0,0,0.5);
    --freeship-color: #4caf50;
    --freeship-bg: #e8f5e9;
}

/* Overlay */
.mkshop-side-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--side-cart-overlay);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.mkshop-side-cart-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Side Cart Panel */
.mkshop-side-cart {
    position: fixed;
    top: 0;
    right: -100%;
    width: var(--side-cart-width);
    max-width: 100%;
    height: 100%;
    background: var(--side-cart-bg);
    z-index: 99999;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}
.mkshop-side-cart.is-open {
    right: 0;
}

/* Header */
.mkshop-side-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--side-cart-border);
}
.mkshop-side-cart-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}
.mkshop-side-cart-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    padding: 0;
}

/* Body */
.mkshop-side-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.mkshop-side-cart-empty {
    text-align: center;
    margin-top: 50px;
}
.mkshop-side-cart-empty p {
    color: #666;
    margin-bottom: 20px;
}

/* Freeship Bar */
.mkshop-freeship-bar {
    background: var(--freeship-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}
.mkshop-freeship-bar p {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #333;
}
.mkshop-freeship-bar p.success {
    color: var(--freeship-color);
    font-weight: 600;
}
.progress-bar-wrap {
    background: #e0e0e0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}
.progress-bar {
    background: var(--freeship-color);
    height: 100%;
    transition: width 0.3s ease;
}

/* Items List */
.mkshop-side-cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}
.mkshop-side-cart-item {
    display: flex;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--side-cart-border);
    position: relative;
}
.mkshop-side-cart-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.mkshop-side-cart-item .item-img {
    width: 80px;
    margin-right: 15px;
}
.mkshop-side-cart-item .item-img img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}
.mkshop-side-cart-item .item-info {
    flex: 1;
}
.mkshop-side-cart-item .item-name {
    margin: 0 0 5px;
    font-size: 1rem;
    font-weight: 500;
}
.mkshop-side-cart-item .item-name a {
    color: #333;
    text-decoration: none;
}
.mkshop-side-cart-item .item-price {
    color: #666;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Quantity and Actions */
.item-qty-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mkshop-qty-btn {
    display: flex;
    align-items: center;
    border: 1px solid var(--side-cart-border);
    border-radius: 4px;
    overflow: hidden;
}
.mkshop-qty-btn button {
    background: #f9f9f9;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mkshop-qty-btn button:hover {
    background: #eee;
}
.mkshop-qty-btn input {
    width: 40px;
    height: 28px;
    border: none;
    border-left: 1px solid var(--side-cart-border);
    border-right: 1px solid var(--side-cart-border);
    text-align: center;
    font-size: 14px;
    -moz-appearance: textfield;
}
.mkshop-qty-btn input::-webkit-outer-spin-button,
.mkshop-qty-btn input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.remove-item {
    background: none;
    border: none;
    color: #e53935;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    text-decoration: underline;
}

/* Footer */
.mkshop-side-cart-footer {
    border-top: 1px solid var(--side-cart-border);
    padding-top: 20px;
    margin-top: auto;
}
.mkshop-side-cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    margin-bottom: 15px;
}
.mkshop-side-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mkshop-side-cart-actions .button {
    text-align: center;
    padding: 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
}
.mkshop-side-cart-actions .btn-view-cart {
    background: #f5f5f5;
    color: #333;
}
.mkshop-side-cart-actions .btn-checkout {
    background: #333;
    color: #fff;
}

/* Loading state for side cart */
.mkshop-side-cart.is-loading .mkshop-side-cart-body {
    opacity: 0.5;
    pointer-events: none;
}
body.mkshop-side-cart-open {
    overflow: hidden;
}
