.kss-siteplan-wrapper {
  position: relative;
  max-width: 100%;
  margin: 20px auto;
  border: 1px solid #ddd;
  /*background-color: #f9f9f9;*/
  overflow: hidden;
}

.kss-image-container {
  position: relative;
  width: 100%;
  line-height: 0;
  overflow: hidden;
}

.kss-siteplan-image {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.kss-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  overflow: hidden;
}

.kss-svg-polygon {
  stroke-width: 0;
  cursor: pointer;
  transition: fill 0.15s ease-in-out, opacity 0.15s ease-in-out;
}

/* --- Style untuk Ikon Button (frontend) --- */
.kss-svg-button {
  cursor: pointer;
}
.kss-svg-button .kss-svg-button-circle {
  transition: fill 0.15s ease-out, transform 0.15s ease-out;
}
.kss-svg-button .kss-svg-button-eye {
  pointer-events: none;
}
.kss-svg-button .kss-svg-button-hitbox {
  fill: transparent;
}

.kss-popup {
  position: absolute;
  z-index: 1001;
  border-radius: 8px; /* Diperbarui ke 8px agar cocok dengan shortcode.php */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); /* Diperbarui agar cocok */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  display: none;
  pointer-events: auto;
  background-color: #fff;
  border: 1px solid #ccc;
  color: #333;
}

/* --- Style khusus untuk popup Tipe Unit (Besar) --- */
.kss-popup.kss-popup-unit {
  max-width: 340px; /* Lebar baru yang pas */
  min-width: 300px;
  transform: none; /* Hapus animasi scale agar tidak goyang */
  opacity: 0;
  transition: opacity 0.3s ease;
}
.kss-popup.kss-popup-unit.kss-popup-visible {
  opacity: 1;
}
.kss-popup.kss-popup-unit .kss-popup-body {
  padding: 0; /* Hapus padding body, biarkan anak-anaknya yg mengatur */
  max-height: none; /* Hapus max-height dan overflow (sesuai permintaan) */
  overflow-y: visible;
}

/* --- Style khusus untuk popup Tipe Jalan (Tooltip) --- */
.kss-popup.kss-popup-jalan {
  max-width: 280px; /* Lebih kecil */
  min-width: 180px;
  pointer-events: none; /* Tooltip tidak bisa diklik */
  transform: scale(0.92) translateY(-5px);
  opacity: 0;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}
.kss-popup.kss-popup-jalan.kss-popup-visible {
  transform: scale(1) translateY(0);
  opacity: 1;
}
/* Sembunyikan header untuk popup jalan */
.kss-popup.kss-popup-jalan .kss-popup-header {
  display: none;
}
/* Beri padding pada body popup jalan */
.kss-popup.kss-popup-jalan .kss-popup-body {
  padding: 12px 16px;
}

/* --- CSS untuk Galeri Internal Tooltip --- */

.kss-tooltip-gallery-wrapper {
  position: relative;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
  background-color: #eee; /* Latar belakang placeholder */
  line-height: 0; /* Menghilangkan spasi aneh di bawah gambar */
}

.kss-tooltip-gallery-container {
  display: flex;
  width: 100%;
}

.kss-tooltip-gallery-slide {
  width: 100%;
  flex-shrink: 0;
  display: none; /* Di-handle oleh JS */
  animation: kssFade 0.3s;
}

.kss-tooltip-gallery-slide.kss-slide-active {
  display: block;
}

.kss-tooltip-gallery-slide img {
  width: 100%;
  max-width: 100%; /* <-- INI PERBAIKAN (agar tidak meluber) */
  height: auto;
  display: block;
}

.kss-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid #e9ecef;
}

.kss-popup-title-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px; /* Jarak antara judul dan status */
}
.kss-popup-title {
  font-weight: 600;
  font-size: 18px; /* Diperbesar sedikit */
  margin: 0;
  line-height: 1.3;
}
.kss-popup-close {
  background: none !important;
  border: none !important;
  font-size: 28px !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  padding: 0 6px !important;
  cursor: pointer !important;
  opacity: 0.5 !important;
  transition: opacity 0.2s !important;
}

.kss-popup-close:hover {
  opacity: 1 !important;
  color: inherit !important;
  transform: none !important;
}

.kss-popup-body {
  /* Padding default dihapus, diatur per tipe popup */
  max-height: none;
  overflow-y: visible;
}

