/* ========================================
   SECTION 9: STORE SECTION CSS
   ======================================== */

#stores {
  width: 100%;
  background-color: #eeeeef;
  padding: 40px 0;
}

.stores {
  width: 100%;
  padding: 20px 0;
}

.container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 80vw;
  height: 70vh;
  padding: 20px;
  position: relative;
  margin: auto;
  margin-bottom: 5%;
  box-sizing: border-box;
}

/* Maps and Dropdown Section Container */
.map-dropdown-container {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  gap: 30px;
}

/* Map Container */
.map-container {
  width: 50%;
  height: 100%;
  min-height: 450px;
}

/* Map frame wrapper — iframe dibuat via JS di sini */
.map-frame {
  border-radius: 10px;
  width: 100%;
  height: 100%;
  border: 0;
  box-shadow: 2px 4px 15px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  background: #e8edf5;
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Placeholder sebelum toko dipilih */
.store-map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #e8edf5;
  color: #1f4390;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.store-map-placeholder p {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

.store-map-placeholder.hidden {
  opacity: 0;
}

/* Right side */
.dropdown-store-info {
  width: 45%;
  margin-top: 5%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 100%;
}

/* Dropdown container */
.dropdown-container {
  width: 100%;
  position: relative;
  text-align: center;
  margin-bottom: 20px;
}

/* Dropdown button */
.dropdown-btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #1f4390;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  z-index: 1;
  width: auto;
  transition: background-color 0.25s ease, transform 0.15s ease;
}

.dropdown-btn:hover {
  background-color: #2d5bb8;
  transform: translateY(-1px);
}

.dropdown-btn:active {
  transform: translateY(0);
}

