/**
 * Side Cart Styles
 * 
 */

/* ========================================
   Side Cart Container
   ======================================== */

.side-cart {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    pointer-events: none;
}

.side-cart.is-open {
    pointer-events: auto;
}

/* Overlay */
.side-cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.side-cart.is-open .side-cart-overlay {
    opacity: 1;
}

/* Cart Container */
.side-cart-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.side-cart.is-open .side-cart-container {
    transform: translateX(0);
}

/* ========================================
   Header
   ======================================== */

.side-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.side-cart-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

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

.side-cart-close:hover {
    background-color: #f3f4f6;
    color: #111827;
}
/* Side Cart gaat OVER alles heen */
.side-cart {
    z-index: 999999 !important; /* Hoger dan je bars */
}

.side-cart-container {
    top: 0 !important;
    height: 100% !important;
}

/* Verberg bars wanneer Side Cart open is */
body.side-cart-open #free-shipping-bar,
body.side-cart-open #totebag-progress-bar {
    display: none !important;
}

/* ========================================
   Content Area
   ======================================== */

.side-cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Custom scrollbar */
.side-cart-content::-webkit-scrollbar {
    width: 8px;
}

.side-cart-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.side-cart-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.side-cart-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Empty State */
.side-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.side-cart-empty svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.side-cart-empty p {
    margin: 0;
    font-size: 16px;
}

/* ========================================
   Cart Items
   ======================================== */

.side-cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-cart-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background-color: #f9fafb;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.side-cart-item.removing {
    opacity: 0;
    transform: translateX(20px);
}

/* Product Image */
.side-cart-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
}

.side-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Details */
.side-cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-cart-item-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
}

.side-cart-item-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.side-cart-item-name a:hover {
    color: #6366f1;
}

.side-cart-item-price {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

/* Variation Data */
.woocommerce-product-attributes {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.woocommerce-product-attributes dt,
.woocommerce-product-attributes dd {
    display: inline;
    margin: 0;
}

.woocommerce-product-attributes dt {
    font-weight: 600;
}

/* ========================================
   Quantity Controls
   ======================================== */

.side-cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.qty-btn:hover:not(:disabled) {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-btn svg {
    color: #6b7280;
}

.qty-input {
    width: 45px;
    height: 28px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    background-color: #ffffff;
    color: #111827;
}

/* Remove from appearance */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type=number] {
    -moz-appearance: textfield;
}

/* ========================================
   Remove Button
   ======================================== */

.side-cart-item-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.side-cart-item-remove:hover {
    background-color: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* ========================================
   Footer
   ======================================== */

.side-cart-footer {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    background-color: #ffffff;
}

.side-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.subtotal-label {
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
}

.subtotal-amount {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

/* Buttons */
.side-cart-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.view-cart-btn {
    background-color: #f3f4f6;
    color: #111827;
    margin-bottom: 12px;
}

.view-cart-btn:hover {
    background-color: #e5e7eb;
}

.checkout-btn {
    background-color: #6366f1;
    color: #ffffff;
    margin-bottom: 12px;
}

.checkout-btn:hover {
    background-color: #4f46e5;
}

.side-cart-continue {
    background: none;
    border: none;
    width: 100%;
    padding: 12px;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.side-cart-continue:hover {
    color: #111827;
}

/* ========================================
   Loading State
   ======================================== */

.side-cart.is-updating {
    pointer-events: none;
}

.side-cart.is-updating .side-cart-content {
    opacity: 0.6;
}

/* ========================================
   Notifications
   ======================================== */

.side-cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.side-cart-notification.show {
    transform: translateX(0);
}

.side-cart-notification.success {
    border-left: 4px solid #10b981;
    color: #065f46;
}

.side-cart-notification.error {
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.side-cart-notification.warning {
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

/* ========================================
   Body Lock (prevent scrolling)
   ======================================== */

body.side-cart-open {
    overflow: hidden;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .side-cart-container {
        max-width: 100%;
    }

    .side-cart-header {
        padding: 20px;
    }

    .side-cart-content {
        padding: 16px 20px;
    }

    .side-cart-footer {
        padding: 20px;
    }

    .side-cart-item {
        padding: 12px;
    }

    .side-cart-item-image {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .side-cart-title {
        font-size: 18px;
    }

    .side-cart-item-name {
        font-size: 13px;
    }

    .side-cart-item-price {
        font-size: 14px;
    }
}
