/* === Popup dengan animasi fade === */
#pop-popup {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 20px;
  border: 2px solid #333;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  z-index: 9999;
  max-width: 400px;
  display: none;
  flex-direction: column;

  /* Animasi */
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#pop-popup.active {
  display: flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Banner dengan animasi fade === */
#pop-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #2220;
  color: #fff;
  text-align: center;
  padding: 8px;
  z-index: 9998;
  display: none;

  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
#pop-banner.show {
  display: block;
  opacity: 1;
}

/* Tombol close popup & banner */
#pop-popup .close,
#pop-banner .close {
  cursor: pointer;
}

/* Banner gambar rata tengah */
#pop-banner .content img {
  max-height: 30px;
  margin: 0 auto;
  display: block;
}

/* === Mobile Responsive === */
@media (max-width:768px) {
  #pop-popup {
    position: fixed;
    bottom: 0;           /* dari bawah */
    left: 0;
    width: 100%;
    height: 60vh;        /* setengah layar */
    border-radius: 10px 10px 0 0;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;

    /* animasi slide */
    transform: translateY(100%);
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
  }

  #pop-popup.active {
    transform: translateY(0);
    opacity: 1;
  }

  #pop-popup .content {
    overflow-y: auto;
    flex: 1;
    margin-top: 40px; /* jarak tombol close */
  }

  #pop-popup .close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
  }
}

/* === grid === */
/* Pop Grid */
.pop-grid {
    display: flex;
    flex-wrap: wrap;      /* biar multiple row */
    gap: 10px;            /* jarak antar item */
    justify-content: flex-start; /* bisa diganti center */
}

.pop-grid-item {
    display: block;
    width: calc(33.333% - 10px); /* 3 kolom, sesuaikan */
    text-align: center;
}

.pop-grid-item img {
    width: 100%;
    height: auto;
    display: block;
}
@media (max-width:768px) {
    .pop-grid-item {
        width: calc(50% - 10px);
    }
}