.kss-tooltip-title {
  font-weight: 600; /* Judul tebal */
  font-size: 15px;
  display: block;
  margin-bottom: 8px;
  color: #000; /* Akan di-override shortcode */
}
.kss-tooltip-image {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.kss-tooltip-desc {
  margin: 0;
  color: #555; /* Deskripsi 'tipis' (abu-abu) */
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400; /* Font 'tipis' (normal) */
  white-space: pre-wrap;
  word-break: break-word;
}

.kss-unit-image {
  padding: 18px 18px 0 18px;
}
.kss-unit-image img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin: 0 auto; /* Center the image */
}
.kss-unit-details {
  list-style: none;
  padding: 0;
  margin: 16px 18px;
}
.kss-unit-details li {
  padding: 10px 0;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.kss-unit-details li:last-child {
  border-bottom: none;
}
.kss-unit-details li strong {
  margin-right: 12px;
  color: #495057;
  flex-shrink: 0;
  font-weight: 600;
}
.kss-unit-details li span {
  text-align: right;
  font-weight: 500;
}
.kss-unit-link-wrapper {
  padding: 0 18px 18px 18px;
  text-align: center;
}
/* .kss-popup-link {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: transparent;
  background-image: linear-gradient(90deg, #e7c96f 0%, #b68f52 100%);
  border-radius: 120px 120px 120px 120px;
  color: #333;
}
.kss-popup-link:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  color: #000;
  filter: brightness(0.9);
} */

.kss-popup-content-detailed ul,
.kss-popup-content-detailed img {
  display: none !important;
}

/* ▼▼▼ CSS BARU UNTUK BADGE STATUS ▼▼▼ */
.kss-unit-status {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  border-radius: 20px;
  color: #fff;
}
.kss-unit-status.kss-status-available {
  background-color: #198754; /* Hijau */
  color: #fff;
}
.kss-unit-status.kss-status-book {
  background-color: #ffc107; /* Kuning */
  color: #212529; /* Teks gelap */
}
.kss-unit-status.kss-status-sold {
  background-color: #dc3545; /* Merah */
  color: #fff;
}
/* ▲▲▲ AKHIR CSS BADGE STATUS ▲▲▲ */

.kss-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
  opacity: 1;
  backdrop-filter: blur(2px);
}
.kss-loading-overlay.kss-hidden {
  opacity: 0;
  visibility: hidden;
}
.kss-loading-overlay span {
  font-size: 15px;
  padding: 12px 20px;
  background: #ffffff;
  border-radius: 6px;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-weight: 500;
}

/* --- CSS untuk Galeri Modal (Lightbox) --- */
.kss-gallery-modal {
  position: fixed;
  z-index: 100001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.kss-gallery-modal.kss-gallery-visible {
  display: block;
  opacity: 1;
}
.kss-gallery-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 1012;
}
.kss-gallery-close:hover,
.kss-gallery-close:focus {
  color: #bbb;
  text-decoration: none;
}
.kss-gallery-content {
  position: relative;
  margin: auto;
  padding: 0;
  width: 85%;
  max-width: 1000px;
  top: 50%;
  transform: translateY(-50%);
}
.kss-gallery-slide-container {
  display: flex;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.kss-gallery-slide {
  display: none;
  width: 100%;
  flex-shrink: 0;
  animation: kssFade 0.5s;
  overflow: hidden;
  border-radius: 16px;
}
.kss-gallery-slide.kss-slide-active {
  display: block;
}
.kss-gallery-slide img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  margin: auto;
}
.kss-gallery-prev,
.kss-gallery-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: 0.3s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  -webkit-user-select: none;
  z-index: 1011;
  background-color: rgba(0, 0, 0, 0.5);
}
.kss-gallery-next {
  right: 0;
  border-radius: 3px 0 0 3px;
}
.kss-gallery-prev:hover,
.kss-gallery-next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}
.kss-gallery-caption {
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  font-size: 16px;
}

/* --- Style untuk Judul Galeri --- */
.kss-gallery-title {
  color: #fff;
  text-align: center;
  font-size: 16px; /* Diperkecil lagi */
  font-weight: 500;
  padding: 8px 15px; /* Padding diperkecil lagi */
  margin: 0 auto; /* Pastikan margin 0 */
  line-height: 1.3;
  display: none; /* Sembunyi by default */

  /* Properti untuk memaksanya satu baris */
  width: 100%; /* Paksa lebar 100% dari parent */
  box-sizing: border-box; /* Pastikan padding tidak menambah lebar */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Style untuk TOOLTIP TOMBOL (Class Baru) */
.kss-button-tooltip-title {
  font-size: 9px; /* Teks lebih kecil */
  font-weight: 500; /* Teks lebih tipis */
  margin-bottom: 0; /* Hapus margin bawah */
  color: #000;
  white-space: nowrap; /* Paksa teks jadi satu baris */
}

/* --- CSS BARU UNTUK INDIKATOR DOTS (Kontras Tinggi) --- */
.kss-tooltip-gallery-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
  z-index: 5;
  pointer-events: none;
}

