/* =====================================================
   ISHT AI Jewellery Try-On
   STYLE.CSS
===================================================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, Helvetica, sans-serif;
}

body{

    background:#f5f5f5;

    color:#222;

}

/* =========================
          HEADER
========================= */

header{

    height:80px;

    background:#111;

    color:white;

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:0 40px;

    position:sticky;

    top:0;

    z-index:1000;

}

.logo{

    font-size:32px;

    font-weight:bold;

    letter-spacing:2px;

}

.search-bar{

    width:380px;

}

.search-bar input{

    width:100%;

    padding:12px 18px;

    border-radius:30px;

    border:none;

    outline:none;

    font-size:16px;

}

/* =========================
      MAIN CONTAINER
========================= */

.main-container{

    display:grid;

    grid-template-columns:2fr 420px;

    gap:30px;

    width:95%;

    margin:30px auto;

    align-items:start;

}

/* =========================
        LEFT PANEL
========================= */

.left-panel{

    min-width:0;

}

.left-panel h2{

    font-size:30px;

    margin-bottom:10px;

}

.left-panel p{

    color:#666;

    margin-bottom:25px;

}

/* =========================
      CATEGORY BAR
========================= */

.category-bar{

    display:flex;

    gap:15px;

    margin-bottom:30px;

    flex-wrap:wrap;

}

.category{

    padding:12px 22px;

    border:none;

    border-radius:30px;

    background:white;

    cursor:pointer;

    font-size:15px;

    font-weight:600;

    transition:.3s;

    box-shadow:0 4px 10px rgba(0,0,0,.08);

}

.category:hover{

    background:#111;

    color:white;

}

.category.active{

    background:#111;

    color:white;

}

/* =========================
      JEWELLERY GALLERY
========================= */

#catalogue.gallery{

    display:block;

    overflow:visible;

    padding-right:0;

}

.catalogue-section{

    margin-bottom:34px;

}

.catalogue-section-heading{

    font-size:20px;

    font-weight:700;

    margin:0 0 16px;

    padding:0 0 10px;

    border-bottom:1px solid #ddd;

    color:#222;

}

.catalogue-section-grid{

    display:grid;

    grid-template-columns:repeat(4,minmax(0,1fr));

    gap:22px;

    align-items:stretch;

}

/* =========================
        CARD
========================= */

.card{

    background:white;

    border-radius:18px;

    overflow:hidden;

    cursor:pointer;

    transition:.35s;

    box-shadow:0 8px 20px rgba(0,0,0,.08);

    display:flex;

    flex-direction:column;

    height:100%;

    min-height:330px;

}

.card:hover{

    transform:translateY(-8px);

    box-shadow:0 15px 35px rgba(0,0,0,.15);

}

.card img{

    width:100%;

    height:240px;

    object-fit:contain;

    display:block;

    padding:12px;

    background:#f8f6f3;

}

.card h3{

    padding:18px;

    text-align:center;

    font-size:18px;

    font-weight:600;

    min-height:82px;

    display:flex;

    align-items:center;

    justify-content:center;

    flex:1;

}

/* =========================
      RIGHT PANEL
========================= */

.right-panel{

    background:white;

    border-radius:20px;

    padding:25px;

    box-shadow:0 10px 30px rgba(0,0,0,.10);

    position:sticky;

    top:110px;

    align-self:start;

    height:auto;

    width:100%;

    overflow:visible;

}

.right-panel h2{

    text-align:center;

    margin-bottom:10px;

    font-size:28px;

}

.right-panel p{

    text-align:center;

    color:#666;

    margin-bottom:20px;

}

/* =========================
        CAMERA BOX
========================= */

.camera-box{

    width:100%;

    height:320px;

    background:#111;

    border-radius:15px;

    overflow:hidden;

    position:relative;

    display:flex;

    justify-content:center;

    align-items:center;

}

.camera-box.necklace-fitting-mode{

    width:min(100%, 470px);

    max-width:470px;

    height:min(88vh, 780px);

    aspect-ratio:3 / 4;

    margin:0 auto;

    border-radius:18px;

}

