/* Modal Overlay (Invisible click-catcher) */
.gwt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent; /* Removed the black background */
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    
    /* Hardware accelerated animations */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gwt-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content Box (Glassmorphism Effect) */
.gwt-modal-content {
    background: linear-gradient(135deg, rgba(183, 110, 121, 0.5), rgba(224, 169, 109, 0.3)); /* Elegant dark glassmorphism to contrast the products */
    backdrop-filter: blur(11px);
    -webkit-backdrop-filter: blur(11px);
    width: 94%;
    max-width: 400px;
    border-radius: 20px;
    padding: 17px 12px;
	margin-bottom: 80px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); /* Stronger shadow for depth */
    border: 1px solid rgba(255, 255, 255, 0.15); /* Subtle rim light */
    
    /* Hardware accelerated pop-up animation */
    transform: translateY(100px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 50vh;
    overflow-y: auto; /* Restore scrolling to the entire box */
}

.gwt-modal-overlay.is-active .gwt-modal-content {
    transform: translateY(0) scale(1);
}

/* Close Button (X) */
.gwt-modal-close {
    position: sticky;
    top: 10px;
    float: right;
    margin-right: -5px;
    margin-top: -5px;
    background: rgba(0, 0, 0, 0.5); /* Solid backdrop so it doesn't get lost on scroll */
    backdrop-filter: blur(4px);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #ff4757; /* Highly visible red */
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 100;
    line-height: 1;
}

.gwt-modal-close:hover {
    color: #ff6b81;
    transform: scale(1.15);
}

/* Header */
.gwt-modal-header .gwt-modal-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    text-align: center;
    font-weight: 700;
    font-family: inherit;
    color: #ffffff; /* Crisp white text against the dark glass */
    letter-spacing: 0.5px;
}

/* CSS Grid Layout - Extremely Flat DOM */
.gwt-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 11px;
}

/* Individual Product Card */
.gwt-product-card {
    border: none;
    border-radius: 14px;
    padding: 11px 9px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff; /* Solid white completely hides Amazon image boundaries */
    box-shadow: 0 6px 16px rgba(0,0,0,0.15); /* Floats the card off the dark glass */
}
.gwt-product-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    transform: translateY(-4px); /* Micro-animation hover lift */
}

.gwt-product-link {
    text-decoration: none !important;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.gwt-product-link:hover {
    color: #000;
}

.gwt-product-image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.gwt-product-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gwt-product-name {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    margin-top: auto;
}

/* Desktop Overrides - Push to the left and top on large screens */
@media (min-width: 768px) {
    .gwt-modal-overlay {
        align-items: flex-start;     /* <--- Pushes it to the top */
        padding-top: 3vh;           /* <--- Breathing room from the top edge */
        justify-content: flex-start; /* <--- Aligns left */
        padding-left: 3vw;           /* <--- Breathing room from the left edge */
    }
    .gwt-modal-content {
        width: 90%;
        border-radius: 20px;
        max-height: 65vh;
        margin-bottom: 0px;
    }
}