body {
    font-family: Arial, sans-serif;
  background: #ffe4ec;
  margin: 0; padding: 0;
}
.container { padding: 20px; max-width: 600px; margin: auto; }
.banner { width: 100%; border-radius: 20px; display: block; }
.intro p { margin: 10px 0; }
.intro a { color: #0066cc; text-decoration: none; }

.info-btn {
  display: block;
  width: 100%;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 30px;
  padding: 10px;
  margin: 20px 0;
  cursor: pointer;
}
.info-text {
  background: #fff0f5;
  padding: 15px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.hidden { display: none; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}
.tab, .sort {
  background: #f8d4dc;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
}
.tab.active, .tip, .tab.tip {
  background: #ff5c8d;
  color: #fff;
}
.sort { margin-left: auto; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.card {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
}
.card img { width: 100%; border-radius: 8px; }
.card h3 { margin: 8px 0 4px; font-size: 1rem; }
.card p { font-size: 0.875rem; color: #555; }
.card strong { display: block; margin-top: 6px; }

/* Ensure modal covers entire viewport and sits on top */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* Show only when .hidden is removed */
.modal:not(.hidden) {
  display: flex;
}

/* Allow clicking outside to close */
.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  position: relative;
  max-height: 90%;
  overflow-y: auto;
  z-index: 1000;
}

.close-btn {
  position: absolute; top: 8px; right: 12px; font-size: 24px;
  cursor: pointer;
}
.pay-btn {
  display: block; text-align: center; background: #ff5c8d; color: #fff;
  padding: 10px; border-radius: 12px; margin-top: 12px; text-decoration: none;
}
/* FORCE the modal to be hidden whenever it has .hidden */
.modal.hidden {
  display: none !important;
}

/* When the .hidden class is removed, show it as flex */
.modal:not(.hidden) {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Also ensure the base .modal has no default display */
.modal {
  display: none;
}
/* Modal overlay */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 999;
}
.modal:not(.hidden) {
  display: flex;
}

/* Constrain modal box */
.modal-content {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  max-height: 90vh;      /* Never exceed viewport */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Banner image */
.modal-img {
  width: 100%;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  object-fit: cover;
  max-height: 40vh;      /* Limit image height */
}

/* Scrollable body */
.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;               /* Fill remaining vertical space */
}

/* Close button stays top right */
.close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 24px;
  cursor: pointer;
  z-index: 2;
}

