/* Shopping Cart Styles */

/* Cart Icon */
.cart-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
}

.cart-icon:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cart-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: fill 0.3s ease;
}

/* Cart Count Badge */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    padding: 0 6px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Cart Dropdown */
.cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    max-width: 90vw;
    max-height: 80vh;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.cart-dropdown-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.cart-items {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.cart-item {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: white;
    transition: background-color 0.2s ease;
}

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

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

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    padding: 0.25rem;
    position: relative;
    overflow: hidden;
}

.cart-item-image:before {
    content: '🛒';
    font-size: 1.5rem;
    opacity: 0.5;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.cart-item-image img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-name {
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
}

.cart-item-options {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.3;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 2px solid var(--primary-color);
}

.cart-item-option-line {
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

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

.cart-item-option-label {
    font-weight: 600;
    color: #495057;
    min-width: 60px;
    font-size: 0.7rem;
}

.cart-item-option-value {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.7rem;
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
    margin-top: 0.25rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #dee2e6;
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.quantity-display {
    min-width: 26px;
    text-align: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--primary-color);
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.remove-item {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #e53e3e;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.remove-item:hover {
    background: #fed7d7;
    border-color: #e53e3e;
}

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

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: stretch;
    margin-top: 1rem;
}

.cart-btn {
    padding: 0.6rem 0.8rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 36px;
}

.cart-btn-secondary {
    background: #f8f9fa;
    color: var(--primary-color);
    border: 1px solid #dee2e6;
}

.cart-btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.cart-btn-primary {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.cart-btn-primary:hover {
    background: #333;
    transform: translateY(-1px);
}

.cart-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #666;
}

.cart-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.cart-empty-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.cart-empty-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.cart-empty-link:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cart-dropdown {
        width: 300px;
        right: -10px;
        max-height: 70vh;
    }
    
    .cart-item {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
    }
    
    .cart-item-options {
        font-size: 0.7rem;
        padding: 0.4rem;
    }
    
    .cart-item-option-label,
    .cart-item-option-value {
        font-size: 0.65rem;
    }
    
    .cart-actions {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .cart-btn {
        padding: 0.6rem;
        font-size: 0.75rem;
        min-height: 32px;
    }
    
    .cart-footer {
        padding: 0.75rem;
    }
    
    .cart-total {
        font-size: 1rem;
        padding: 0.5rem;
    }
}

/* Ensure cursor visibility over cart dropdown */
.cart-dropdown ~ .custom-cursor {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Cart icon positioning in header */
.header .cart-icon {
    margin-left: 1rem;
}

/* Mobile cart icon visibility */
@media (max-width: 768px) {
    .header .cart-icon {
        margin-left: 0.5rem;
    }
}
