/* Full Cart Template as Sidebar - Compact styling for sidebar display */

/* Cart sidebar - starts below navbar, full height */
.cart-sidebar-full {
    position: fixed;
    right: 0;
    top: 50px;
    bottom: 0;
    width: 300px;
    background: var(--color-neutral-50);
    border-left: 1px solid var(--color-neutral-200);
    display: none; /* Hidden by default when empty */
    flex-direction: column;
    font-size: 0.8rem;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 900;
}

/* Explicitly collapse when empty */
.cart-sidebar-full.is-empty {
    width: 0px !important;
    min-width: 0px !important;
    max-width: 0px !important;
    padding: 0 !important;
    border: none !important;
}

/* Application layout with cart sidebar */
@media (min-width: 768px) {
    .content-area {
        min-width: 0; /* Prevent flex item from overflowing */
    }
    
    .content-wrapper {
        padding: var(--space-4);
        max-width: 100%;
        width: 100%;
        flex: 1;
    }
    
    /* Show sidebar and adjust content when cart has items */
    body.cart-has-items .cart-sidebar-full.has-items {
        display: flex !important;
    }
    
    body.cart-has-items .app-layout,
    body.cart-has-items footer {
        margin-right: 300px;
    }
}

/* Hide on mobile */
@media (max-width: 767px) {
    .cart-sidebar-full {
        display: none !important;
    }
}

/* Cart Sidebar Header */
.cart-sidebar-full .cart-sidebar-header {
    padding: 0.5rem;
    border-bottom: 1px solid var(--color-neutral-200);
    background: var(--color-primary-50);
    flex-shrink: 0;
}

.cart-sidebar-full .cart-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.cart-sidebar-full .cart-title {
    color: var(--color-primary-700);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cart-sidebar-full .cart-count {
    font-size: 0.7rem;
    color: var(--color-neutral-600);
}

.cart-sidebar-full .btn-checkout {
    background: var(--color-primary-600);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    transition: background-color 0.2s ease;
}

.cart-sidebar-full .btn-checkout:hover {
    background: var(--color-primary-700);
    color: white;
    text-decoration: none;
}

/* Cart Content */
.cart-sidebar-full .cart-sidebar-content {
    flex: 1;
    padding: 0.5rem;
    overflow-y: auto;
}

/* Wholesale Info */
.cart-sidebar-full .wholesale-info {
    margin-bottom: 0.75rem;
}

.cart-sidebar-full .alert {
    padding: 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    margin: 0;
}

.cart-sidebar-full .alert-info {
    background: var(--color-blue-50);
    color: var(--color-blue-800);
    border: 1px solid var(--color-blue-200);
}

.cart-sidebar-full .alert-success {
    background: var(--color-green-50);
    color: var(--color-green-800);
    border: 1px solid var(--color-green-200);
}

/* Cart Items List */
.cart-sidebar-full .cart-items-list {
    margin-bottom: 1rem;
}

.cart-sidebar-full .cart-item-sidebar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--color-neutral-200);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: white;
    position: relative;
}

.cart-sidebar-full .cart-item-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.cart-sidebar-full .cart-item-image .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.cart-sidebar-full .cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-sidebar-full .product-name {
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 0 0.2rem 0;
    line-height: 1.2;
}

.cart-sidebar-full .product-name a {
    color: var(--color-neutral-900);
    text-decoration: none;
}

.cart-sidebar-full .product-name a:hover {
    color: var(--color-primary-600);
    text-decoration: underline;
}

.cart-sidebar-full .product-variations {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.cart-sidebar-full .variation {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    background: var(--color-neutral-100);
    border-radius: 3px;
    color: var(--color-neutral-700);
}

.cart-sidebar-full .cart-item-pricing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.cart-sidebar-full .quantity-section {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cart-sidebar-full .quantity-label {
    font-size: 0.6rem;
    color: var(--color-neutral-600);
}

.cart-sidebar-full .quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.cart-sidebar-full .qty-btn {
    width: 20px;
    height: 20px;
    border: 1px solid var(--color-neutral-300);
    background: white;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.6rem;
    transition: all 0.2s ease;
}

.cart-sidebar-full .qty-btn:hover {
    background: var(--color-neutral-100);
    border-color: var(--color-neutral-400);
}

.cart-sidebar-full .quantity {
    font-size: 0.7rem;
    font-weight: 500;
    min-width: 15px;
    text-align: center;
}

.cart-sidebar-full .item-total {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary-600);
}

.cart-sidebar-full .remove-form {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
}

.cart-sidebar-full .remove-btn {
    width: 18px;
    height: 18px;
    border: none;
    background: var(--color-red-100);
    color: var(--color-red-600);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.6rem;
    transition: all 0.2s ease;
}

.cart-sidebar-full .remove-btn:hover {
    background: var(--color-red-200);
    color: var(--color-red-700);
}

/* Cart Summary */
.cart-sidebar-full .cart-summary {
    background: var(--color-neutral-100);
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.cart-sidebar-full .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
    font-size: 0.7rem;
}

.cart-sidebar-full .summary-row:last-child {
    margin-bottom: 0;
}

.cart-sidebar-full .total-row {
    border-top: 1px solid var(--color-neutral-300);
    padding-top: 0.3rem;
    margin-top: 0.3rem;
    font-weight: 600;
}

/* Action Buttons */
.cart-sidebar-full .cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cart-sidebar-full .btn {
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.cart-sidebar-full .btn-primary {
    background: var(--color-primary-600);
    color: white;
}

.cart-sidebar-full .btn-primary:hover {
    background: var(--color-primary-700);
    color: white;
    text-decoration: none;
}

.cart-sidebar-full .btn-secondary {
    background: var(--color-neutral-200);
    color: var(--color-neutral-700);
}

.cart-sidebar-full .btn-secondary:hover {
    background: var(--color-neutral-300);
    color: var(--color-neutral-800);
    text-decoration: none;
}

/* Empty Cart */
.cart-sidebar-full .cart-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--color-neutral-600);
}

.cart-sidebar-full .cart-empty-icon {
    font-size: 2rem;
    color: var(--color-neutral-400);
    margin-bottom: 0.5rem;
}

.cart-sidebar-full .cart-empty p {
    margin: 0.5rem 0 1rem 0;
    font-size: 0.8rem;
}

/* Ensure sidebar appears when cart has items */
.cart-sidebar-full:not(:empty) {
    display: flex !important;
}

/* Hide sidebar when cart is empty - this will be controlled by JavaScript/template logic */
body.cart-empty .cart-sidebar-full {
    display: none !important;
}

/* Ensure no margin when cart is empty */
body.cart-empty .app-layout,
body.cart-empty footer {
    margin-right: 0 !important;
}

/* Show sidebar when cart has items */
body.cart-has-items .cart-sidebar-full {
    display: flex !important;
}

/* Mobile Responsive - Hide sidebar on mobile devices */
@media (max-width: 767px) {
    .cart-sidebar-full {
        display: none !important;
    }
    
    .app-layout {
        flex-direction: column !important;
    }
    
    .content-area {
        width: 100% !important;
        margin-right: 0 !important;
    }
}

/* Tablet - Hide sidebar on tablets */
@media (max-width: 1024px) and (min-width: 768px) {
    .cart-sidebar-full {
        width: 280px;
        min-width: 280px;
    }
}

/* Desktop - Show sidebar properly */
@media (min-width: 1025px) {
    .cart-sidebar-full.has-items {
        display: flex !important;
    }
}
