/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600;800&family=Merriweather:ital,wght@0,400;0,700;0,900;1,400&family=Montserrat:wght@400;600;700;800;900&family=Outfit:wght@400;600;700;800;900&family=Playfair+Display:ital,wght@0,600;0,800;1,600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=Poppins:wght@300;400;500;600;700;800;900&family=Roboto:wght@300;400;500;700;900&display=swap');

/* Dynamic Typography Classes */
body.font-sans, .font-sans {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

body.font-poppins, .font-poppins {
  font-family: 'Poppins', sans-serif !important;
}

body.font-inter, .font-inter {
  font-family: 'Inter', sans-serif !important;
}

body.font-roboto, .font-roboto {
  font-family: 'Roboto', sans-serif !important;
}

body.font-montserrat, .font-montserrat {
  font-family: 'Montserrat', sans-serif !important;
}

body.font-outfit, .font-outfit {
  font-family: 'Outfit', sans-serif !important;
}

body.font-playfair, .font-playfair {
  font-family: 'Playfair Display', Georgia, serif !important;
}

body.font-serif, .font-serif {
  font-family: 'Merriweather', Georgia, serif !important;
}

body.font-mono, .font-mono {
  font-family: 'JetBrains Mono', monospace !important;
}

/* Custom Scrollbar for clean look */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Force hidden elements and closed modals to never intercept mouse or touch interactions */
.hidden, [hidden] {
  display: none !important;
  pointer-events: none !important;
}

/* Disable native WebKit/Blink and MS search clear (x) buttons to prevent duplicate clear buttons */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: none !important;
}

input[type="search"]::-ms-clear,
input[type="search"]::-ms-reveal {
  display: none !important;
  width: 0;
  height: 0;
}

/* WhatsApp Pulse Animation */
@keyframes pulse-wa {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}
.whatsapp-pulse {
  animation: pulse-wa 2.5s infinite ease-in-out;
}

/* Product Card Transition */
.product-card {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-card:hover {
  transform: translateY(-2px);
}

/* ========================================================
   LIVE VISUAL IN-PLACE EDITOR (OVERLAY APPROACH)
   HANYA AKTIF DI DALAM SIMULASI HANDPHONE (.is-in-phone-frame)
   DESKTOP MURNI BERSIH & STATIS BEBAS GARIS SOROT
   ======================================================== */
body.visual-editor-active.is-in-phone-frame [data-text-key] {
  position: relative;
  outline: 1.5px dashed rgba(225, 29, 72, 0.6) !important;
  outline-offset: 2px;
  border-radius: 4px;
  cursor: pointer !important;
  transition: outline 0.15s ease, background-color 0.15s ease;
}

body.visual-editor-active.is-in-phone-frame [data-text-key]:hover {
  outline: 2px dashed #e11d48 !important;
  background-color: rgba(254, 226, 226, 0.45) !important;
}

/* KETIKA TEKS DIKLIK / AKTIF / FOCUS DI DALAM HP: WARNA BERUBAH MENJADI HITAM PEKAT */
body.visual-editor-active.is-in-phone-frame .active-editable-target,
body.visual-editor-active.is-in-phone-frame [data-text-key]:focus,
body.visual-editor-active.is-in-phone-frame [data-text-key][contenteditable="true"]:focus {
  outline: 2.5px solid #be123c !important;
  outline-offset: 3px !important;
  background-color: #ffffff !important;
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  caret-color: #000000 !important;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.35), 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  z-index: 40 !important;
}

body.visual-editor-active.is-in-phone-frame #brand-logo-icon-container {
  outline: 2px dashed #f59e0b !important;
  outline-offset: 3px;
  cursor: pointer !important;
}

body.visual-editor-active.is-in-phone-frame #brand-logo-icon-container:hover {
  outline: 2.5px solid #d97706 !important;
  transform: scale(1.08);
}

/* Sembunyikan elemen editor di desktop secara permanen */
#floating-live-editor-bar,
#live-editor-overlay-bubble {
  display: none !important;
}

/* Tampilkan HANYA saat berada di dalam frame HP editor */
body.is-in-phone-frame.visual-editor-active #floating-live-editor-bar {
  display: flex !important;
  position: fixed !important;
  bottom: 8px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 94% !important;
  max-width: 380px !important;
  padding: 8px 12px !important;
  border-radius: 16px !important;
  z-index: 9999 !important;
  animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.is-in-phone-frame.visual-editor-active #live-editor-overlay-bubble {
  display: none;
  position: fixed;
  z-index: 10005;
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.45), 0 6px 12px -3px rgba(0, 0, 0, 0.3);
  animation: bubblePop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 92vw !important;
  font-size: 11px !important;
}

body.is-in-phone-frame.visual-editor-active #live-editor-overlay-bubble:not(.hidden) {
  display: flex !important;
}

@keyframes bubblePop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Aspect Ratio Utilities (Anti-Gepeng / Anti-Distorsi) */
.aspect-\[4\/5\] { aspect-ratio: 4 / 5; }
.aspect-\[4\/3\] { aspect-ratio: 4 / 3; }
.aspect-\[3\/4\] { aspect-ratio: 3 / 4; }
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }

/* ========================================================
   RUNNING MARQUEE ANNOUNCEMENT ANIMATION
   ======================================================== */
#site-announcement-bar {
  overflow: hidden;
  position: relative;
  white-space: nowrap;
  width: 100%;
}

.marquee-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: marqueeScroll 20s linear infinite;
  will-change: transform;
}

@keyframes marqueeScroll {
  0% {
    transform: translateX(100vw);
  }
  100% {
    transform: translateX(-100%);
  }
}

#site-announcement-bar:hover .marquee-track {
  animation-play-state: paused;
}

@media (max-width: 640px) {
  .marquee-track {
    animation-duration: 16s;
  }
}

/* ========================================================
   MOBILE RESPONSIVENESS & ANTI-HORIZONTAL SCROLL
   ======================================================== */
html {
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  -webkit-tap-highlight-color: transparent;
}

/* Universal Sticky Top App Header for Mobile & Desktop */
#sticky-top-app-wrapper,
.sticky-top-app-bar {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 9999 !important;
  width: 100% !important;
  background-color: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

/* Text Wrapping Protection */
h1, h2, h3, h4, h5, h6, p, span, a, div {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Safe touch scrolling for horizontal pills */
#region-pills-container,
#category-pills-container {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Mobile Header & Modal Touch Optimization */
header {
  width: 100% !important;
  max-width: 100vw !important;
}

#brand-logo {
  min-width: 0;
}

@media (max-width: 640px) {
  .modal-content {
    max-height: 92vh !important;
    width: 95% !important;
    margin: auto;
  }

  .product-card h3 {
    font-size: 0.8125rem; /* 13px */
    line-height: 1.25;
  }
}