.kss-tooltip-gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5); /* Hitam semi-transparan (default) */
  margin: 0 4px;
  transition: all 0.3s ease;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3); /* Bayangan halus */
}

.kss-tooltip-gallery-dot.kss-dot-active {
  width: 16px; /* "panjang" */
  background-color: #fff; /* "putih" (aktif) */
  border-radius: 3px;
}
@keyframes kssFade {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

/* Responsive adjustments */
/* Responsive adjustments */
@media (max-width: 768px) and (orientation: portrait) {
  /* ▼▼▼ PERUBAHAN UNTUK POPUP UNIT DI MOBILE (Hybrid) ▼▼▼ */
  .kss-popup.kss-popup-unit {
    /* 1. Paksa ke tengah HORIZONTAL */
    left: 50% !important;

    /* 2. JANGAN paksa posisi vertikal (top/bottom) */
    /* Biarkan JavaScript yang menentukan 'top' agar tetap dekat area */

    /* 3. Gunakan transform HANYA untuk centering horizontal */
    /* Kita hapus 'translateY' agar 'top' dari JS berfungsi */
    transform: translateX(-50%) !important;

    /* 4. Atur max-width agar proporsional (dari kode Anda) */
    max-width: 90vw !important;
    width: auto !important; /* Biarkan konten yg menentukan */

    /* 5. (Opsional) Perkecil font agar lebih proporsional */
    font-size: 13px;
  }

  /* 6. Perkecil juga font di dalam popup agar pas */
  .kss-popup.kss-popup-unit .kss-popup-title {
    font-size: 16px;
  }
  .kss-popup.kss-popup-unit .kss-unit-details li {
    font-size: 13px;
    padding: 8px 0; /* Perkecil padding list */
  }
  .kss-popup.kss-popup-unit .kss-popup-link {
    font-size: 14px;
    padding: 10px 16px; /* Perkecil padding tombol */
  }
  .kss-popup.kss-popup-unit .kss-popup-header {
    padding: 10px 16px; /* Perkecil padding header */
  }
  .kss-popup.kss-popup-unit .kss-unit-image {
    padding: 16px 16px 0 16px; /* Perkecil padding gambar */
  }
  .kss-popup.kss-popup-unit .kss-unit-details {
    margin: 12px 16px; /* Perkecil margin list */
  }
  .kss-popup.kss-popup-unit .kss-unit-link-wrapper {
    padding: 0 16px 16px 16px; /* Perkecil padding tombol */
  }

  /* --- Aturan galeri Anda yang sudah ada (tidak berubah) --- */
  .kss-gallery-content {
    width: 95%;
  }

  .kss-gallery-prev,
  .kss-gallery-next {
    padding: 10px;
  }
}

/* --- Mobile Landscape Popup Scaling (Max Height 600px) --- */
@media (orientation: landscape) and (max-height: 600px) {
  .kss-popup.kss-popup-unit {
    /* Override mobile centering - let JS position it (Left/Right) */
    /* left: auto !important; REMOVED to let JS set it */
    transform: none !important;

    /* Scale down significantly */
    max-width: 240px !important;
    width: auto !important;
    padding: 0 !important;
  }

  .kss-popup.kss-popup-unit .kss-popup-header {
    padding: 6px 10px !important;
  }

  .kss-popup.kss-popup-unit .kss-popup-title {
    font-size: 13px !important;
    margin-bottom: 0 !important;
  }

  .kss-popup.kss-popup-unit .kss-unit-image {
    padding: 8px 10px 0 10px !important;
  }

  .kss-popup.kss-popup-unit .kss-unit-image img {
    max-height: 100px !important; /* Smaller images */
  }

  .kss-popup.kss-popup-unit .kss-unit-details {
    margin: 8px 10px !important;
  }

  .kss-popup.kss-popup-unit .kss-unit-details li {
    font-size: 11px !important;
    padding: 3px 0 !important;
  }

  .kss-popup.kss-popup-unit .kss-unit-link-wrapper {
    padding: 0 10px 10px 10px !important;
  }

  .kss-popup.kss-popup-unit .kss-popup-link,
  .kss-popup.kss-popup-unit .kss-btn-details {
    font-size: 11px !important;
    padding: 6px 10px !important;
    margin-top: 5px !important;
  }

  /* Also scale Fasum popup if needed */
  .kss-popup.kss-popup-jalan {
    font-size: 11px !important;
    padding: 8px !important;
    max-width: 200px !important;
  }
}

/* --- Fullscreen Mode Styles --- */
.kss-fullscreen {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important; /* Fix for iOS Safari address bar */
  z-index: 999999999 !important; /* Fix for z-index wars */
  background-color: #fff;
  margin: 0 !important;
  border: none !important;
  display: flex;
  flex-direction: row; /* Map Left, Panel Right */
  overflow: hidden;
}

.kss-fullscreen .kss-image-container {
  flex-grow: 1;
  height: 100%;
  overflow: auto;
  background-color: #f0f0f0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kss-fullscreen .kss-siteplan-image {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  display: block;
}

.kss-fullscreen .kss-svg-overlay {
  /* SVG should match image position naturally */
  position: absolute !important;
  /* Do NOT use transform centering - breaks click detection */
}

/* Fullscreen Buttons */
.kss-fullscreen-btn,
.kss-exit-fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 100000; /* Above everything including fullscreen container */
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

/* In fullscreen mode, exit button should be positioned relative to image container */
.kss-fullscreen .kss-exit-fullscreen-btn {
  position: absolute;
  /* Position will be set by parent (image container) */
}

.kss-fullscreen-btn:hover,
.kss-exit-fullscreen-btn:hover {
  background-color: #fff;
  transform: scale(1.05);
}

.kss-fullscreen-btn svg,
.kss-exit-fullscreen-btn svg {
  width: 20px;
  height: 20px;
  color: #333;
}

/* Side Panel */
.kss-side-panel {
  display: none; /* Hidden by default */
  width: 300px;
  min-width: 250px;
  max-width: 35%;
  height: 100%;
  background-color: #fff;
  border-left: 1px solid #ddd;
  flex-direction: column;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1003;
}

.kss-fullscreen .kss-side-panel {
  display: flex; /* Visible in fullscreen */
}

.kss-side-panel-header {
  padding: 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f9f9f9;
}

.kss-side-panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.kss-side-panel-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
}

