/**
 * WooCommerce Cart Shelf Styles
 * Sliding drawer from the right side with cart badge
 */

/* Cart Count Badge */
.cart-count-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DomCasual Bold', Helvetica, Arial, Lucida, sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    z-index: 10;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.5);
}

.cart-count-badge.has-items {
    opacity: 1;
    transform: scale(1);
}

#cart {
    cursor: pointer;
    transition: transform 0.2s ease;
}

#cart:hover {
    transform: scale(1.08);
}

/* Cart Shelf Container */
.cart-shelf {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    pointer-events: none;
}

.cart-shelf.active {
    pointer-events: auto;
}

/* Overlay */
.cart-shelf-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.cart-shelf.active .cart-shelf-overlay {
    opacity: 1;
}

/* Cart Shelf Content */
.cart-shelf-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90%;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-shelf.active .cart-shelf-content {
    transform: translateX(0);
}

/* Cart Shelf Header */
.cart-shelf-header {
    padding: 28px 28px 24px;
    border-bottom: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: #fff;
}

.cart-shelf-header h3 {
    margin: 0;
    font-family: 'DomCasual Bold', Helvetica, Arial, Lucida, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #000;
    letter-spacing: 0.5px;
}

.cart-shelf-close {
    background: #000;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
    font-weight: 300;
}

.cart-shelf-close:hover {
    background: #333;
    transform: rotate(90deg);
}

/* Cart Shelf Body */
.cart-shelf-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    background: #fafafa;
}

.cart-shelf-items {
    padding: 24px;
}

/* Cart Item */
.cart-shelf-item {
    display: flex;
    gap: 18px;
    padding: 20px;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-shelf-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cart-shelf-item:first-child {
    padding-top: 20px;
}

.cart-shelf-item:last-child {
    margin-bottom: 0;
}

.cart-shelf-item-image {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    border: 2px solid #000;
}

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

.cart-shelf-item-details {
    flex: 1;
    min-width: 0;
    padding-right: 30px;
}

.cart-shelf-item-name {
    font-family: 'DomCasual Bold', Helvetica, Arial, Lucida, sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #000;
    margin: 0 0 8px;
    line-height: 1.3;
}

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

.cart-shelf-item-name a:hover {
    color: #555;
}

.cart-shelf-item-meta {
    font-family: 'DomCasual Bold', Helvetica, Arial, Lucida, sans-serif;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.cart-shelf-item-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.cart-shelf-item-quantity {
    font-family: 'DomCasual Bold', Helvetica, Arial, Lucida, sans-serif;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.cart-shelf-item-total {
    font-family: 'DomCasual Bold', Helvetica, Arial, Lucida, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

.cart-shelf-remove {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #000;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 50%;
    font-weight: 300;
}

.cart-shelf-remove:hover {
    background: #e74c3c;
    transform: rotate(90deg) scale(1.1);
}

/* Empty/Loading States */
.cart-empty,
.cart-loading,
.cart-error {
    text-align: center;
    padding: 80px 30px;
    font-family: 'DomCasual Bold', Helvetica, Arial, Lucida, sans-serif;
    color: #666;
    font-size: 16px;
}

.cart-loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e8e8e8;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
    vertical-align: middle;
}

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

/* Cart Shelf Footer */
.cart-shelf-footer {
    padding: 28px 32px 32px;
    border-top: 2px solid #000;
    background: #fff;
    flex-shrink: 0;
}

.cart-shelf-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: #f8f8f8;
    border-radius: 12px;
}

.cart-shelf-subtotal span:first-child {
    font-family: 'DomCasual Bold', Helvetica, Arial, Lucida, sans-serif;
    color: #000;
    font-weight: 700;
    font-size: 18px;
}

.cart-subtotal-amount {
    font-family: 'DomCasual Bold', Helvetica, Arial, Lucida, sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #000;
}

.cart-shelf-button {
    display: block;
    width: 100%;
    padding: 18px 32px;
    background: #000;
    color: #fff !important;
    text-align: center;
    text-decoration: none;
    border-radius: 50px;
    font-family: 'DomCasual Bold', Helvetica, Arial, Lucida, sans-serif;
    font-size: 17px;
    font-weight: 700;
    transition: all 0.2s ease;
    border: 2px solid #000;
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.cart-shelf-button:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.cart-shelf-button.checkout-button {
    background: #2ecc71;
    border-color: #2ecc71;
    margin-bottom: 0;
}

.cart-shelf-button.checkout-button:hover {
    background: #27ae60;
    border-color: #27ae60;
    box-shadow: 0 6px 16px rgba(46, 204, 113, 0.3);
}

/* Prevent body scroll when cart is open */
body.cart-shelf-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-shelf-header {
        padding: 24px 20px 20px;
    }
    
    .cart-shelf-header h3 {
        font-size: 24px;
    }
    
    .cart-shelf-items {
        padding: 16px;
    }
    
    .cart-shelf-item {
        padding: 16px;
        gap: 14px;
    }
    
    .cart-shelf-item-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-shelf-item-name {
        font-size: 15px;
    }
    
    .cart-shelf-item-total {
        font-size: 16px;
    }
    
    .cart-shelf-footer {
        padding: 24px 20px 28px;
    }
    
    .cart-shelf-subtotal {
        padding: 16px 0;
        margin-bottom: 20px;
    }
    
    .cart-shelf-subtotal span:first-child {
        font-size: 16px;
    }
    
    .cart-subtotal-amount {
        font-size: 20px;
    }
    
    .cart-shelf-button {
        padding: 16px 28px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .cart-shelf-header h3 {
        font-size: 22px;
    }
    
    .cart-shelf-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .cart-shelf-item-image {
        width: 100px;
        height: 100px;
    }
    
    .cart-shelf-item-details {
        padding-right: 0;
    }
    
    .cart-shelf-remove {
        top: 12px;
        right: 12
        height: 60px;
    }
    
    .cart-shelf-header h3 {
        font-size: 20px;
    }
}

/* Animation for items being added */
@keyframes slideInItem {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-shelf-item {
    animation: slideInItem 0.3s ease;
}
