:root { --vh: 1vh; }

.fes-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.fes-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.fes-popup-content {
    background: #0f172a;
    width: 95%;
    max-width: 1000px;
    height: 89vh;
    padding: 20px 15px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    /* overflow: visible to allow circle button to overlap */
}



.fes-popup-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 50px !important;
    height: 50px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #d40606;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 20px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    z-index: 100;
    transition: all 0.2s;
    text-transform: none !important;
}

.fes-rec-title {
    color: #fff;
    text-align: center;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 35px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fes-rec-products {
    flex: 1;
    width: 100%;
    margin: 0 auto;
    padding-top: 5px;
    transform: scale(0.72);
    transform-origin: top center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* COMPACT PRODUCT CARDS */
.fes-rec-products .product-category {
    display: none !important;
}

.fes-rec-products .name {
    font-size: 0.9em !important;
    line-height: 1.2 !important;
    margin-bottom: 3px !important;
    overflow: hidden;
}

.fes-rec-products .price {
    font-size: 0.95em !important;
    margin-bottom: 5px !important;
}

.fes-rec-products .add_to_cart_button {
    padding: 3px 10px !important;
    font-size: 0.85em !important;
    min-height: 30px !important;
}

.fes-rec-products .box-text {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

.fes-rec-products .products {
    margin-bottom: 0;
    width: 100%;
}


.box-text {
    font-size: 19px;
}


/* @media (max-width: 834px) {
     .fes-popup-content {
    height: 66vh;
}
.fes-rec-title {
    margin-top: 10px;
}

}

@media (max-width: 390px) {
    .fes-popup-content {
        height: 79vh;
        padding: 15px 10px;
    }

    .fes-rec-products {
        transform: scale(0.95);
        padding-top: 10px;
    }

    .fes-rec-title {
        font-size: 16px;
        margin-bottom: 0;
    }
    

    .fes-rec-products .products li.product {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }

    .fes-popup-close {
    right: -1px;
    }
    .fes-rec-products .product-small.box .add-to-cart-button a {
    font-size: 10px !important;
}
.fes-popup-content {
    flex-direction: column;
    align-items: center;
}

.fes-popup-close {
    top: -1px;
    width: 37px !important;
    height: 37px !important;
}
} 
 
@media (max-width: 400px) {
.fes-popup-content {
}

.fes-rec-products .product-small.box .add-to-cart-button a {
    font-size: 10px !important;
}
} */


@media (max-width: 849px){
  .fes-popup-content{
    height: 96vh;    /* fallback */
    height: 96svh;   /* iOS an toàn */
    height: 70dvh;   /* viewport động */
    overflow: hidden;
  }
}

@media (max-width: 360px){
  .fes-popup-close{ top: 0; right: 0; }
}


@media (max-width: 430px){
  .fes-popup-content {
    height: 80dvh !important;
}

}