/* Pinterest-style masonry layout for Bootstrap 4 product page */
/* Default: 3 columns on medium screens */
.item { 
    width: 33.333%; 
    margin-bottom: 20px;
    padding: 10px;
    box-sizing: border-box;
}

.item.w2 { 
    width: 66.666%; 
}

/* Add hover effects for better interaction */
.item:hover {
    transform: translateY(-3px);
    transition: transform 0.3s ease;
}

/* Responsive breakpoints - Max 4 columns, Min 2 columns */
@media (max-width: 768px) {
    .item { 
        width: 50%; /* 2 columns minimum */
        margin-bottom: 12px;
        padding: 6px;
    }
    .item.w2 { width: 100%; }
}

@media (max-width: 576px) {
    .item { 
        width: 50%; /* Stay at 2 columns minimum, don't go to 1 */
        margin-bottom: 10px;
        padding: 5px;
    }
    .item.w2 { width: 100%; }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .item { 
        width: 33.333%; /* 3 columns on tablet/small desktop */
        padding: 8px;
        margin-bottom: 16px;
    }
    .item.w2 { width: 66.666%; }
}

@media (min-width: 1200px) {
    .item { 
        width: 25%; /* 4 columns maximum on large screens */
        padding: 12px;
        margin-bottom: 24px;
    }
    .item.w2 { width: 50%; }
}

/* Gallery container styling */
#photogroup {
    margin: 0 -10px;
    padding: 0;
}

/* Mobile fix: prevent horizontal overflow */
@media (max-width: 767px) {
    #photogroup {
        margin: 0 -5px; /* Reduce negative margin on mobile */
    }
}

@media (max-width: 576px) {
    #photogroup {
        margin: 0; /* Remove negative margin entirely on small mobile */
    }
}

/* Ensure images are responsive within masonry items */
.item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    /* Prevent layout shift during image loading */
    max-width: 100%;
}

/* Ensure items have minimum dimensions to prevent collapse */
.item {
    min-height: 100px;
    overflow: hidden;
}

.item:hover img {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: scale(1.02);
}

/* Thumbnail styling for masonry items */
.item.thumbnail {
    border: none;
    background: transparent;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 0;
    box-shadow: none;
}

.item.thumbnail:hover {
    background: transparent;
    border: none;
}

/* Remove default thumbnail padding and styling for cleaner look */
.watch-gallery .item.thumbnail {
    padding: 10px;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.watch-gallery .item.thumbnail:hover {
    background-color: transparent;
    border: none;
    box-shadow: none;
}

/* Animation demo styles (keep existing) */
.animate-item-size-demo .item,
.animate-item-size-demo .item-content {
  width: 60px;
  height: 60px;
}
.animate-item-size-demo .item-content {
  background: #09D;
  transition: width 0.4s, height 0.4s;
  /* -webkit-transition -moz, etc, too */
}
/* both item and item content change size */
.animate-item-size-demo .item.is-expanded,
.animate-item-size-demo .item.is-expanded .item-content {
  width: 180px;
  height: 120px;
}