/* Binh View On Wall - Styling */

#binh-vow-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #fff;
    z-index: 99999; /* Just below the main container */
    display: none;
}

#binh-vow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Full viewport height */
    background-color: #fff; /* Solid white background */
    z-index: 100000;
    display: none; /* Hidden by default */
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

#binh-vow-main-image-wrapper {
    position: relative;
    width: 60%;
    flex-grow: 1; /* Allow this to grow and fill available space */
    max-width: 1200px; /* Optional: constrain max width on very wide screens */
    margin: 0 auto; /* Center it */
    overflow: hidden;
    display: flex; /* Use flex to center the image */
    align-items: center;
    justify-content: center;
    min-height: 0; /* Important for flex-grow in a flex column */
}

#binh-vow-background {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Contain ensures the whole image is visible */
    display: block;
}

#binh-vow-artwork {
    position: absolute;
    top: 30%; /* Position artwork center 30% from the top */
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    max-width: 100%; /* Ensure it doesn't overflow its container */
    max-height: 100%;
}

/* New Bottom Controls Layout */
#binh-vow-bottom-controls-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1000px;
    width: 100%;
    margin: 15px auto 0 auto;
    padding: 10px;
    background-color: #f5f5f5;
    flex-shrink: 0; /* Prevent controls from shrinking */
}

#binh-vow-bottom-left-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%; /* Make it take full width */
    align-items: center; /* Center its content (color panel) */
}

#binh-vow-room-thumbnails-wrapper {
    width: 100%; /* Ensure it takes full width to center its content */
    margin-top: 10px; /* Add some space between color panel and thumbnails */
}

#binh-vow-room-thumbnails {
    display: flex;
    flex-wrap: nowrap; /* Force single line */
    overflow-x: auto;  /* Add horizontal scroll on overflow */
    gap: 10px;
    padding-bottom: 10px; /* Make space for scrollbar */
    -webkit-overflow-scrolling: touch; /* Smooth scroll for iOS */
    scrollbar-width: thin; /* Slim scrollbar for Firefox */
    scrollbar-color: #999 #f0f0f0; /* Scrollbar colors for Firefox */
    justify-content: flex-start; /* Align thumbnails to the left */
}

/* Style for Webkit browser scrollbars (Chrome, Safari) */
#binh-vow-room-thumbnails::-webkit-scrollbar {
    height: 8px;
}

#binh-vow-room-thumbnails::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

#binh-vow-room-thumbnails::-webkit-scrollbar-thumb {
    background: #999;
    border-radius: 4px;
}

#binh-vow-room-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.binh-vow-color-swatch {
    width: 40px;
    height: 25px;
    border: 1px solid #ccc;
    cursor: pointer;
}

.binh-vow-color-swatch.active {
    border: 2px solid #000;
}

.binh-vow-room-thumb {
    width: 80px;
    height: 60px;
    cursor: pointer;
    border: 2px solid transparent;
    object-fit: cover;
}

.binh-vow-room-thumb.active {
    border-color: #0073aa;
}

/* --- Button Styles --- */
#binh-vow-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 35px;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    z-index: 100001; /* Ensure it's above other content */
}

#binh-vow-trigger-btn, #binh-zoom-trigger-btn, #binh-vow-back-to-artwork-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2c3e50; /* Dark background */
    color: #fff; /* White text */
    border: none;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    transition: background-color 0.2s ease-in-out;
}

#binh-vow-trigger-btn:hover, #binh-vow-back-to-artwork-btn:hover {
    background-color: #34495e;
}

.binh-vow-buttons-wrapper {
    display: flex;
    gap: 10px; /* Space between buttons */
    margin-top: 20px;
    justify-content: flex-start; /* Align buttons to the left */
    align-items: center; /* Ensure vertical alignment */
    width: 100%; /* Ensure wrapper takes full width */
}

#binh-vow-trigger-btn, #binh-zoom-trigger-btn {
    flex: 1; /* Allow buttons to grow and shrink */
    max-width: 200px; /* Optional: limit max width of each button */
}

#binh-vow-back-to-artwork-btn {
    width: fit-content;
    margin-top: 10px; /* Add space above the button */
    align-self: flex-start; /* Align to the left */
}

/* Hide specific product page elements when VOW is active */
body.vow-active {
    overflow: hidden; /* Prevent scrolling of the main page */
}