/* Dropdown content */
.dropdown-content {
  display: block;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background-color: rgba(30, 66, 143, 0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  width: 50%;
  min-width: 200px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.dropdown-content.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Dropdown list */
.dropdown-content ul {
  list-style: none;
  padding: 6px 0;
  margin: 0;
}

.dropdown-content li {
  color: #eeeeef;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.18s ease, padding-left 0.18s ease, color 0.18s ease;
  border-radius: 6px;
  margin: 2px 6px;
}

.dropdown-content li:hover {
  background-color: #f7b963;
  color: #1f4390;
  padding-left: 22px;
}

.dropdown-content li.selected {
  background-color: rgba(247, 185, 99, 0.2);
  color: #f7b963;
  font-weight: 600;
}

.dropdown-content li.selected::before {
  content: '✓ ';
  font-size: 0.85em;
}

/* Store Info */
.store-info {
  padding: 20px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  max-width: 60%;
  margin: 0 auto 20px auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 1;
  transform: translateY(0);
}

.store-info h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  text-align: left;
  color: #1f4390;
}

.store-info p {
  margin: 8px 0;
  font-size: 1rem;
  line-height: 1.6;
  text-align: left;
  color: #333;
}

.store-info p strong {
  font-weight: bold;
  color: #000;
}

.store-info a {
  color: #1f4390;
  text-decoration: none;
  transition: color 0.2s ease;
}

.store-info a:hover {
  color: #f7b963;
  text-decoration: underline;
}

/* Marketplace Links */
.marketplace-links {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 15px;
}

.marketplace-links a {
  margin: 0 10px;
  transition: transform 0.25s ease;
}

.marketplace-links a:hover {
  transform: scale(1.1);
}

.marketplace-links img {
  width: 30px;
  height: auto;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.marketplace-links img:hover {
  transform: scale(1.2);
}

/* WhatsApp Float Button */
.whatsapp-float {
  position: fixed;
  width: 50px;
  height: 50px;
  bottom: 1.5%;
  right: 1.5%;
  background-color: #f7b963;
  color: #fff;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.whatsapp-float:hover {
  background-color: #e1a153;
  transform: scale(1.1);
}

.whatsapp-float img {
  position: relative;
  left: 7%;
  width: 30px;
  height: 30px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media screen and (max-width: 1280px) {
  .store-info { max-width: 80%; }
  .dropdown-content { width: 60%; }
  .map-container { width: 60%; height: 80%; }
}

@media screen and (max-width: 884px) {
  .container {
    flex-direction: column;
    height: auto;
    width: 90vw;
    padding: 10px;
    margin: 0 auto 5%;
    box-sizing: border-box;
  }

  .map-dropdown-container {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .map-container {
    width: 100%;
    height: 300px;
    min-height: unset;
  }

  .map-frame {
    height: 300px;
  }

  .dropdown-store-info {
    width: 100%;
    margin-top: 20px;
    align-items: center;
  }

  .dropdown-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .dropdown-btn {
    width: auto;
    min-width: 200px;
    max-width: 90%;
  }

  .dropdown-content {
    width: 80%;
    min-width: 200px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
  }

  .dropdown-content.show {
    transform: translateX(-50%) translateY(0);
  }

  .store-info {
    max-width: 90%;
    width: 90%;
    box-sizing: border-box;
  }
}

@media screen and (max-width: 768px) {
  .container {
    flex-direction: column;
    height: auto;
    width: 92vw;
    padding: 10px;
    margin: 0 auto 5%;
    box-sizing: border-box;
  }

  .map-dropdown-container {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 16px;
  }

  .map-container {
    width: 100%;
    height: 280px;
    min-height: unset;
  }

  .map-frame {
    height: 280px;
  }

  .dropdown-store-info {
    width: 100%;
    margin-top: 10px;
    align-items: center;
  }

  .dropdown-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .dropdown-btn {
    width: auto;
    min-width: 180px;
    max-width: 90%;
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .dropdown-content {
    position: absolute;
    left: 50%;
    width: 80%;
    min-width: 180px;
    max-width: 300px;
    transform: translateX(-50%) translateY(-10px);
  }

  .dropdown-content.show {
    transform: translateX(-50%) translateY(0);
  }

  .store-info {
    max-width: 100%;
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
  }
}

@media only screen and (max-width: 440px) {
  #stores {
    padding: 20px 0;
    overflow-x: hidden;
  }

  .stores {
    width: 100%;
    overflow-x: hidden;
  }

  .container {
    flex-direction: column;
    height: auto;
    width: 94vw;
    padding: 8px;
    margin: 0 auto 5%;
    box-sizing: border-box;
    overflow: visible;
  }

  .map-dropdown-container {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 14px;
  }

  .map-container {
    width: 100%;
    height: 240px;
    min-height: unset;
  }

  .map-frame {
    height: 240px;
  }

  .dropdown-store-info {
    width: 100%;
    margin-top: 10px;
    align-items: center;
  }

  .dropdown-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .dropdown-btn {
    width: auto;
    min-width: 160px;
    max-width: 85%;
    padding: 10px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .dropdown-content {
    position: absolute;
    left: 50%;
    width: 85vw;
    max-width: 280px;
    transform: translateX(-50%) translateY(-10px);
  }

  .dropdown-content.show {
    transform: translateX(-50%) translateY(0);
  }

  .store-info {
    max-width: 100%;
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    font-size: 0.9rem;
  }

  .store-info h3 {
    font-size: 1.2rem;
  }

  .store-info p {
    font-size: 0.875rem;
  }

  .marketplace-links {
    flex-wrap: wrap;
    gap: 10px;
  }

  .whatsapp-float {
    width: 40px;
    height: 40px;
    font-size: 25px;
    bottom: 3%;
    right: 3%;
  }

  .whatsapp-float img { width: 25px; height: 25px; left: 10%; }
}

/* ── Dropdown button wrapper (button + tombol X) ── */
.dropdown-btn-wrapper {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  position: relative;
}

/* Tombol X reset — hidden by default */
.dropdown-reset-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  background-color: #c0392b;
  color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  transition: background-color 0.2s ease;
}

.dropdown-reset-btn.visible {
  display: flex;
}

.dropdown-reset-btn:hover {
  background-color: #a93226;
}

/* Saat tombol X visible, hilangkan border-radius kanan dropdown-btn */
.dropdown-btn-wrapper:has(.dropdown-reset-btn.visible) .dropdown-btn {
  border-radius: 4px 0 0 4px;
}