/* ===== Colecciones: Masonry + Bootstrap Modal ===== */

/* Gallery grid */
.cp-gallery { margin: 2rem auto; }

.cp-masonry {
  column-count: 4;
  column-gap: 1rem;
}
@media (max-width: 1200px) { .cp-masonry { column-count: 3; } }
@media (max-width: 900px)  { .cp-masonry { column-count: 2; } }
@media (max-width: 576px)  { .cp-masonry { column-count: 1; } }

.cp-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 1rem;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;
  position: relative;
  text-decoration: none;
  color: inherit;
}
.cp-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  background: #f1f1f1;
  transition: transform .18s ease, box-shadow .18s ease;
}
.cp-item:hover img {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}

/* ===== Bootstrap modal tweaks (no custom show/hide) ===== */

/* Make sure the image scales nicely inside the modal */
#cpModalImage {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

/* Caption + counter */
#cpModalCaption {
  font-size: .95rem;
  color: #ddd;
  line-height: 1.4;
  margin: .25rem 0 0;
  text-align: center;
}
#cpModalCounter {
  font-size: .85rem;
  color: #bbb;
  text-align: center;
  margin-bottom: .25rem;
}

/* Prev/Next round buttons */
#cpPrev,
#cpNext {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  background: #d55229;
  border: 1px solid #d55229;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .9;
  cursor: pointer;
  z-index: 2; /* above image */
}
#cpModalOpenFull {
    background: #cd5634;
    padding: 8px;
    border-radius: 25px;
    margin: 5px 0 0 0;
    display: inline-block;
}
/* 60px side offset (use !important to beat Bootstrap’s .start-0/.end-0 if present) */
#cpPrev { left: -60px; }
#cpNext { right: -60px; }

#cpPrev:hover,
#cpNext:hover { opacity: 1; }
/* White circular close button with orange X */
#cpModal .cp-close{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  padding: 0;
  opacity: 1;                 /* override Bootstrap's .btn-close opacity */
  background-image: none;     /* remove default SVG X */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;         /* you already position it with utility classes */
  z-index: 3;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  transition: transform .15s ease, box-shadow .15s ease;
  right: 0;
}

/* Draw the orange X */
#cpModal .cp-close::before,
#cpModal .cp-close::after{
  content: "";
  position: absolute;
  width: 22px;
  height: 2px;
  background: #d55229;
  border-radius: 2px;
}
#cpModal .cp-close::before{ transform: rotate(45deg); }
#cpModal .cp-close::after { transform: rotate(-45deg); }

/* Hover/focus polish */
#cpModal .cp-close:hover{ box-shadow: 0 8px 24px rgba(0,0,0,.2); transform: translateY(-1px); }
#cpModal .cp-close:focus{ outline: 2px solid #d55229; outline-offset: 2px; box-shadow: none; }

@media (max-width: 480px) {
  #cpPrev, #cpNext { display: initial; }
  #cpPrev {
    left: 0;
}
#cpNext {
    right: 0;
}
}
