/* Gallery Overlay & Layout */
.gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 40px 100px;
    box-sizing: border-box;
}

.gallery-split-container {
    display: flex;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 5px;
}

/* Image Container & Main Image */
.gallery-image-container {
    width: 66.66%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.main-image-container {
    flex: 1 1 80%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Inner Wrapper: Center the image while reserving space for nav buttons */
.images-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Gallery Image: Always centered within images-wrapper */
.gallery-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-image.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    position: relative;
}

/* Aspect Ratio Classes */
.gallery-image.portrait {
    max-height: 90%;
    width: auto;
}
.gallery-image.landscape {
    max-width: 90%;
    height: auto;
}
.gallery-image.square {
    max-width: 80%;
    max-height: 80%;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ececec;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    border: none;
    border-radius: 50%;
    height: 38px;
    width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color:#888888;
}
.gallery-nav:hover {
    background: #f6f6f6;
}
.gallery-nav:active, .gallery-nav:focus {
    outline: none;
}
.gallery-prev { left: 20px; }
.gallery-next { right: 20px; }

/* Close Button */
.gallery-close-desktop {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
}

/* Close Button */
.gallery-close-mobile{
    display: none;
}


.header-image-container {
    padding: 0 0 10px 15px;
    display:flex;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap; /* Prevents breaking text */
    overflow-y: hidden;
}
/* Thumbnail Strip */
.thumbnail-strip {
    height: 20%;
    display: flex;
    gap: 10px;
    padding: 10px 0;
    overflow-x: auto;
    overflow: auto; 
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.thumbnail-strip-item {
    width: 85px;
    height: 85px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}
.thumbnail-strip-item.active {
    opacity: 1;
    border: 2px solid #d91b5c;
    border-radius: 8px;
}
.thumbnail-strip-item img {
    width: 81px;
    height: 81px;
    object-fit: cover;
    border-radius: 6px;
}

/* Comments Section */
.gallery-comment {
    width: 33.33%;
    padding: 20px;
    overflow-y: auto;
    border-left: 1px solid #ececec;
}
.comment-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.comment-name {
    color:#40464d;
    font-weight:600;
}
.comment-text {
    color:#40464d
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}
.comment-meta {
    flex-grow: 1;
}
.comment-date { color: #666666; font-size: 14px; }
.comment-rating { color: #ffd700; font-size: 16px; }
.exp-img {
    display: flex;
    gap:5px;
}

.thumb-item img{
    border-radius: 5px;
}


/* Add this new rule */
.hidden-comment {
    display: none !important;
}

.total-img {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    left: 50%;
    line-height: 1.5rem;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

/* gird */

.gallery-img-list-5,.slide-img-list-5 {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    grid-template-rows: repeat(2,1fr);
    width: 100%;
    gap: 2px;
    border-radius: 5px;
    overflow: hidden
}

.gallery-img-list-5 {
    height: 300px;
    gap: 4px; /* Space between items */

}
.slide-img-list-5 {
    height: 350px;
    gap: 2px; /* Space between items */

}
  
  .thumb-item, .grid-item {
    position: relative;
    overflow: hidden;
  }
  
  .cmt-img-grid-5-1 {
    grid-column: span 2; /* Takes up 2 columns */
    grid-row: span 2; /* Takes up 2 rows */
  }
  
  .cmt-img-grid-5-2 {
    grid-column: 3; /* Position in 3rd column */
    grid-row: 1; /* Position in 1st row */
  }
  
  .cmt-img-grid-5-3 {
    grid-column: 4; /* Position in 4th column */
    grid-row: 1; /* Position in 1st row */
  }
  
  .cmt-img-grid-5-4 {
    grid-column: 3; /* Position in 3rd column */
    grid-row: 2; /* Position in 2nd row */
  }
  
  .cmt-img-grid-5-5 {
    grid-column: 4; /* Position in 4th column */
    grid-row: 2; /* Position in 2nd row */
  }

  .box-cmts-header {
    font-size: 1rem;
    font-weight: 550;
    padding-bottom: 10px;
    }
  .box-cmts img {
    width: 100%!important;
    height: 100%!important;
    object-fit: cover; /* Ensures image fills the container without distortion */
  }

  .gallery-img-list-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 4 equal-width columns */
    grid-template-rows: repeat(2, 1fr); /* 2 equal-height rows */
    gap: 8px; /* Space between items */
    width: 100%;
    height: 300px;
  }
  
  .thumb-item, .grid-tiem {
    position: relative;
    overflow: hidden;
  }
  
  .cmt-img-grid-3-1 {
    grid-column: span 2; /* Takes up 2 columns */
    grid-row: span 2; /* Takes up 2 rows */
  }
  
  .cmt-img-grid-3-2 {
    grid-column: 3; /* Position in 3rd column */
    grid-row: 1; /* Position in 1st row */
  }
  
  .cmt-img-grid-3-3 {
    grid-column: 3; /* Position in 4th column */
    grid-row: 2; /* Position in 1st row */
  }

/* Responsive Adjustments */
.dimmer-6 {
    filter: brightness(0.6);
}

.header-image-container-text {
    font-size: 16px;
    font-weight: 550;
    cursor: pointer;
    padding: 10px 0;
    margin: 0 10px;
    color: #666;
}

.header-image-container-text.active {
    color: #d91b5c;
    border-bottom: 2px solid #d91b5c;
}

/* Layout adjustments */
.gallery-image-container {
    transition: width 0.1s ease;
}

.gallery-comment {
    transition: display 0.1s ease;
}



@media (max-width: 1279px) {
    .gallery-split-container {
        gap: 0;
        flex-direction: column;
        border-radius: 0;
    }
    .gallery-overlay {
        padding: 0;
    }
    .gallery-close {
        top: 0px;
        right: 15px;
        color: #495057;
        font-size: 40px;

    }
    .gallery-prev { left: 0; }
    .gallery-next { right: 0; }
    .gallery-nav {
        border: none;
    }
    .box-cmts {
        flex-direction: column;
    }

    .gallery-img-list-5, .gallery-img-list-3, .slide-img-list-5, .slide-img-list-3 {
        gap: 2px; /* Space between items */
        height: 20vh;
    }

    .total-img {
        font-size: 1rem;
        font-weight: 550;
    }
    .gallery-close-desktop{
        display: none;
    }
    /* Close Button */
    .gallery-close-mobile{
    display: block;
    background: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    line-height: 20px;
    padding: 15px;
    position: absolute;
    left: 0;
    margin: 5px 0;
    }
    /* Fix gallery container heights */
    /* Main container adjustments */
    .gallery-image-container {
        height: 60vh !important; /* Total container height */
        display: flex;
        flex-direction: column;
        width: 100%;
        padding-top: 0;
    }

    .main-image-container {
        height: calc(60vh - 100px) !important; /* 70vh - (header + thumbnail heights) */
        position: relative;
      }

    .images-wrapper {
        height: calc(50vh - 88px) !important; /* Fixed image area height */
        position: relative;
        overflow: hidden;
    }

    .thumbnail-strip {
        height: 10vh !important;
        flex-shrink: 0;
        padding: 0;
        background: white;
        position: static; /* Keep in normal flow */
        gap: 1vh;
    }

    .thumbnail-strip-item {
        height: 10vh;
        width: 10vh;
        object-fit: cover;
        border-radius: 6px;
    }

    .thumbnail-strip-item img {
        height: calc(10vh - 4px);
        width: calc(10vh - 4px);
        object-fit: cover;
        border-radius: 6px;
    }
    /* Image size constraints */
    .gallery-image {
        max-height: calc(60vh - 188px) !important; /* 350px - padding */
        width: auto !important;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .gallery-image {
        max-width: 95%;
        max-height: 60vh;
    }

    /* Add to comment section */
    .gallery-comment {
        height: 40vh !important;
        overflow-y: auto;
        width: 100%;
        padding:5vW;
    }

    .header-image-container {
        padding: 10px 0 5px 15px;
    }

    .header-image-container-text {
        font-size: 15px;
    }
}