body.vow-active .summary .woocommerce-product-details__short-description,
body.vow-active .product_meta,
body.vow-active .woocommerce-tabs,
body.vow-active #reviews,
body.vow-active .product-main {
    display: none !important;
}

/* Hide contact buttons when VOW is active */
body.vow-active .binh-contact-buttons {
    display: none !important;
}

/* --- Responsive Styles for Mobile --- */
@media (max-width: 768px) {
    #binh-vow-main-image-wrapper {
        width: 100%;

    }
    .product_title {
        margin-top: 30px;
    }

    #binh-vow-close-btn {
        right: -50px;
    }

    #binh-vow-container {
        padding: 10px;
        height: 50vh; /* Set height to 50% of viewport height on mobile */
    }

    #binh-vow-bottom-controls-wrapper {
        flex-direction: column;
        gap: 10px; /* Reduce gap for mobile */
        padding: 5px;
    }

    #binh-vow-back-to-artwork-btn {
       display: none; /* Hide the old back button */
    }

    #binh-vow-room-thumbnails {
       padding-bottom: 5px;
    }

    .binh-vow-room-thumb {
        width: 70px;
        height: 50px;
    }
}

/* --- Custom Product Summary Styling --- */
.binh-product-summary {
    /* Add any overall styling for the summary if needed */
}

.product-meta-custom {
    font-size: 15px;
    color: #666;
    margin-bottom: 15px;
}

.product-meta-custom .posted_in {
    display: block; /* Ensure it takes full width */
    margin-top: 10px;
}

.product-attributes-custom {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 20px;
}

.product-attributes-custom p {
    margin: 0 0 8px 0;
    font-size: 15px;
    line-height: 1.4;
}

.product-attributes-custom p:last-child {
    margin-bottom: 0;
}

.product-attributes-custom strong {
    font-weight: bold;
    margin-right: 5px;
}

.product-attributes-custom .attr-item strong,
.product-attributes-custom .attr-item span {
    text-transform: capitalize !important;
}

/* Main Contact Button */
.binh-contact-button-main {
    display: block;
    width: 100%;
    padding: 12px 20px; /* Reduced vertical padding */
    background-color: #ff6600; /* Orange color */
    color: #fff;
    text-align: left; /* Changed to left-align */
    font-size: 17px; /* Slightly reduced font size */
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 15px;
}

.binh-contact-button-main:hover {
    background-color: #e65c00; /* Darker orange on hover */
}

/* Chat Buttons */
.product-chat-buttons {
    display: flex;
    gap: 10px; /* Space between buttons */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.binh-chat-button {
    flex: 1; /* Allow buttons to grow and shrink */
    min-width: 150px; /* Minimum width for buttons */
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    color: #fff;
    transition: background-color 0.3s ease;
}

.binh-chat-button.binh-zalo-button-product {
    background-color: #008cff; /* Zalo blue */
}

.binh-chat-button.binh-zalo-button-product:hover {
    background-color: #007acc;
}

.binh-chat-button.binh-messenger-button-product {
    background-color: #0078ff; /* Messenger blue */
}

.binh-chat-button.binh-messenger-button-product:hover {
    background-color: #0066cc;
}

.binh-chat-button .chat-button-icon {
    margin-right: 10px;
    display: flex;
    align-items: center;
}

.binh-chat-button .chat-button-icon img {
    width: 30px; /* Icon size */
    height: 30px;
    display: block;
}

.binh-chat-button .chat-button-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.binh-chat-button .chat-button-text span {
    font-size: 15px; /* Reduced font size */
    font-weight: bold;
}

.binh-chat-button .chat-button-text small {
    font-size: 11px; /* Reduced font size */
    opacity: 0.9;
}


/* Responsive adjustments for chat buttons */
@media (min-width: 769px) {
    .binh-contact-button-main {
        text-align: center; /* Center text on PC */
    }
}

@media (max-width: 480px) {
    .product-chat-buttons {
        flex-direction: column; /* Stack buttons vertically on very small screens */
    }
    .binh-chat-button {
        width: 100%;
        min-width: unset;
        /* Removed justify-content: center; to allow left-align */
    }
    .binh-chat-button .chat-button-text {
        /* Removed align-items: center; to allow text to left-align */
    }
}
