/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    background-color: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% - 50px));
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ffd700;
}

.modal-body {
    padding: 2rem;
}

.modal-product-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.modal-gallery {
    position: relative;
}

.modal-main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    background: #f8f9fa;
}


.modal-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.5rem;
}

.modal-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.modal-thumbnail:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

.modal-thumbnail.active {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
}

.modal-product-info h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.8rem;
}

.modal-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0056b3;
    margin: 1rem 0;
}

.modal-description {
    margin: 1rem 0;
    line-height: 1.6;
    color: #666;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-btn-primary {
    background: #004085;
    color: white;
}

.modal-btn-primary:hover {
    background: #003366;
    transform: translateY(-2px);
}

.modal-btn-secondary {
    background: #6c757d;
    color: white;
}

.modal-btn-secondary:hover {
    background: #545b62;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-product-content {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .modal-main-image {
        height: 150px;
    }
    
    .modal-header {
        padding: 0.5rem 0.75rem;
    }
    
    .modal-header h2 {
        font-size: 1rem;
    }
    
    .close {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 0.5rem;
    }
    
    .modal-product-info h3 {
        font-size: 1.1rem;
        margin-bottom: 0.375rem;
    }
    
    .modal-price {
        font-size: 1rem;
        margin: 0.375rem 0;
    }
    
    .modal-description {
        font-size: 0.85rem;
        margin: 0.375rem 0;
        line-height: 1.5;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .modal-btn {
        width: 100%;
        justify-content: center;
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .modal-thumbnails {
        grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
        gap: 0.375rem;
    }
    
    .modal-thumbnail {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-header {
        border-radius: 0;
        padding: 0.5rem 0.75rem;
    }
    
    .modal-header h2 {
        font-size: 0.95rem;
    }
    
    .close {
        font-size: 1.375rem;
    }
    
    .modal-body {
        padding: 0.5rem;
    }
    
    .modal-main-image {
        height: 150px;
    }
    
    .modal-product-info h3 {
        font-size: 1.05rem;
        margin-bottom: 0.375rem;
    }
    
    .modal-price {
        font-size: 0.95rem;
        margin: 0.375rem 0;
    }
    
    .modal-description {
        font-size: 0.8rem;
        margin: 0.375rem 0;
        line-height: 1.5;
    }
    
    .modal-actions {
        gap: 0.375rem;
        margin-top: 0.625rem;
    }
    
    .modal-btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .modal-thumbnails {
        grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
        gap: 0.5rem;
    }
    
    .modal-thumbnail {
        width: 30px;
        height: 30px;
    }
}
