/* shopping.css - Complete Shopping Cart & E-commerce Styles */

/* ================================ */
/* CART ICON IN HEADER */
/* ================================ */

/* Force cart icon styling with maximum specificity */
button#cartIcon.header-icon.cart-icon {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: #2c3e50 !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 50px !important;
    min-height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
}

button#cartIcon.header-icon.cart-icon:hover {
    background: #1a252f !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25) !important;
}

/* Cart count badge */
button#cartIcon .cart-count {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    background: #e74c3c !important;
    color: white !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    z-index: 1 !important;
}

/* ================================ */
/* CART SIDEBAR/DRAWER */
/* ================================ */

/* Cart overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Cart sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px; /* Start off-screen */
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    z-index: 10000;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-sidebar.open {
    right: 0;
}

/* Cart header */
.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    flex-shrink: 0;
}

.cart-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cart-close:hover {
    background: #e9ecef;
    color: #2c3e50;
}

/* Cart content area */
.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Empty cart state */
.cart-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6c757d;
}

.cart-empty h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.cart-empty p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Cart items */
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background 0.2s ease;
}

.cart-item:hover {
    background: #f8f9fa;
}

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

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: #f8f9fa;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0; /* Allow text to wrap */
}

.cart-item-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    line-height: 1.3;
}

.cart-item-size {
    font-size: 0.85rem;
    color: #6c757d;
}

.cart-item-price {
    font-weight: 700;
    color: #27ae60;
    font-size: 1rem;
}

/* Quantity controls */
.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.cart-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s ease;
}

.cart-qty-btn:hover {
    border-color: #2c3e50;
    color: #2c3e50;
    background: #f8f9fa;
}

.cart-qty-input {
    width: 45px;
    height: 28px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    background: white;
}

.cart-qty-input:focus {
    outline: none;
    border-color: #2c3e50;
}

.cart-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.cart-remove:hover {
    background: #f8d7da;
    color: #a71e2a;
}

/* Cart footer */
.cart-footer {
    border-top: 1px solid #e9ecef;
    padding: 1.5rem;
    background: #f8f9fa;
    flex-shrink: 0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.cart-total-label {
    color: #495057;
}

.cart-total-amount {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 700;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39,174,96,0.3);
}

.checkout-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ================================ */
/* LIGHTBOX SHOPPING SECTION */
/* ================================ */

/* Shopping section in lightbox info panel */
.shopping-section {
    border-top: 2px solid #e9ecef;
    margin-top: 2rem;
    padding-top: 2rem;
    background: #f8f9fa;
    margin-left: -2rem;
    margin-right: -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    margin-bottom: -2rem;
    padding-bottom: 2rem;
}

.shopping-section h4 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shopping-section h4::before {
    content: "🛒";
    font-size: 1.2rem;
}

/* Size selection */
.size-selection {
    margin-bottom: 1.5rem;
}

.size-label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.size-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.size-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.size-option:hover {
    border-color: #2c3e50;
    box-shadow: 0 2px 8px rgba(44,62,80,0.1);
}

.size-option.selected {
    border-color: #2c3e50;
    background: #f8f9fa;
    box-shadow: 0 0 0 1px #2c3e50;
}

.size-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.size-dimensions {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.size-description {
    font-size: 0.8rem;
    color: #6c757d;
}

.size-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

.price-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #27ae60;
}

.price-loading {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

/* Add to cart section */
.add-to-cart-section {
    margin-top: 1.5rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.quantity-selector label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.quantity-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quantity-input {
    width: 50px;
    height: 36px;
    border: none;
    text-align: center;
    font-weight: 600;
    background: none;
    color: #2c3e50;
}

.quantity-input:focus {
    outline: none;
    background: #f8f9fa;
}

/* Add to cart button */
.add-to-cart-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44,62,80,0.3);
}

.add-to-cart-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.add-to-cart-btn::before {
    content: "🛒";
    font-size: 1.1rem;
}

/* Shopping success message */
.shopping-message {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

.shopping-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.shopping-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ================================ */
/* RESPONSIVE DESIGN */
/* ================================ */

/* Mobile adjustments */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-sidebar.open {
        right: 0;
    }
    
    .cart-header {
        padding: 1rem;
    }
    
    .cart-title {
        font-size: 1.2rem;
    }
    
    .cart-item {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
        align-self: flex-start;
    }
    
    .cart-item-quantity {
        justify-content: space-between;
    }
    
    .shopping-section {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .size-options {
        gap: 0.6rem;
    }
    
    .size-option {
        padding: 0.8rem;
    }
    
    .quantity-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Animation for adding items to cart */
@keyframes addToCart {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.add-to-cart-btn.adding {
    animation: addToCart 0.3s ease;
}

/* Loading state for prices */
.price-loading::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #6c757d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}