/* ========================
   UNIFICADO: items.css
   Contiene estilos de nuevo.css + popup.css + figuritas
   ======================== */

/* ============ Reglas globales ============ */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-y: scroll !important;
  font-family: var(--base-font-family, Arial, sans-serif);
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============ Secci贸n principal corregida ============ */
section#about {
  flex: 1 0 auto;
  padding: 7rem 20px;
  margin-top: 0;
}

/* ============ 脕lbum (solo para .album-page) ============ */
.album-page .album-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  max-width: calc((200px * 6) + (20px * 5));
  margin: 0 auto;
}

.album-page hr {
  margin-bottom: 80px;
}

/* ============ Tarjetas estilo Uiverse ============ */
.card {
  position: relative;
  width: 200px;
  height: 250px;
  border-radius: 14px;
  z-index: 1111;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 20px 20px 60px #bebebe, -20px -20px 60px #ffffff;
}

.bg {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 190px;
  height: 240px;
  z-index: 2;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(24px);
  border-radius: 10px;
  overflow: hidden;
  outline: 2px solid white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
}

.bg img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 10px;
}

.btn-info {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background-color: #bb0000;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s ease;
  box-shadow: none; /* 馃敶 aseguramos que no tenga sombra accidental */
}

.btn-info:hover {
  background-color: #ff0000;
}

/* Fondo animado blur detr谩s */
.blob {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background-color: #ff0000;
  opacity: 1;
  filter: blur(12px);
  animation: blob-bounce 5s infinite ease;
}

@keyframes blob-bounce {
  0% {
    transform: translate(-100%, -100%) translate3d(0, 0, 0);
  }
  25% {
    transform: translate(-100%, -100%) translate3d(100%, 0, 0);
  }
  50% {
    transform: translate(-100%, -100%) translate3d(100%, 100%, 0);
  }
  75% {
    transform: translate(-100%, -100%) translate3d(0, 100%, 0);
  }
  100% {
    transform: translate(-100%, -100%) translate3d(0, 0, 0);
  }
}

/* ============ Responsive ============ */
@media (max-width: 500px) {
  .album-page .album-container {
    max-width: 100%;
  }
  .card {
    width: 100%;
    height: auto;
  }
  .bg {
    width: calc(100% - 10px);
    height: auto;
  }
}

/* ============ Tipograf铆as ============ */
h1, h2, h3 {
  margin-top: 30px;
}

ul {
  padding-left: 20px;
  line-height: 1.6;
}

p {
  margin: 12px 0;
  font-size: 1.1rem;
}

/* ============ 脕lbum de Figuritas ============ */
.album-container {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 700px !important;
  margin: 0 auto !important;
  padding: 30px 0 !important;
}

.album-container.fila-4 {
  max-width: calc((200px * 4) + (20px * 3));
}

