*{
margin:0;
padding:0;
box-sizing:border-box;
}

body{
font-family:"Raleway",sans-serif;
background:#f4f4f6;
color:#222;
}

/* HEADER */

.gallery-header{
position:fixed;
top:0;
left:0;
width:100%;
height:80px;
background:white;
display:flex;
align-items:center;
padding-left:30px;
box-shadow:0 2px 8px rgba(0,0,0,0.05);
z-index:10;
}

.header-logo{
height:60px;
}

/* CLOSE BUTTON */

.close-btn{
position:fixed;
top:20px;
right:25px;
width:45px;
height:45px;
border-radius:50%;
border:none;
background:white;
font-size:28px;
cursor:pointer;
z-index:20;
box-shadow:0 4px 12px rgba(0,0,0,0.15);
}

/* LAYOUT */

.gallery-container{
display:grid;
grid-template-columns:minmax(420px,42%) 1fr;
height:100vh;
padding-top:80px;
}

/* LEFT */

.gallery-left{
background:#ececec;
padding:60px;
display:flex;
flex-direction:column;
align-items:center;
justify-content:center;
position:relative;
}

.preview-title{
position:absolute;
top:20px;
left:50%;
transform:translateX(-50%);
}

.preview-title h1{
font-size:2.4rem;
font-weight:500;
}

/* PREVIEW */

.main-preview-wrapper{
width:100%;
height:65vh;
min-height:480px;
border-radius:20px;
overflow:hidden;
position:relative;
}

.main-preview-3d{
width:100%;
height:100%;
}

model-viewer{
width:100%;
height:100%;
display:block;
transition:opacity .35s;
}

/* LOADER */

.preview-loader{
position:absolute;
inset:0;
display:flex;
align-items:center;
justify-content:center;
background:rgba(255,255,255,.6);
backdrop-filter:blur(6px);
opacity:0;
visibility:hidden;
transition:.3s;
}

.preview-loader.visible{
opacity:1;
visibility:visible;
}

.spinner{
width:55px;
height:55px;
border:5px solid rgba(0,0,0,.15);
border-top:5px solid #667eea;
border-radius:50%;
animation:spin 1s linear infinite;
}

@keyframes spin{
to{transform:rotate(360deg)}
}

/* DESCRIPTION */

.gallery-description{
margin-top:20px;
text-align:center;
max-width:500px;
line-height:1.6;
color:#555;
}

/* CATEGORIES */

.portfolio-categories{
display:flex;
gap:10px;
margin-top:20px;
flex-wrap:wrap;
justify-content:center;
}

.cat-btn{
padding:8px 18px;
background:white;
border-radius:40px;
text-decoration:none;
color:#555;
font-size:14px;
}

.cat-btn.active{
background:#667eea;
color:white;
}

/* RIGHT */

.gallery-right{
padding:60px;
display:grid;
grid-template-columns:repeat(3,1fr);
gap:30px;
overflow-y:auto;
}

.gallery-card{
background:white;
border-radius:10px;
overflow:hidden;
cursor:pointer;
border:2px solid transparent;
transition:.3s;
}

.gallery-card img{
width:100%;
display:block;
}

.gallery-card:hover{
transform:translateY(-5px);
box-shadow:0 8px 20px rgba(0,0,0,.15);
}

.gallery-card.active{
border:2px solid #667eea;
}

/* RESPONSIVE */

@media(max-width:1400px){

.gallery-left{
padding:40px;
}

.gallery-right{
padding:40px;
gap:20px;
}

}

@media(max-width:1100px){

.gallery-container{
grid-template-columns:1fr;
height:auto;
}

.gallery-right{
grid-template-columns:repeat(2,1fr);
}

.main-preview-wrapper{
height:55vh;
}

}

@media(max-width:600px){

.gallery-right{
grid-template-columns:1fr;
padding:30px;
}

.main-preview-wrapper{
height:45vh;
min-height:320px;
}

.preview-title h1{
font-size:1.6rem;
}

.close-btn{
width:38px;
height:38px;
font-size:22px;
}

}