/**
 * Slide Out Cart Styles
 * Loaded globally on all pages when WooCommerce is active
 * 
 * @package RankExpert
 */

/* ========================================
 * SLIDE OUT CART - DIGITA STYLE
 * ======================================== */

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
}

.cart-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Slide Out Cart Panel */
.slide-out-cart {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: var(--digita-background, #ffffff);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.slide-out-cart.is-open {
    transform: translateX(0);
}

body.cart-drawer-open {
    overflow: hidden;
}

/* Cart Header */
.cart-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--digita-border, #e5e5e5);
    flex-shrink: 0;
}

.cart-drawer-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--digita-foreground, #262626);
    margin: 0;
}

.cart-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--digita-foreground-muted, #808080);
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-drawer-close:hover {
    background: var(--digita-background-alt, #f5f5f5);
    color: var(--digita-foreground, #262626);
}

/* Free Shipping Progress */
.cart-shipping-progress {
    padding: 16px 24px;
    background: var(--digita-background-alt, #f5f5f5);
    border-bottom: 1px solid var(--digita-border, #e5e5e5);
    flex-shrink: 0;
}

.shipping-progress-bar {
    position: relative;
    height: 8px;
    background: #e5e5e5;
    border-radius: 4px;
    overflow: visible;
    margin-bottom: 12px;
}

.shipping-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.shipping-progress-icon {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: white;
    border: 2px solid #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
}

.shipping-progress-text {
    font-size: 13px;
    color: var(--digita-foreground, #262626);
    margin: 0;
    text-align: center;
    line-height: 1.4;
}

.shipping-progress-text strong {
    color: var(--digita-foreground, #262626);
}

/* Cart Items Container */
.cart-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

/* Individual Cart Item */
.cart-drawer-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--digita-border, #e5e5e5);
    position: relative;
}

.cart-drawer-item:last-child {
    border-bottom: none;
}

.cart-item-thumbnail {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: var(--digita-background-alt, #f5f5f5);
    border-radius: 8px;
    overflow: hidden;
}

.cart-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--digita-foreground, #262626);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-name:hover {
    color: var(--digita-primary, #E07B4C);
}

.cart-item-variation {
    font-size: 12px;
    color: var(--digita-foreground-muted, #808080);
}

.cart-item-price-qty {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}

.cart-item-qty {
    font-size: 13px;
    color: var(--digita-foreground-muted, #808080);
}

.cart-item-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--digita-primary, #E07B4C);
}

.cart-item-remove {
    position: absolute;
    top: 16px;
    right: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--digita-foreground-muted, #808080);
    transition: color 0.2s;
}

.cart-item-remove:hover {
    color: var(--digita-sale, #EF4444);
}

/* Empty Cart State */
.cart-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.empty-cart-icon {
    color: var(--digita-border, #e5e5e5);
    margin-bottom: 24px;
}

.empty-cart-text {
    font-size: 16px;
    color: var(--digita-foreground-muted, #808080);
    margin: 0 0 24px 0;
}

.btn-continue-shopping {
    display: inline-block;
    padding: 12px 24px;
    background: var(--digita-primary, #E07B4C);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-continue-shopping:hover {
    background: var(--digita-primary-hover, #C96A3E);
    color: white;
}

/* Cart Footer */
.cart-drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--digita-border, #e5e5e5);
    background: var(--digita-background, #ffffff);
    flex-shrink: 0;
}

.cart-drawer-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.subtotal-label {
    font-size: 16px;
    font-weight: 500;
    font-style: italic;
    color: var(--digita-foreground, #262626);
}

.subtotal-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary, var(--digita-primary, #E07B4C));
}

.cart-drawer-buttons {
    display: flex;
    gap: 12px;
}

.btn-view-cart,
.btn-checkout {
    flex: 1;
    padding: 14px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.btn-view-cart,
.slide-out-cart .btn-view-cart,
.slide-out-cart a.btn-view-cart,
a.btn-view-cart {
    background: var(--digita-foreground, #262626);
    color: #ffffff !important;
}

.btn-view-cart:hover,
.slide-out-cart .btn-view-cart:hover,
.slide-out-cart a.btn-view-cart:hover,
a.btn-view-cart:hover {
    background: #1a1a1a;
    color: #ffffff !important;
}

.btn-checkout,
.slide-out-cart .btn-checkout,
.slide-out-cart a.btn-checkout,
a.btn-checkout {
    background: var(--color-primary, var(--digita-primary, #E07B4C));
    color: #ffffff !important;
}

.btn-checkout:hover,
.slide-out-cart .btn-checkout:hover,
.slide-out-cart a.btn-checkout:hover,
a.btn-checkout:hover {
    background: var(--color-primary-hover, var(--digita-primary-hover, #C96A3E));
    color: #ffffff !important;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .slide-out-cart {
        max-width: 100%;
    }
    
    .cart-drawer-header,
    .cart-shipping-progress,
    .cart-drawer-items,
    .cart-drawer-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .cart-drawer-buttons {
        flex-direction: column;
    }
}

