/**
 * ZYNENGINE — tambahan di atas Tailwind (loader, FAB, aksesibilitas)
 */
html {
  scroll-behavior: auto;
}

body {
  -webkit-tap-highlight-color: transparent;
}

.zyn-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  font-weight: 900;
}

/* Loader */
.zyn-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(2 6 23);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.dark .zyn-loader {
  background: #07040d;
}

.zyn-loader.zyn-loader-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.zyn-loader-bar {
  width: 6rem;
  height: 3px;
  border-radius: 0;
  background: rgba(124, 58, 237, 0.25);
  overflow: hidden;
}

.zyn-loader-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  border-radius: 0;
  animation: zyn-load 1.1s ease-in-out infinite;
}

@keyframes zyn-load {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .zyn-loader-bar::after { animation: none; width: 100%; }
}

/* FAB */
.zyn-fab-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 980;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.zyn-fab {
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.zyn-fab:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* Warna merek resmi */
.zyn-fab-wa {
  background: #25d366;
}

.zyn-fab-tg {
  background: #229ed9;
}

.zyn-fab {
  border: none;
  cursor: pointer;
  font: inherit;
}

.zyn-gallery-scroll {
  -webkit-overflow-scrolling: touch;
}

/* Modal galeri produk: flex column + isi scroll (min-h-0 memperbaiki tinggi 0 di mobile) */
.zyn-gallery-modal.flex {
  min-height: 0;
}

.zyn-gallery-body {
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.zyn-gallery-item {
  margin-left: auto;
  margin-right: auto;
}

.zyn-gallery-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(78vh, 640px);
  object-fit: contain;
  object-position: center;
  background: rgba(15, 15, 20, 0.6);
}

/* Tiga gambar: batasi tinggi per item supaya ketiga thumbnail terbaca + scroll halus */
.zyn-gallery-img[data-zyn-gallery-many="1"] {
  max-height: min(34vh, 320px);
}

.zyn-product-thumb:focus-visible {
  outline: 2px solid rgb(167 139 250);
  outline-offset: 2px;
}

/* Hero: judul panjang di mobile — rapi kiri–kanir, turun dari header */
@media (max-width: 639px) {
  #beranda .zyn-hero-copy {
    width: 100%;
    padding-left: 0.125rem;
    padding-right: 0.125rem;
    box-sizing: border-box;
  }

  #beranda .zyn-hero-title {
    text-wrap: pretty;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: manual;
  }
}

/* Panel menu mobile: kurangi repaint saat geser + scroll isi */
.zyn-menu-panel {
  -webkit-overflow-scrolling: touch;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.45);
  border-radius: 0;
}

/* Multi-page: sticky bottom bar (demo mobile) */
body.zyn-has-sticky-bar {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

body.zyn-has-sticky-bar .zyn-fab-stack {
  bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
}

.zyn-sticky-bar {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Demo catalog cards */
.zyn-product-card {
  contain: layout style;
}

.zyn-product-img {
  object-fit: contain;
  object-position: center;
}

.zyn-step-card {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.zyn-step-card:hover {
  border-color: rgb(124 58 237 / 0.45);
  box-shadow: 0 4px 20px rgb(124 58 237 / 0.08);
}

/* Komunitas cards */
.zyn-community-card {
  min-height: 140px;
}

/* Active nav highlight */
.zyn-nav-link[aria-current="page"] {
  font-weight: 700;
}

/* FAB rounded on mobile for better touch */
@media (max-width: 767px) {
  .zyn-fab {
    border-radius: 9999px;
    width: 3.5rem;
    height: 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zyn-step-card,
  .zyn-product-card,
  .zyn-fab {
    transition: none;
  }
}

/* Demo iframe layar penuh */
body.zyn-demo-fullscreen {
  margin: 0;
  overflow: hidden;
  background: #000;
}

/* Form mulai.php — flat fields */
.zyn-field {
  min-height: 48px;
  border-radius: 0.5rem;
  border: 1px solid rgb(203 213 225);
  background: #fff;
  padding: 0.75rem 1rem;
  color: rgb(15 23 42);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dark .zyn-field {
  border-color: rgb(124 58 237 / 0.35);
  background: #161022;
  color: rgb(241 245 249);
}

select.zyn-field,
select.zyn-select {
  cursor: pointer;
  appearance: auto;
}

select.zyn-field option,
select.zyn-select option {
  background-color: #fff;
  color: #0f172a;
}

.dark select.zyn-field option,
.dark select.zyn-select option {
  background-color: #161022;
  color: #f1f5f9;
}

html.dark {
  color-scheme: dark;
}

.zyn-thanks-link {
  pointer-events: auto;
  text-decoration: none;
}

.zyn-field:focus {
  outline: none;
  border-color: rgb(124 58 237);
  box-shadow: 0 0 0 3px rgb(124 58 237 / 0.22);
}

.zyn-btn-primary {
  min-height: 48px;
  border-radius: 0.5rem;
  background: rgb(124 58 237);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  transition: background 0.15s ease;
}

.zyn-btn-primary:hover {
  background: rgb(139 92 246);
}

.zyn-btn-primary:active {
  background: rgb(109 40 217);
}

.zyn-textarea {
  min-height: 5.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  line-height: 1.5;
}

.zyn-checkbox {
  accent-color: rgb(124 58 237);
}