.kss-side-panel-close:hover {
  color: #333;
}

.kss-side-panel-content {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden; /* Force hide horizontal scroll */
  width: 100%;
  box-sizing: border-box;
}

.kss-side-panel-placeholder {
  text-align: center;
  color: #777;
  margin-top: 50px;
  font-style: italic;
}

/* Side Panel Content Styling (Reuse Popup Styles) */
.kss-side-panel .kss-popup-title {
  font-size: 16px; /* Reduced from 20px */
  margin-bottom: 10px;
  display: block;
}

.kss-side-panel .kss-unit-image img,
.kss-side-panel .kss-tooltip-image {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 15px;
}

.kss-side-panel .kss-unit-details {
  margin: 15px 0;
  padding: 0;
}

.kss-side-panel .kss-unit-details li {
  padding: 12px 0;
  font-size: 15px;
}

.kss-side-panel .kss-popup-link {
  text-align: center;
  margin-top: 20px;
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
}

/* Custom Button Style (Mimics Theme) */
.kss-btn-details {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background-color: #9f7844; /* Gold/Brown color from screenshot */
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  border-radius: 30px; /* Rounded pill shape */
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-sizing: border-box;
  margin-top: 15px;
}

.kss-btn-details:hover {
  background-color: #8a6636; /* Slightly darker on hover */
  color: #ffffff;
  transform: translateY(-2px);
}

/* Fix Button Wrapper Padding in Side Panel */
.kss-side-panel .kss-unit-link-wrapper {
  padding: 0 20px 20px 20px !important;
  width: 100%;
  box-sizing: border-box;
}

/* === iOS OPTIMIZED MODE (Landscape Only - Overlay Approach) === */
.kss-ios-optimized {
  /* Take over the viewport like modal */
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: #f9f9f9 !important;
  z-index: 999999 !important;
  overflow: hidden !important;
}

/* iOS: Map container takes FULL space (preserves SVG coordinates) */
.kss-ios-optimized .kss-image-container {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* iOS: Side panel - OVERLAY on top right (extremely compact) */
.kss-ios-optimized .kss-side-panel {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 180px !important;
  max-width: 180px !important;
  height: 100% !important;
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-left: 1px solid #ddd !important;
  overflow-y: auto !important;
  font-size: 11px !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1) !important;
}

