/* Shopping Cart System - OF THE CULTURE Brand System */

/* Bag Navigation Indicator */
.bag-indicator {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

.bag-link {
    font-family: 'JetBrains Mono', monospace;
    color: #007acc;
    font-size: 0.8rem;
    line-height: 1.2;
    display: block;
    text-decoration: none;
    transition: color 0.25s ease, opacity 0.25s ease;
}

.bag-link.empty {
    opacity: 0.4;
    cursor: default;
}

.bag-link:hover {
    color: var(--color-gold);
    opacity: 1;
}

.bag-link.empty:hover {
    color: #007acc;
    opacity: 0.4;
    cursor: default;
}

#reviewBagBtn {
    background: none;
    border: none;
    color: #007acc;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    font-size: inherit;
    transition: color 0.25s ease;
}

#reviewBagBtn:hover {
    color: var(--color-gold);
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(4px) saturate(1.05);
    -webkit-backdrop-filter: blur(4px) saturate(1.05);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.35s cubic-bezier(0.22, 1, 0.36, 1), backdrop-filter 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: 'JetBrains Mono', monospace;
}

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

.cart-sidebar {
    position: fixed;
    top: 20px;
    right: 20px;
    bottom: auto;
    width: min(420px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    height: auto;
    min-height: 280px;
    background: var(--color-white);
    border: none;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateX(calc(100% + 20px)) translateZ(0);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    display: flex;
    flex-direction: column;
}

.cart-overlay.active .cart-sidebar {
    transform: translateX(0) translateZ(0);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
}

/* Cart Header - Optimized proportions */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 16px 20px;
    border-bottom: 1px solid #eee;
    background: var(--color-white);
    flex-shrink: 0;
}

.cart-header h2 {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #333;
}

.cart-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-close:hover {
    color: var(--color-gold);
}

/* Cart Items - Overflow protection */
.cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 180px);
    width: 100%;
    box-sizing: border-box;
}

.cart-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Product Image in Cart */
.item-image {
    flex-shrink: 0;
    width: 50px;
    height: 70px;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
    align-self: flex-start;
}

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

.cart-item:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 70px;
}

.item-info h4 {
    font-size: 0.8rem;
    font-weight: 400;
    margin: 0 0 8px 0;
    letter-spacing: 0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.product-link {
    color: var(--color-black);
    text-decoration: none;
    border-bottom: none;
    padding-bottom: 0;
    transition: opacity 0.2s ease;
}

.product-link:hover {
    opacity: 0.7;
}

.item-details {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 12px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.qty-btn {
    background: var(--color-white);
    color: var(--color-black);
    border: 1px solid #ddd;
    width: 28px;
    height: 28px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    font-size: 0.7rem;
    border-radius: 4px;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--color-gold);
    border-color: var(--color-gold);
    color: var(--color-black);
}

.qty-input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    padding: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    border-radius: 2px;
    transition: border-color 0.2s ease;
}

.qty-input:focus {
    outline: none;
    border-color: var(--color-gold);
}

.remove-item {
    background: none;
    border: none;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    margin-top: 0;
    transition: color 0.2s ease;
    align-self: flex-start;
}

.remove-item:hover {
    color: var(--color-gold);
}

.item-price {
    font-size: 0.8rem;
    font-weight: 500;
    flex-shrink: 0;
    align-self: flex-start;
    min-width: 65px;
    max-width: 80px;
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Cart Footer - Optimized spacing */
.cart-footer {
    border-top: 1px solid #eee;
    padding: 20px;
    flex-shrink: 0;
    background: var(--color-white);
    width: 100%;
    box-sizing: border-box;
}

.cart-summary {
    margin-bottom: 16px;
}

.cart-subtotal {
    font-size: 0.8rem;
    font-weight: 500;
    text-align: right;
    letter-spacing: 0.02em;
    padding: 10px 0;
}

.checkout-btn {
    width: 100%;
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    border-radius: 4px;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    transform: translateZ(0);
}

.checkout-btn:active {
    transform: translateY(1px) translateZ(0);
}

.checkout-btn:hover {
    background: var(--color-gold);
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Empty Cart State */
.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 0.8rem;
}

/* Mobile Sticky Bag Indicator */
.mobile-bag-sticky {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--color-white);
    border: 1px solid var(--color-black);
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 0.8rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 999;
    cursor: pointer;
}

.mobile-bag-sticky.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-bag-sticky:hover {
    border-color: var(--color-gold);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .cart-overlay {
        background: rgba(0, 0, 0, 0.08);
        backdrop-filter: blur(6px) saturate(1.1);
        -webkit-backdrop-filter: blur(6px) saturate(1.1);
    }
    
    .cart-sidebar {
        /* Wider mobile floating to prevent price cutoff */
        top: 20px;
        right: 15px;
        bottom: auto;
        left: auto;
        width: min(360px, calc(100vw - 30px));
        max-width: 360px;
        min-width: 320px;
        max-height: calc(100vh - 40px);
        height: auto;
        border-radius: 4px;
        border: none;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        transform: translateX(calc(100% + 15px)) translateZ(0);
        transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
        will-change: transform;
    }
    
    .cart-overlay.active .cart-sidebar {
        transform: translateX(0) translateZ(0);
    }
    
    .cart-items {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: calc(100vh - 140px);
        max-height: calc(100dvh - 140px);
    }
    
    .cart-footer {
        flex-shrink: 0;
        padding: 16px 20px 20px 20px;
        border-top: 1px solid #eee;
        background: var(--color-white);
        position: sticky;
        bottom: 0;
    }
    
    .cart-header {
        flex-shrink: 0;
        padding: 20px 20px 16px 20px;
    }
    
    .cart-items {
        padding: 12px 20px 16px 20px;
    }
    
    .cart-indicator {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cart-item {
        flex-direction: row;
        align-items: flex-start;
        padding: 12px 0;
    }
    
    .item-image {
        width: 50px;
        height: 60px;
    }
    
    .item-info {
        flex: 1;
        min-height: 60px;
    }
    
    .item-price {
        align-self: flex-start;
        margin-top: 0;
        text-align: right;
        min-width: 70px;
        max-width: 85px;
    }
    
    .quantity-controls {
        gap: 8px;
        margin: 8px 0 8px 0;
    }
    
    .qty-btn {
        min-height: 40px;
        min-width: 40px;
        width: 40px;
        height: 40px;
        font-size: 0.7rem;
    }
    
    .qty-input {
        width: 55px;
        height: 40px;
        padding: 8px;
        font-size: 0.7rem;
    }
    
    .empty-cart {
        font-size: 0.7rem;
    }
    
}

