/**
 * Malmsteypa Mini Cart Styles
 * Clean, minimal slide-out cart from the right
 */

/* Cart Icon Trigger */
.malmsteypa-mini-cart-trigger {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: all 0.3s ease;
}

.malmsteypa-mini-cart-trigger:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.malmsteypa-mini-cart-trigger .cart-icon {
    width: 22px;
    height: 22px;
    color: currentColor;
}

.malmsteypa-mini-cart-trigger .cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #E65501;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

/* Overlay */
.malmsteypa-mini-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

/* Sidebar Cart */
.malmsteypa-mini-cart-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100%;
    background: #F5F6F8;
    z-index: 999999;
    will-change: right;
    transition: right 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.malmsteypa-mini-cart-sidebar.active {
    right: 0;
}

/* Cart Header */
.mini-cart-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F5F6F8;
}

.mini-cart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.mini-cart-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.mini-cart-close:hover {
    background: #f3f4f6;
}

.mini-cart-close svg {
    width: 20px;
    height: 20px;
    color: #6b7280;
}

/* Cart Content */
.mini-cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Empty Cart */
.mini-cart-empty {
    text-align: center;
    padding: 60px 20px;
}

.mini-cart-empty .empty-cart-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: #d1d5db;
}

.mini-cart-empty p {
    color: #6b7280;
    margin-bottom: 24px;
    font-size: 16px;
}

.mini-cart-empty .continue-shopping {
    display: inline-block;
    padding: 12px 24px;
    background: #E65500;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.mini-cart-empty .continue-shopping:hover {
    background: #cc4d00;
}

/* Cart Items */
.mini-cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mini-cart-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    position: relative;
}

.mini-cart-item .item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.mini-cart-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.mini-cart-item .item-details {
    flex: 1;
    min-width: 0;
}

.mini-cart-item .item-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.mini-cart-item .item-title a {
    color: #1f2937;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-cart-item .item-title a:hover {
    color: #E65500;
}

.mini-cart-item .item-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.mini-cart-item .item-quantity {
    font-weight: 500;
}

.mini-cart-item .item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.mini-cart-item .item-price {
    color: #1f2937;
    font-weight: 600;
    font-size: 14px;
}

.mini-cart-item .remove-item {
    background: none;
    border: none;
    color: #000000;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: auto;
    height: auto;
    transition: color 0.2s ease;
}

.mini-cart-item .remove-item:hover {
    color: #dc2626;
}

/* Cart Footer */
.mini-cart-footer {
    border-top: 1px solid #e5e7eb;
    padding: 20px;
    background: #F5F6F8;
}

.mini-cart-totals {
    margin-bottom: 16px;
}

.mini-cart-totals .total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.mini-cart-totals .total-amount {
    color: #E65500;
    font-size: 18px;
}

/* Cart Buttons */
.mini-cart-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-cart-buttons a {
    display: block;
    padding: 14px;
    text-align: center;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mini-cart-buttons .view-cart-btn {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.mini-cart-buttons .view-cart-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.mini-cart-buttons .checkout-btn {
    background: #E65500;
    color: white;
}

.mini-cart-buttons .checkout-btn:hover {
    background: #cc4d00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 85, 0, 0.3);
}

/* Loading State */
.mini-cart-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.mini-cart-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid #E65500;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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

/* Mobile Responsive */
@media (max-width: 480px) {
    .malmsteypa-mini-cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .malmsteypa-mini-cart-sidebar.active {
        right: 0;
    }
}