#camera{

    width:100%;

    height:100%;

    object-fit:cover;

    display:none;

}

.camera-box.necklace-fitting-mode #camera{

    object-position:center 42%;

}

#outputCanvas{

    position:absolute;

    top:0;

    left:0;

    width:100%;

    height:100%;

    pointer-events:none;

}

#cameraPlaceholder{

    color:white;

    font-size:22px;

    font-weight:bold;

}

/* =========================
    SELECTED JEWELLERY
========================= */

.selected-item{

    margin-top:25px;

    text-align:center;

}

.selected-item h3{

    margin-bottom:15px;

}

#selectedImage{

    width:180px;

    height:180px;

    object-fit:cover;

    border-radius:15px;

    background:#f3f3f3;

    display:none;

    margin:auto;

    box-shadow:0 5px 15px rgba(0,0,0,.12);

}

#selectedTitle{

    margin-top:15px;

    min-height:28px;

    color:#444;

}

/* =========================
        BUTTONS
========================= */

.button-group{

    display:flex;

    flex-direction:column;

    gap:15px;

    margin-top:30px;

}

.button-group button{

    padding:14px;

    border:none;

    border-radius:12px;

    background:#111;

    color:white;

    font-size:17px;

    cursor:pointer;

    transition:.3s;

}

.button-group button:hover{

    background:#c89b3c;

    color:#111;

}

/* =========================
        IMAGE MODAL
========================= */

.image-modal{

    display:none;

    position:fixed;

    left:0;

    top:0;

    width:100%;

    height:100%;

    background:rgba(0,0,0,.75);

    justify-content:center;

    align-items:center;

    z-index:2000;

}

.image-modal-content{

    width:500px;

    max-width:90%;

    background:white;

    border-radius:20px;

    padding:25px;

    text-align:center;

    position:relative;

    animation:popup .3s ease;

}

@keyframes popup{

    from{

        transform:scale(.8);

        opacity:0;

    }

    to{

        transform:scale(1);

        opacity:1;

    }

}

#modalImage{

    width:100%;

    height:350px;

    object-fit:cover;

    border-radius:15px;

    margin-bottom:20px;

}

#closeModal{

    position:absolute;

    top:15px;

    right:20px;

    font-size:35px;

    cursor:pointer;

    color:#111;

}

#selectForTryOn{

    margin-top:20px;

    padding:14px 30px;

    border:none;

    border-radius:12px;

    background:#111;

    color:white;

    font-size:17px;

    cursor:pointer;

    transition:.3s;

}

#selectForTryOn:hover{

    background:#c89b3c;

    color:#111;

}

/* =========================
          FOOTER
========================= */

footer{

    margin-top:40px;

    padding:25px;

    text-align:center;

    background:#111;

    color:white;

    width:100%;

}

/* =========================
      RESPONSIVE DESIGN
========================= */

@media(max-width:1100px){

    .main-container{

        grid-template-columns:1fr;

        align-items:start;

    }

    .right-panel{

        position:relative;

        top:0;

        width:100%;

        align-self:start;

        height:auto;

    }

    .catalogue-section-grid{

        grid-template-columns:repeat(3,minmax(0,1fr));

    }

}

@media(max-width:768px){

    header{

        flex-direction:column;

        height:auto;

        padding:20px;

        gap:15px;

    }

    .search-bar{

        width:100%;

    }

    .catalogue-section-grid{

        grid-template-columns:repeat(2,minmax(0,1fr));

        gap:14px;

    }

    .card{

        min-height:260px;

    }

    .card img{

        height:170px;

        padding:8px;

    }

    .card h3{

        padding:12px 8px;

        font-size:14px;

        min-height:64px;

    }

    .camera-box{

        height:260px;

    }

    .camera-box.necklace-fitting-mode{

        width:min(100%, 400px);

        height:min(84vh, 660px);

    }

    #selectedImage{

        width:140px;

        height:140px;

    }

}
