/* ── Sidebar Cart Overlay ── */
.smfs-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.smfs-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Sidebar Panel ── */
.smfs-cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 99999;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    overflow-x: hidden;
}

.smfs-cart-sidebar.active {
    transform: translateX(0);
}

/* ── Header ── */
.smfs-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.smfs-cart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

.smfs-cart-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.smfs-cart-close:hover {
    color: #000;
}

/* ── Content ── */
.smfs-cart-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 24px 24px;
    box-sizing: border-box;
}

.smfs-cart-content * {
    max-width: 100%;
    box-sizing: border-box;
}

.smfs-cart-empty {
    text-align: center;
    color: #888;
    padding: 60px 0;
    font-size: 15px;
}

/* ── Cart Items ── */
.smfs-cart-items {
    padding-top: 16px;
}

.smfs-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.smfs-item-thumb {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.smfs-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.smfs-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.smfs-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #222;
    line-height: 1.3;
}

.smfs-item-variation {
    font-size: 12px;
    color: #888;
}

.smfs-item-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

/* ── Quantity Controls ── */
.smfs-qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.smfs-qty-btn {
    width: 32px;
    height: 32px;
    background: #f8f8f8;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.smfs-qty-btn:hover {
    background: #eee;
}

.smfs-qty-value {
    width: 36px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    line-height: 32px;
}

.smfs-item-price {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
}

/* ── Remove Button ── */
.smfs-item-remove {
    position: absolute;
    top: 16px;
    right: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    padding: 4px;
    transition: color 0.2s;
}

.smfs-item-remove:hover {
    color: #e74c3c;
}

/* ── Subtotal & Total ── */
.smfs-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 10px;
    font-size: 15px;
    color: #444;
}

.smfs-subtotal-value {
    font-weight: 600;
    color: #222;
}

.smfs-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    font-size: 20px;
    font-weight: 700;
    color: #222;
}

.smfs-total-value {
    color: #222;
}

/* ── Buttons ── */
.smfs-btn-checkout {
    display: block;
    width: 100%;
    padding: 16px;
    background: #2dcb73;
    color: #fff !important;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-decoration: none !important;
    border-radius: 10px;
    margin-top: 12px;
    transition: background 0.2s;
}

.smfs-btn-checkout:hover {
    background: #25b566;
}

.smfs-btn-view-cart {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
    color: #333 !important;
    text-decoration: underline !important;
}

/* ── Loading Spinner ── */
.smfs-cart-loading {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.smfs-cart-loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: #2dcb73;
    border-radius: 50%;
    animation: smfs-spin 0.6s linear infinite;
}

@keyframes smfs-spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .smfs-cart-sidebar {
        width: 100vw;
        max-width: 100vw;
    }
}
