/* Quick View Modal Styles */

/* Product Card Click Effect */
.product-card {
    transition: all 0.3s ease !important;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 40px rgba(255, 167, 38, 0.2) !important;
}

.product-card:active {
    transform: translateY(-2px) !important;
}

/* Quick View Indicator */
.quick-view-indicator {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(255, 167, 38, 0.9);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 5;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.product-card:hover .quick-view-indicator {
    opacity: 1;
    transform: scale(1);
}

.quick-view-indicator:hover {
    background: rgba(255, 167, 38, 1);
    transform: scale(1.1);
}

.quick-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-view-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: var(--bg-card, #1a1a1a);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8) translateY(30px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid var(--border-color, #333);
    opacity: 0;
}

.quick-view-modal.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
    transition-delay: 0.1s;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: var(--text-primary, #fff);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 10001;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

/* Loading and Error States */
.modal-loading,
.modal-error,
.modal-content-wrapper {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem;
    color: var(--text-primary, #fff);
    transition: all 0.3s ease;
    transform: translateY(0);
    opacity: 1;
}

.modal-content-wrapper {
    display: block;
    text-align: left;
    padding: 0;
}

.modal-loading .loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 167, 38, 0.3);
    border-top: 4px solid var(--accent-primary, #ffa726);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.modal-loading p {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.8;
}

.modal-error i {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.btn-close-error {
    background: var(--accent-primary, #ffa726);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.btn-close-error:hover {
    background: var(--accent-secondary, #ff8e53);
    transform: translateY(-2px);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Image Section */
.modal-image-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-image {
    width: 100%;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    background: var(--bg-tertiary, #222);
    border: 2px solid var(--border-color, #333);
    position: relative;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-image:hover img {
    transform: scale(1.05);
}

.image-thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.thumbnail.active,
.thumbnail:hover {
    border-color: var(--accent-primary, #ffa726);
    transform: scale(1.05);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info Section */
.modal-product-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-category-modal {
    background: rgba(255, 167, 38, 0.1);
    color: var(--accent-primary, #ffa726);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: flex-start;
    border: 1px solid rgba(255, 167, 38, 0.3);
}

.product-title-modal {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary, #fff);
    line-height: 1.3;
    margin: 0;
}

.product-rating-modal {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stars {
    display: flex;
    gap: 0.2rem;
    color: var(--accent-primary, #ffa726);
}

.rating-text {
    color: var(--text-secondary, #bbb);
    font-size: 0.9rem;
}

.product-price-modal {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid var(--border-color, #333);
}

.current-price-modal {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 50%, #ffa726 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.current-price-modal::after {
    content: 'د.ع';
    color: var(--text-secondary, #bbb);
    font-size: 1rem;
    margin-right: 0.5rem;
    -webkit-text-fill-color: var(--text-secondary, #bbb);
}

.original-price-modal {
    font-size: 1.2rem;
    color: var(--text-muted, #888);
    text-decoration: line-through;
}

.product-description-modal {
    color: var(--text-secondary, #bbb);
    line-height: 1.6;
    font-size: 1rem;
}

.product-details-modal {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--border-color, #333);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.detail-value {
    color: var(--text-secondary, #bbb);
}

.quantity-selector {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.quantity-selector label {
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls button {
    background: var(--bg-tertiary, #333);
    border: 1px solid var(--border-color, #444);
    color: var(--text-primary, #fff);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.quantity-controls button:hover {
    background: var(--accent-primary, #ffa726);
    border-color: var(--accent-primary, #ffa726);
    transform: scale(1.05);
}

.quantity-controls input {
    width: 80px;
    height: 40px;
    text-align: center;
    background: var(--bg-tertiary, #333);
    border: 1px solid var(--border-color, #444);
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 1rem;
    font-weight: 600;
}

.quantity-controls input:focus {
    outline: none;
    border-color: var(--accent-primary, #ffa726);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-actions button {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-add-to-cart-modal {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 50%, #ffa726 100%);
    color: white;
}

.btn-add-to-cart-modal:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 167, 38, 0.4);
}

.btn-wishlist-modal {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
    border: 1px solid var(--border-color, #333);
}

.btn-wishlist-modal:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.btn-share-modal {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
    border: 1px solid var(--border-color, #333);
}

.btn-share-modal:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        transform: scale(0.9) translateY(20px);
    }
    
    .quick-view-modal.active .modal-content {
        transform: scale(1) translateY(0);
        transition: all 0.3s ease;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .main-image {
        height: 300px;
    }
    
    .product-title-modal {
        font-size: 1.5rem;
    }
    
    .current-price-modal {
        font-size: 1.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        max-height: 98vh;
        border-radius: 15px;
        transform: scale(0.95) translateY(15px);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .main-image {
        height: 250px;
    }
    
    .product-title-modal {
        font-size: 1.3rem;
    }
    
    /* Disable complex animations on small screens for better performance */
    .quick-view-modal.active .modal-content {
        transition: all 0.25s ease;
    }
}

/* Animation for modal opening */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.quick-view-modal.active .modal-content {
    animation: modalFadeIn 0.3s ease;
}

/* Scrollbar Styling */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary, #333);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-primary, #ffa726);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary, #ff8e53);
}
