/* ===== SHOPPING CART COMPONENT ===== */

/* Cart Container */
.cart-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

/* Cart Toggle Button */
.cart-toggle {
    position: relative;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.cart-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1a202c;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Cart Dropdown */
.cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    max-height: 500px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.cart-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Cart Header */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.close-cart {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-cart:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Cart Items */
.cart-items {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
}

.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-cart p {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #475569;
}

.empty-cart span {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Cart Item */
.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: #f8fafc;
    transition: all 0.3s ease;
}

.cart-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.cart-item-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 1rem;
    border: 2px solid #e2e8f0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-category {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    background: #f1f5f9;
    border: 1px solid #d1d5db;
    color: #374151;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-display {
    font-weight: 600;
    color: #1e293b;
    min-width: 20px;
    text-align: center;
}

.remove-item {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.remove-item:hover {
    background: #fecaca;
    border-color: #f87171;
}

/* Cart Footer */
.cart-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.cart-total {
    font-size: 0.9rem;
    color: #475569;
}

.cart-total strong {
    color: #1e293b;
    font-weight: 700;
}

/* Get Quote Button */
#get-quote-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

#get-quote-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#get-quote-btn:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Dark Mode Styles */
body.dark-mode .cart-toggle {
    color: #f1f5f9;
}

body.dark-mode .cart-toggle:hover {
    background: rgba(241, 245, 249, 0.1);
}

body.dark-mode .cart-badge {
    border-color: #0f172a;
}

body.dark-mode .cart-dropdown {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .cart-header {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    border-bottom-color: #334155;
}

body.dark-mode .cart-item {
    background: #334155;
    border-color: #475569;
}

body.dark-mode .cart-item:hover {
    border-color: #60a5fa;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

body.dark-mode .cart-item-name {
    color: #f1f5f9;
}

body.dark-mode .cart-item-category {
    color: #94a3b8;
}

body.dark-mode .quantity-btn {
    background: #475569;
    border-color: #64748b;
    color: #e2e8f0;
}

body.dark-mode .quantity-btn:hover {
    background: #64748b;
    border-color: #94a3b8;
}

body.dark-mode .quantity-display {
    color: #f1f5f9;
}

body.dark-mode .remove-item {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fecaca;
}

body.dark-mode .remove-item:hover {
    background: #991b1b;
    border-color: #b91c1c;
}

body.dark-mode .cart-footer {
    background: #334155;
    border-top-color: #475569;
}

body.dark-mode .cart-summary {
    background: #475569;
    border-color: #64748b;
}

body.dark-mode .cart-total {
    color: #cbd5e1;
}

body.dark-mode .cart-total strong {
    color: #f1f5f9;
}

body.dark-mode #get-quote-btn {
    background: #1e40af;
}

body.dark-mode #get-quote-btn:hover:not(:disabled) {
    background: #1e3a8a;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
}

body.dark-mode #get-quote-btn:disabled {
    background: #475569;
    color: #64748b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-dropdown {
        width: 320px;
        right: -50px;
    }
    
    .cart-dropdown::before {
        content: '';
        position: absolute;
        top: -8px;
        right: 60px;
        width: 0;
        height: 0;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 8px solid #ffffff;
    }
    
    body.dark-mode .cart-dropdown::before {
        border-bottom-color: #1e293b;
    }
}

@media (max-width: 480px) {
    .cart-dropdown {
        width: 280px;
        right: -80px;
    }
    
    .cart-dropdown::before {
        right: 80px;
    }
    
    .cart-item {
        padding: 0.75rem;
    }
    
    .cart-item-image {
        width: 40px;
        height: 40px;
    }
    
    .cart-header h3 {
        font-size: 1rem;
    }
}

/* ===== QUOTE REQUEST MODAL ===== */

/* Quote Modal */
.quote-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quote-modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.quote-modal.active .quote-modal-content {
    transform: scale(1);
}

/* Quote Modal Header */
.quote-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    border-radius: 12px 12px 0 0;
}

.quote-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Quote Modal Body */
.quote-modal-body {
    padding: 1.5rem;
}

.quote-summary {
    margin-bottom: 2rem;
}

.quote-summary h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 600;
}

.quote-items {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #f8fafc;
}

.quote-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.5rem;
}

.quote-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.quote-item-image {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 1rem;
    border: 2px solid #e2e8f0;
}

.quote-item-details {
    flex: 1;
}

.quote-item-name {
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
}

.quote-item-category {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quote-item-quantity {
    font-size: 0.8rem;
    color: #3b82f6;
    font-weight: 600;
}

/* Quote Form */
.quote-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group:nth-child(4),
.form-group:nth-child(5),
.form-group:nth-child(6) {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Quote Modal Footer */
.quote-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* Dark Mode Quote Modal */
body.dark-mode .quote-modal-content {
    background: #1e293b;
    border: 1px solid #334155;
}

body.dark-mode .quote-modal-header {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
}

body.dark-mode .quote-summary h3 {
    color: #f1f5f9;
}

body.dark-mode .quote-items {
    background: #334155;
    border-color: #475569;
}

body.dark-mode .quote-item {
    border-bottom-color: #475569;
}

body.dark-mode .quote-item-name {
    color: #f1f5f9;
}

body.dark-mode .quote-item-category {
    color: #94a3b8;
}

body.dark-mode .form-group label {
    color: #e2e8f0;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

body.dark-mode .quote-modal-footer {
    background: #334155;
    border-top-color: #475569;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-weight: 500;
    max-width: 300px;
}

.cart-notification.show {
    transform: translateX(0);
}

/* Dark Mode Cart Notification */
body.dark-mode .cart-notification {
    background: #059669;
    color: #f1f5f9;
}

/* Responsive Quote Modal */
@media (max-width: 768px) {
    .quote-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .quote-form {
        grid-template-columns: 1fr;
    }
    
    .form-group:nth-child(4),
    .form-group:nth-child(5),
    .form-group:nth-child(6) {
        grid-column: 1;
    }
    
    .quote-modal-footer {
        flex-direction: column;
    }
    
    .quote-modal-footer .btn {
        width: 100%;
    }
    
    .cart-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
