/* Product Details Modal */
.product-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2500;
    display: none;
    /* Changed from flex to truly hide it */
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.product-modal-overlay.show {
    display: flex;
    /* Show as flex only when active */
    opacity: 1;
    visibility: visible;
}

.product-modal {
    background-color: white;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.product-modal-overlay.show .product-modal {
    transform: translateY(0);
}

.product-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    z-index: 10;
    line-height: 1;
}

.product-modal-image {
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 2rem;
}

.product-modal-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.product-modal-content {
    padding: 2rem;
    padding-left: 0;
    display: flex;
    flex-direction: column;
}

.product-modal-category {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.product-modal-title {
    font-size: 1.8rem;
    color: #1a1a1a;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.product-modal-price {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-modal-old-price {
    font-size: 1.1rem;
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}

.product-modal-description {
    color: #444;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.product-modal-meta {
    margin-bottom: 2rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.product-modal-meta-item {
    display: flex;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.product-modal-meta-label {
    font-weight: 600;
    width: 140px;
    color: #333;
}

.product-modal-meta-value {
    color: #666;
}

.product-modal-actions {
    margin-top: auto;
}

@media (max-width: 768px) {
    .product-modal {
        grid-template-columns: 1fr;
        max-height: 95vh;
    }

    .product-modal-image {
        min-height: 250px;
        padding: 1rem;
    }

    .product-modal-image img {
        max-height: 250px;
    }

    .product-modal-content {
        padding: 1.5rem;
    }
}