/* Quick View Overlay */
.woofoo-quick-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* High z-index to be on top of everything */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.woofoo-quick-view-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* Quick View Modal */
.woofoo-quick-view-modal {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 800px; /* Desktop max width */
    width: 90%; /* Responsive width */
    max-height: 90vh; /* Limit height to prevent overflow */
    overflow-y: auto; /* Enable scrolling for long content */
    position: relative;
    transform: scale(0.9); /* Initial state for animation */
    transition: transform 0.3s ease;
}

.woofoo-quick-view-overlay.active .woofoo-quick-view-modal {
    transform: scale(1); /* Animate in */
}

/* Close Button (Red Circle, White X) */
.woofoo-quick-view-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: #ea1f2e; /* Red circle */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10; /* Above modal content */
    border: none;
    padding: 0;
    transition: opacity 0.2s ease;
}

.woofoo-quick-view-close::before,
.woofoo-quick-view-close::after {
    content: '';
    position: absolute;
    width: 14px; /* Length of the X lines */
    height: 2px; /* Thickness of the X lines */
    background-color: #fff; /* White X */
}

.woofoo-quick-view-close::before {
    transform: rotate(45deg);
}

.woofoo-quick-view-close::after {
    transform: rotate(-45deg);
}

.woofoo-quick-view-close:hover {
    opacity: 0.8;
}

/* Mobile Full Screen */
@media (max-width: 767px) {
    .woofoo-quick-view-modal {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        padding: 15px; /* Adjust padding for mobile */
    }
    .woofoo-quick-view-close {
        top: 15px;
        right: 15px;
    }
}

/* Prevent body scrolling when quick view is open */
body.woofoo-quick-view-open {
    overflow: hidden !important;
}

/* Ensure WooCommerce styles apply correctly within the modal */
/* These are general adjustments; specific themes/plugins might need more fine-tuning */
.woofoo-quick-view-modal .product {
    margin-bottom: 0; /* Remove default product margin */
    display: flex; /* Use flexbox for better layout control */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}
.woofoo-quick-view-modal .woocommerce-product-gallery {
    margin-bottom: 20px;
    width: 100%; /* Default to full width on small screens */
}
.woofoo-quick-view-modal .summary.entry-summary {
    padding-left: 0; /* Adjust summary padding if needed */
    width: 100%; /* Default to full width on small screens */
}

/* Desktop layout for product images and summary */
@media (min-width: 768px) {
    .woofoo-quick-view-modal .product .images {
        width: 48%; /* Adjust as needed for desktop layout */
        float: left; /* Keep float for compatibility with WC's default styles */
        margin-right: 4%;
    }
    .woofoo-quick-view-modal .product .summary {
        width: 48%; /* Adjust as needed for desktop layout */
        float: right; /* Keep float for compatibility with WC's default styles */
    }
}

/* General adjustments for product content within the modal */
.woofoo-quick-view-modal .product_title {
    margin-top: 0;
}
.woofoo-quick-view-modal .price {
    margin-bottom: 1em;
}
.woofoo-quick-view-modal .woocommerce-product-details__short-description {
    margin-bottom: 1em;
}
.woofoo-quick-view-modal .variations_form {
    margin-bottom: 1em;
}
.woofoo-quick-view-modal .single_add_to_cart_button {
    width: 100%; /* Make add to cart button full width */
    text-align: center;
}
