/**
 * Mini Cart Drawer Styles
 * 
 * @package storzen
 * @since 1.0.3
 */

/* Overlay */
.szp-mini-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

/* Mini Cart Drawer */
.szp-mini-cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    max-width: 90%;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.szp-mini-cart-drawer.open {
    right: 0;
}

/* Header */
.szp-mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #ff4545 0%, #e63939 100%);
    position: relative;
}

.szp-mini-cart-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 69, 69, 0.3), transparent);
}

.szp-mini-cart-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.szp-mini-cart-header h3::before {
    content: '🛒';
    font-size: 22px;
}

.szp-mini-cart-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.szp-mini-cart-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Body */
.szp-mini-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #fafafa;
}

.szp-mini-cart-body::-webkit-scrollbar {
    width: 8px;
}

.szp-mini-cart-body::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.szp-mini-cart-body::-webkit-scrollbar-thumb {
    background: #ff4545;
    border-radius: 4px;
}

.szp-mini-cart-body::-webkit-scrollbar-thumb:hover {
    background: #e63939;
}

.szp-mini-cart-body .woocommerce-mini-cart {
    list-style: none;
    padding: 0;
    margin: 0;
}

.szp-mini-cart-body .woocommerce-mini-cart-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.szp-mini-cart-body .woocommerce-mini-cart-item:hover {
    box-shadow: 0 4px 12px rgba(255, 69, 69, 0.1);
    border-color: #ff4545;
    transform: translateY(-2px);
}

.szp-mini-cart-body .woocommerce-mini-cart-item.removing {
    opacity: 0.5;
    pointer-events: none;
    transform: scale(0.95);
}

.szp-mini-cart-body .woocommerce-mini-cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #f0f0f0;
    transition: border-color 0.3s ease;
}

.szp-mini-cart-body .woocommerce-mini-cart-item:hover img {
    border-color: #ff4545;
}

.szp-mini-cart-body .woocommerce-mini-cart-item .remove_from_cart_button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    color: #999;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s ease;
}

.szp-mini-cart-body .woocommerce-mini-cart-item .remove_from_cart_button:hover {
    background: #ff4545;
    color: #fff;
    border-color: #ff4545;
    transform: rotate(90deg);
}

.szp-mini-cart-body .woocommerce-mini-cart-item a:not(.remove_from_cart_button) {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    display: block;
    margin-bottom: 6px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.szp-mini-cart-body .woocommerce-mini-cart-item a:not(.remove_from_cart_button):hover {
    color: #ff4545;
}

.szp-mini-cart-body .quantity {
    color: #7f8c8d;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.szp-mini-cart-body .amount {
    color: #ff4545;
    font-weight: 700;
    font-size: 16px;
}

/* Subtotal */
.szp-mini-cart-body .woocommerce-mini-cart__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-top: 16px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

.szp-mini-cart-body .woocommerce-mini-cart__total strong {
    color: #ffffff;
    font-size: 17px;
    letter-spacing: 0.5px;
}

.szp-mini-cart-body .woocommerce-mini-cart__total .amount {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.szp-mini-cart-body .woocommerce-mini-cart__buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.szp-mini-cart-body .woocommerce-mini-cart__buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.szp-mini-cart-body .woocommerce-mini-cart__buttons a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.szp-mini-cart-body .woocommerce-mini-cart__buttons a:hover::before {
    width: 300px;
    height: 300px;
}

.szp-mini-cart-body .woocommerce-mini-cart__buttons .button.checkout {
    background: linear-gradient(135deg, #ff4545 0%, #e63939 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 69, 69, 0.3);
}

.szp-mini-cart-body .woocommerce-mini-cart__buttons .button.checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 69, 69, 0.4);
}

.szp-mini-cart-body .woocommerce-mini-cart__buttons .button.wc-forward {
    background: #ffffff;
    color: #2c3e50;
    border: 2px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.szp-mini-cart-body .woocommerce-mini-cart__buttons .button.wc-forward:hover {
    background: #f8f8f8;
    border-color: #ff4545;
    color: #ff4545;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 69, 69, 0.15);
}

/* Empty Cart */
.szp-mini-cart-body .woocommerce-mini-cart__empty-message {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
    font-size: 15px;
    background: #ffffff;
    border-radius: 12px;
    border: 2px dashed #e8e8e8;
}

.szp-mini-cart-body .woocommerce-mini-cart__empty-message::before {
    content: '🛒';
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Prevent body scroll when drawer is open */
body.szp-mini-cart-active {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .szp-mini-cart-drawer {
        width: 100%;
        max-width: 100%;
        right: -100%;
    }
    
    .szp-mini-cart-header {
        padding: 20px;
    }
    
    .szp-mini-cart-body {
        padding: 20px;
    }
    
    .szp-mini-cart-body .woocommerce-mini-cart-item {
        padding: 12px;
    }
    
    .szp-mini-cart-body .woocommerce-mini-cart-item img {
        width: 60px;
        height: 60px;
    }
}

/* Loading State */
.szp-mini-cart-body .loading {
    position: relative;
    opacity: 0.6;
}

.szp-mini-cart-body .loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff4545;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Add smooth animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.szp-mini-cart-drawer.open {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Product item animation */
.szp-mini-cart-body .woocommerce-mini-cart-item {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
