/* =========================
   MODAL BASE
   ========================= */

.product-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* =========================
   MAIN BOX
   ========================= */

   .product-modal-box {
       display: flex;
       max-width: 1000px;
       width: 100%;

       height: min(70vh, 650px);
       max-height: calc(100vh - 40px); /* never exceeds the viewport, any screen size */

       background: rgba(255,255,255,0.08);
       backdrop-filter: blur(12px);
       -webkit-backdrop-filter: blur(12px);

       border-radius: 15px;
       overflow: hidden;
       position: relative;

       box-shadow: 0 20px 60px rgba(0,0,0,0.4);
   }

/* =========================
   CLOSE BUTTON
   ========================= */

.product-close {
    position: absolute;
    top: 14px;
    right: 14px;

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
    font-weight: 600;

    color: #fff;
    background: linear-gradient(135deg, #6c757d, #212529);

    border-radius: 50%;
    cursor: pointer;

    box-shadow: 0 12px 30px rgba(0,0,0,0.45);
    transition: all 0.3s ease;
    z-index: 20;
}

.product-close:hover {
    transform: scale(1.12) rotate(90deg);
    background: linear-gradient(135deg, #212529, #6c757d);
}

/* =========================
   SLIDER
   ========================= */

.product-slider {
    position: relative;
    width: 50%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: #000;
}

.slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;

    opacity: 0;
    transform: scale(0.98);

    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide.active {
    opacity: 1;
    transform: scale(1);
}

/* =========================
   TEXT AREA
   ========================= */


.product-content {
    width: 50%;
    padding: 40px;
    overflow-y: auto;
    min-height: 0;
    color: #222;
    font-family: "Work Sans", sans-serif;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    will-change: height;
}

/* SCROLLBAR */
.product-content::-webkit-scrollbar {
    width: 8px;
}

.product-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #5a6b7a, #2f3b46);
    border-radius: 10px;
}

/* TITLE */
#productTitle {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;

    background: linear-gradient(90deg, #ffffff, #d7d7d7, #f2f2f2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    font-family: "Josefin Sans", sans-serif;
}

/* DESCRIPTION */
#productDesc {
    font-size: 14px; /* improved readability */
    line-height: 1.9;
    color: rgba(255,255,255,0.85);
}

/* =========================
   MOBILE (POLISHED)
   ========================= */

@media (max-width: 768px) {

    .product-modal-box {
        flex-direction: column;
        height: 90vh;
    }

    .product-slider {
        width: 100%;
        height: 100%;
    }
    .product-slider,
    .product-content {
        height: 100%;
    }
    .slide {
        object-fit: cover;
    }

    /* TEXT OVERLAY */
    .product-content {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;

        height: 42%;

        padding: 20px 18px 30px;

        background: linear-gradient(
            to top,
            rgba(20,25,35,0.98) 0%,
            rgba(20,25,35,0.9) 60%,
            rgba(20,25,35,0.0) 100%
        );

        backdrop-filter: blur(10px);

        overflow-y: auto;

        -webkit-overflow-scrolling: touch;

        transition: height 0.35s ease;
    }

    /* SMOOTH EXPANSION (NOT AGGRESSIVE) */
    .product-content.scrolling {
        height: 58%;
    }

    #productTitle {
        font-size: 20px;
    }

    #productDesc {
        font-size: 14.5px;
        line-height: 1.75;
    }
}