/* iOS: Side panel header - ultra compact */
.kss-ios-optimized .kss-side-panel-header {
  padding: 8px 10px !important;
  background-color: rgba(249, 249, 249, 0.95) !important;
  border-bottom: 1px solid #e0e0e0 !important;
}

.kss-ios-optimized .kss-side-panel-title {
  font-size: 13px !important;
  font-weight: 600 !important;
  margin: 0 !important;
}

.kss-ios-optimized .kss-side-panel-close {
  font-size: 20px !important;
  width: 24px !important;
  height: 24px !important;
  line-height: 22px !important;
}

/* iOS: Side panel content - minimal padding */
.kss-ios-optimized .kss-side-panel-content {
  padding: 10px !important;
  flex: 1 !important;
  overflow-y: auto !important;
}

/* iOS: Popup title - compact */
.kss-ios-optimized .kss-popup-title {
  font-size: 13px !important;
  margin-bottom: 8px !important;
  font-weight: 600 !important;
}

/* iOS: Status badge - smaller */
.kss-ios-optimized .kss-unit-status {
  font-size: 10px !important;
  padding: 2px 6px !important;
}

/* iOS: Unit details list - very compact */
.kss-ios-optimized .kss-unit-details {
  margin: 8px 0 !important;
}

.kss-ios-optimized .kss-unit-details li {
  padding: 4px 0 !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
  border-bottom: 1px solid #f0f0f0 !important;
}

.kss-ios-optimized .kss-unit-details li strong {
  font-size: 10px !important;
  display: block !important;
  margin-bottom: 2px !important;
  color: #666 !important;
}

.kss-ios-optimized .kss-unit-details li span {
  font-size: 11px !important;
  font-weight: 500 !important;
}

/* iOS: Images - very small */
.kss-ios-optimized .kss-unit-image img,
.kss-ios-optimized .kss-tooltip-image {
  max-height: 120px !important;
  object-fit: cover !important;
  border-radius: 4px !important;
}

/* iOS: Button - ultra compact */
.kss-ios-optimized .kss-btn-details {
  padding: 8px 12px !important;
  font-size: 11px !important;
  margin-top: 10px !important;
  border-radius: 4px !important;
}

/* iOS: Exit button positioning */
.kss-ios-optimized .kss-exit-fullscreen-btn {
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  z-index: 1000 !important;
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-radius: 4px !important;
  padding: 8px !important;
}

/* iOS: Hide normal popups */
.kss-ios-optimized .kss-popup {
  display: none !important;
}

/* Hide fullscreen button on ALL iOS devices (portrait and landscape) */
@supports (-webkit-touch-callout: none) {
  /* This targets iOS Safari and other iOS browsers */
  .kss-fullscreen-btn {
    display: none !important;
  }
}

/* === FULLSCREEN MODE (Android/Desktop) === */
.kss-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  width: 100dvw !important; /* Dynamic viewport width for better iOS support */
  height: 100vh !important;
  height: 100dvh !important; /* Dynamic viewport height for iOS */
  max-width: none !important;
  margin: 0 !important;
  border: none !important;
  background-color: #f9f9f9 !important;
  z-index: 999999999 !important; /* Ensure it's above everything */
  overflow: hidden !important;
}

/* Hide normal popups in fullscreen */
.kss-fullscreen .kss-popup {
  display: none !important;
}

/* Mobile Landscape Adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .kss-side-panel {
    width: 35%;
    min-width: 220px;
  }
}

/* Mobile Portrait - Force Landscape Layout */
@media screen and (orientation: portrait) {
  .kss-fullscreen {
    width: 100vh !important;
    width: 100dvh !important; /* Fix for iOS */
    height: 100vw !important;
    transform: rotate(90deg);
    transform-origin: top left;
    left: 100% !important;
    top: 0 !important;
  }

  .kss-fullscreen .kss-side-panel {
    width: 300px !important;
    max-width: 40% !important;
    min-width: 200px !important;
  }
}

/* --- FIX: Button Sizing & Overflow --- */
/* (Old aggressive resets removed as we now use a custom class) */

/* 2. Fix "Too Big" Button on Mobile */
@media (max-width: 768px) {
  .kss-popup .elementor-button {
    padding: 8px 12px !important; /* Reduce padding significantly */
    font-size: 12px !important; /* Reduce font size */
    min-height: auto !important; /* Remove min-height constraints */
    line-height: 1.2 !important; /* Tighten line height */
    height: auto !important;
  }

  .kss-popup .elementor-button-content-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