.figurita {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  width: 150px;
  text-align: center;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.figurita:hover {
  transform: scale(1.03);
}

.figurita img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* ============ Popup general ============ */
.popup-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.popup-content {
  background-color: #fff;
  padding: 20px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.close-popup {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 26px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-popup:hover {
  color: #ff0000;
}

.popup-layout {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  gap: 30px;
}

.popup-table {
  flex: 2;
  min-width: 0;
}

.popup-table h2 {
  margin-top: 0;
}

.popup-table h3 {
  margin: 0 0 15px 0;
  font-size: 20px;
  font-weight: bold;
}

.popup-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.popup-table th {
  background-color: #222;
  color: #fff;
  padding: 10px;
  text-align: left;
}

.popup-table td {
  border: 1px solid #ccc;
  padding: 10px;
  vertical-align: top;
}

/* ============ Im谩genes del popup (1 al 8) ============ */
.popup-images {
  flex: 0 0 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 53px;
  overflow: visible;
  position: relative;
}

.popup-images img {
  width: 130px;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
  border: 2px solid #e0e0e0;
  background: white;
  padding: 4px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, z-index 0.2s ease;
  cursor: zoom-in;
  z-index: 1;
}

.popup-images img:hover {
  transform: scale(2.2) translate(0, 0);
  z-index: 999;
  position: relative;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

/* Tarjetas compactas para items.html */
.card.compact {
  height: 250px; /* fuerza igualdad total */
}

.card.compact .bg {
  height: 240px; /* igual que en .card est谩ndar */
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.card.compact .bg img {
  width: 71.5%;
  height: auto;
  object-fit: contain;
  margin-bottom: 10px;
}

.card.compact .btn-info {
  margin: 0;
}

.album-page h1 {
  font-weight: 800;
  font-size: 48px;
  text-align: center;
  margin-top: 21px;
}

.album-page h1 {
  margin-bottom: 10px !important; /* antes podía ser 30px o más */
}

.album-container {
  padding-top: 10px !important; /* si ya existe, reducilo */
}

nav.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
}

/* ==================== POPUPS PETS ==================== */
.popup-pet {
  display: flex; /* CAMBIO: debe estar activo para que el popup sea visible */
  visibility: hidden; /* Inicialmente oculto */
  opacity: 0;
  transition: opacity 0.3s ease;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

/* Cuando está activo */
.popup-pet.active {
  visibility: visible;
  opacity: 1;
}

.popup-pet-content {
  background-color: #fff;
  color: #111;
  padding: 20px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
}

.popup-pet-content img {
  width: 150px;
  margin: 10px 0;
}

.popup-pet-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.popup-pet-content th,
.popup-pet-content td {
  padding: 8px;
  border: 1px solid #ccc;
  text-align: left;
}

.popup-pet-content th {
  background-color: #f0f0f0;
}

.popup-pet .close {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

.row-verde {
  background-color: #d4f8d4 !important; /* Verde pastel */
}

.row-celeste {
  background-color: #d4ecff !important; /* Celeste pastel */
}

.row-naranja {
  background-color: #ffe5b4 !important; /* Naranja pastel */
}

.row-plateado {
  background-color: #f2f2f2 !important; /* Plateado pastel muy suave */
}

.album-page .album-container.seis-en-fila {
  display: flex !important;
  flex-wrap: wrap !important; /* ✅ AHORA SÍ BAJAN A OTRA FILA */
  justify-content: center !important;
  gap: 20px !important;
  max-width: calc((200px * 6) + (20px * 5)) !important;
  margin: 0 auto !important;
  padding: 30px 0 !important;
}


.album-page .album-container.seis-en-fila .card {
  flex: 0 0 200px !important;
  max-width: 200px !important;
}

/* ============ Responsive: 2 tarjetas por fila en móviles ============ */
@media (max-width: 768px) {
  /* Tarjetas principales (items.html) */
  .album-container.seis-en-fila,
  .album-container.fila-4 {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 20px !important;
  }

  .album-container.seis-en-fila .card,
  .album-container.fila-4 .card {
    width: 48% !important;
    max-width: 48% !important;
    flex: none !important;
    margin-bottom: 20px !important;
  }


  /* Tarjetas compactas */
  .card.compact {
    height: 300px !important;
  }

  .card.compact .bg {
    height: 280px !important;
    padding: 15px 10px !important;
    justify-content: space-between !important;
  }

  .card.compact .btn-info {
    margin-top: 3px !important;
    margin-bottom: 10px !important;
    align-self: center !important;
  }

  /* Popups */
  .popup-layout {
    flex-direction: column !important;
    align-items: center !important;
    padding: 20px 15px !important;
    max-width: 90vw !important;
  }

  .popup-layout h2 {
    text-align: center !important;
    font-size: 1.5rem !important;
    margin-bottom: 15px !important;
  }

  .popup-table {
    width: 100% !important;
    font-size: 0.85rem !important;
    margin-bottom: 15px !important;
  }

  .popup-carousel {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
  }

  .popup-carousel img {
    width: 45% !important;
    height: auto !important;
  }

  .popup-close {
    top: 10px !important;
    right: 10px !important;
    font-size: 1.2rem !important;
  }
}

/* ============ Responsive: 1 tarjeta por fila en celulares chicos ============ */
@media (max-width: 480px) {
  .album-container.seis-en-fila .card,
  .album-container.fila-4 .card {
    width: 90% !important;
    max-width: 90% !important;
    min-width: 60% !important; /* Fuerza aún más */
  }
}

/* ============ Estilo del botón de menú (hamburguesa) ============ */
.navbar-toggler {
  border: none;
  background: transparent;
  padding: 8px;
  margin-right: 10px;
  outline: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-toggler-icon {
  width: 30px;
  height: 3px;
  background-color: #fff;
  position: relative;
  display: inline-block;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 3px;
  background-color: #fff;
  left: 0;
  transition: all 0.3s ease;
}

.navbar-toggler-icon::before {
  top: -8px;
}

.navbar-toggler-icon::after {
  top: 8px;
}

.wings-page .card.compact .bg img {
  width: 90%;
  max-height: auto;
  object-fit: contain;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .wings-page .card.compact .bg img {
    width: 70% !important;
  }
}

@media (max-width: 1024px) {
  .album-container {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .album-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .album-container {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .pets-page .album-container.fila-4 {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  .pets-page .album-container.fila-4 .card {
    width: 80% !important;
    max-width: 320px !important;
    margin-bottom: 20px !important;
  }

  .pets-page .album-container.fila-4 .card .bg {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    padding: 15px !important;
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(24px) !important;
    border-radius: 10px !important;
    outline: 2px solid white !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .pets-page .album-container.fila-4 .card .bg img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    margin-bottom: 10px !important;
  }

  .pets-page .album-container.fila-4 .card .btn-info {
    margin-top: 10px !important;
    align-self: center !important;
  }
}

.search-bar {
  text-align: center;
  margin: 20px 0;
}

#busqueda-pets {
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 8px;
  border: 2px solid #ccc;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

.resaltada {
  outline: 5px solid #ff9900;
  box-shadow: 0 0 20px #ff9900;
  transition: outline 0.4s ease, box-shadow 0.4s ease;
}

@media (max-width: 768px) {
  .album-page.pets-page .popup-pet {
    position: fixed;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 10px;
    z-index: 9999;
    overflow: auto;
    box-sizing: border-box;
    padding: 10px;
  }

  .album-page.pets-page .popup-pet-content {
    max-height: 100%;
    overflow-y: auto;
  }

  .album-page.pets-page .popup-pet-content .close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    background: none;
    color: inherit;
    border: none;
    cursor: pointer;
  }
}
