/* =========================================================
   1) Gallery Section
   ========================================================= */
.gallery-section{
  position: relative;
  padding: 10px 0 70px;
}

/* =========================================================
   2) Toolbar / Filter Panel
   ========================================================= */
.gallery-toolbar{
  margin: 28px auto 24px;
  max-width: 980px;
  display: grid;
  gap: 14px;
}

.gallery-toolbar.pets-filter-panel,
.pets-filter-panel{
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.pets-filter-panel{
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 18px 18px 14px;
  margin: 12px 0 22px;
  box-shadow: 0 10px 28px rgba(15,23,42,.04);
  position: relative;
}

/* Search */
.gallery-search{
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 14px;
}

.gallery-search i{
  color: var(--muted);
  font-size: 14px;
}

.gallery-search input{
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-dark);
  font-size: 14px;
}

/* Filters */
.masonry-filter{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.masonry-filter > li{
  display: inline-block;
  padding-right: 0;
  float: none !important;
}

.masonry-filter a{
  display: inline-block;
  min-width: 92px;
  padding: 0 24px;
  line-height: 40px;
  margin-bottom: 10px;
  border: 1px solid var(--brand-blue);
  border-radius: 999px;
  color: #555;
  font-size: 14px;
  text-decoration: none;
  outline: none;
  transition: all .25s ease-in-out;
}

.masonry-filter a.active,
.masonry-filter a:hover,
.masonry-filter a:focus{
  border-color: var(--border-soft);
  color: #fff;
}

ul.masonry-filter.news-type-filter{
  display: flex !important;
  justify-content: center !important;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0 !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

/* =========================================================
   3) Masonry Grid
   ========================================================= */
#grid.masonry-gallery{
  direction: rtl;
}

.masonry-gallery.grid-four-item{
  margin-right: -12px;
  margin-left: -12px;
}

.masonry-gallery.grid-four-item .gallery-item{
  padding: 0 12px 24px;
}

/* =========================================================
   4) Gallery Card
   ========================================================= */
.gallery-item{
  position: relative;
}

.gallery-item .inner-box{
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-item .inner-box:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gallery-item .image-box{
  position: relative;
  margin: 0;
}

.gallery-item .image-box img{
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

/* Badge */
.status-badge{
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 5;
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

/* Overlay */
.gallery-item .overlay-box{
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  background: rgba(0,0,0,.68);
  transform: translateX(100%);
  transition: all 650ms ease;
}

.gallery-item .inner-box:hover .overlay-box{
  opacity: 1;
  transform: translateX(0);
}

.gallery-item .overlay-inner{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
}

.gallery-item .overlay-content{
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gallery-title{
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}

.gallery-meta{
  color: rgba(255,255,255,.88);
  font-size: 13px;
  line-height: 1.6;
}

.gallery-meta i{
  margin-left: 6px;
}

/* Actions */
.gallery-actions{
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.gallery-action{
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brand-gold);
  border-radius: 50%;
  background: transparent;
  color: var(--brand-gold);
  font-size: 18px;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}

.gallery-action:hover{
  transform: scale(1.08);
  background: rgba(229,166,45,.16);
}

.gallery-action.wa{
  border-color: var(--wa-green);
  color: var(--wa-green);
}

.gallery-action.wa:hover{
  background: rgba(37,211,102,.18);
}

.gallery-action.donate{
  border-color: var(--brand-gold);
  color: var(--brand-gold);
}

.gallery-action.donate:hover{
  background: rgba(229,166,45,.18);
}

.gallery-action:focus-visible{
  outline: 3px solid rgba(255,255,255,.55);
  outline-offset: 3px;
}

/* =========================================================
   5) Pet Details Page
   ========================================================= */
.pet-details-section{
  padding: 60px 0;
}

.pet-details-card{
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.pet-details-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 10px;
}

.pet-name{
  margin: 0;
  font-size: 26px;
  line-height: 1.35;
  font-weight: 800;
  color: var(--text-dark);
}

.pet-sub{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 14px;
}

.pet-meta i{
  margin-inline-start: 6px;
  color: var(--brand-gold);
}

/* Main Gallery */
.gallery-frame{
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card);
}

.gallery-main{
  width: 100%;
  height: 430px;
  object-fit: cover;
  display: block;
  transition: opacity .25s ease;
  cursor: zoom-in;
}

.thumbs{
  display: flex;
  gap: 10px;
  padding: 12px;
  overflow: auto;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.thumbs button{
  border: 2px solid transparent;
  padding: 0;
  background: transparent;
  border-radius: 14px;
  overflow: hidden;
  min-width: 84px;
  height: 64px;
  flex: 0 0 auto;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}

.thumbs button:hover{
  transform: translateY(-1px);
}

.thumbs button.active{
  border-color: var(--brand-blue);
}

.thumbs img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Facts */
.pet-facts{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 22px 18px;
}

.fact{
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  background: var(--card);
}

.fact-ic{
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(229,166,45,.14);
  color: var(--brand-gold);
}

.fact-label{
  margin-bottom: 2px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.fact-val{
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 800;
}

/* Content blocks */
.pet-block{
  padding: 0 22px 18px;
}

.pet-block-title{
  margin: 10px 0 10px;
  color: var(--text-dark);
  font-size: 18px;
  font-weight: 900;
}

.pet-paragraph{
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.9;
}

.pet-list{
  margin: 0;
  padding: 0;
  list-style: none;
}

.pet-list li{
  position: relative;
  margin-bottom: 10px;
  padding-right: 26px;
  color: var(--text-soft);
  line-height: 1.9;
}

.pet-list li::before{
  content: "";
  position: absolute;
  top: 10px;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-gold);
}

/* Requirements */
.pet-req-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.pet-req-list li{
  position: relative;
  padding-right: 18px;
  line-height: 1.9;
  color: var(--text);
  font-weight: 600;
}

.pet-req-list li::before{
  content:"";
  position: absolute;
  right: 0;
  top: .75em;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(229,166,45,.18);
}

/* Badges / Notes */
.pet-badge-stack {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pet-status-badge {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .85rem;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .12);
    z-index: 2;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pet-status-badge .dot{
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  margin-left: 6px;
}

.pet-state-badge{
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: .82rem;
  white-space: nowrap;
}

.pet-warm-note{
  margin: 14px 0 18px;
  text-align: center;
  font-size: 15px;
  color: var(--brand-gold);
  font-weight: 600;
}

.pet-warm-note i{
  color: var(--brand-gold);
  font-size: 13px;
  margin-inline-start: 4px;
}

.pet-more-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(1,146,220,.25);
  background: rgba(1,146,220,.08);
  color: var(--brand-blue);
  font-weight: 900;
  text-decoration: none;
  transition: .2s ease;
}

.pet-more-link:hover{
  background: rgba(1,146,220,.12);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--brand-blue);
}

/* =========================================================
   6) Sidebar
   ========================================================= */
.pet-side-card{
  position: sticky;
  top: 110px;
  padding: 18px;
  background: var(--card);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.pet-side-head h3{
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--text-dark);
}

.pet-side-sub{
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 13px;
}

.pet-side-actions{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.pet-btn{
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 900;
  text-decoration: none;
  transition: all .18s ease;
}

.pet-btn-whatsapp{
  background: var(--wa-green);
  border-color: var(--wa-green);
  color: #fff;
}

.pet-btn-whatsapp:hover{
  transform: translateY(-1px);
  filter: brightness(.95);
  color: #fff;
}

.pet-btn-outline{
  background: transparent;
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.pet-btn-outline:hover{
  transform: translateY(-1px);
  background: var(--brand-blue);
  color: #fff;
}

/* =========================================================
   7) Related
   ========================================================= */
.pet-related-box{
  border-radius: 22px;
}

.pet-related-head{
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.pet-related-meta{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pet-related-name{
  margin: 0;
  font-size: 1.05rem;
  font-weight: 1000;
  color: var(--text);
  line-height: 1.6;
}

/* =========================================================
   8) Responsive
   ========================================================= */
@media (max-width: 991.98px){
  .gallery-item .image-box img{
    height: 240px;
  }

  .pet-facts{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pet-side-card{
    position: static;
    top: auto;
    margin-top: 18px;
  }

  .gallery-main{
    height: 320px;
  }
}

@media (max-width: 767.98px){
  .gallery-item .overlay-box{
    opacity: 1;
    transform: none;
    background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.10));
  }

  .gallery-item .overlay-inner{
    align-items: flex-end;
    justify-content: center;
    padding: 14px;
  }

  .gallery-item .image-box img{
    height: 260px;
  }

  .pet-gallery img{
    height: 280px;
  }

  .pet-details-head{
    flex-direction: column;
    align-items: stretch;
  }

  .pet-related-head{
    align-items: stretch;
  }

  .pet-more-link{
    width: fit-content;
  }
}

@media (max-width: 575.98px){
  .masonry-gallery.grid-four-item .isotope-item{
    width: 100% !important;
    position: static !important;
  }

  #grid.masonry-gallery.grid-four-item{
    height: auto !important;
  }

  .gallery-main{
    max-height: 70vh;
  }
}
