/* app.css */
:root {
  --color-primary: #cc0000;
  --color-primary-dark: #a30000;
  --color-dark: #262729;
  --color-darker: #1a1c1e;
  --color-yellow: #f6c20b;
  --color-green: #398e3d;
  --font-heading: "Poppins", sans-serif;
  --font-body: "Inter", sans-serif;
}

body {
  font-family: var(--font-body);
  color: #1a1c1e;
  background: #fff;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
}

/* Utilities */
.text-primary {
  color: var(--color-primary);
}
.text-heading {
  color: var(--color-darker);
}
.text-muted {
  color: #666;
}
.link-primary {
  color: var(--color-primary);
  font-weight: 500;
  transition: color 0.2s;
}
.link-primary:hover {
  color: var(--color-primary-dark);
}
.section-padding {
  padding: 60px 0;
}
@media (min-width: 768px) {
  .section-padding {
    padding: 80px 0;
  }
}
.bg-light-gray {
  background-color: #f9fafb;
}
.bg-dark {
  background-color: var(--color-dark);
}
.bg-darker {
  background-color: var(--color-darker);
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
}
.btn-dark {
  background: var(--color-darker);
  color: #fff;
}
.btn-dark:hover {
  background: #000;
}
.btn-outline {
  background: transparent;
  border: 1px solid #ddd;
  color: #1a1c1e;
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-wa {
  background: var(--color-green);
  color: #fff;
}
.btn-wa:hover {
  background: #2d7232;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.3s;
}
.card:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.card-body {
  padding: 20px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 2px;
  text-transform: uppercase;
}
.badge-primary {
  background: #fee2e2;
  color: #991b1b;
}
.badge-dark {
  background: #1a1c1e;
  color: #fff;
}
.badge-yellow {
  background: var(--color-yellow);
  color: #000;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  border-radius: 4px;
  outline: none;
  transition: border 0.2s;
  font-family: var(--font-body);
}
.form-input:focus {
  border-color: var(--color-primary);
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}
.form-hint {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* Sections */
.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
@media (max-width: 768px) {
  .section-title h2 {
    font-size: 22px;
  }
}
.section-title p {
  color: #666;
  font-size: 14px;
}
.section-divider {
  width: 60px;
  height: 3px;
  background: var(--color-primary);
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #999;
  margin-bottom: 20px;
}
.breadcrumb a {
  color: #666;
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--color-primary);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 4px;
}

/* WhatsApp Floating Button */
.wa-button {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 1.2vw, 10px);
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  padding: clamp(10px, 1.8vw, 14px) clamp(14px, 2.4vw, 22px);
  text-decoration: none;
  font-family: "Inter", sans-serif;
  font-size: clamp(11px, 1.6vw, 14px);
  font-weight: 700;
  box-shadow:
    0 6px 20px rgba(37, 211, 102, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .wa-button {
    transform: scale(1.18);
  }
}
.wa-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5);
}
.wa-button:active {
  transform: translateY(0);
}
.wa-button .wa-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.wa-button .wa-label {
  font-size: clamp(7px, 1.1vw, 10px);
  font-weight: 500;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.wa-button .wa-number {
  font-size: clamp(11px, 1.8vw, 14px);
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* Animations */
.pulse-ring,
.pulse-ring-2 {
  position: absolute;
  left: clamp(16px, 2.4vw, 22px);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  animation: pulse-ring 1.8s ease-out infinite;
  pointer-events: none;
}
.pulse-ring-2 {
  border: 2px solid rgba(255, 255, 255, 0.4);
  animation: pulse-ring 1.8s ease-out 0.6s infinite;
}
@keyframes pulse-ring {
  0% {
    width: 20px;
    height: 20px;
    opacity: 1;
  }
  100% {
    width: 52px;
    height: 52px;
    opacity: 0;
  }
}

.shine-effect {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.shine-effect::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 35%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.08) 65%,
    transparent 100%
  );
  transform: skewX(-25deg);
}
.group\/card:hover .shine-effect::before {
  animation: shineSweep 0.9s ease forwards;
}
@keyframes shineSweep {
  from {
    left: -80%;
  }
  to {
    left: 140%;
  }
}

/* Custom Line Clamp 3 Baris (Desktop Only) */
.desc-clamp-3 {
  display: none;
}
@media (min-width: 768px) {
  .desc-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Custom Line Clamp 3 Baris (Desktop Only - Untuk Kartu Fuso) */
.desc-clamp-3 {
  display: none; /* Hidden di mobile */
}
@media (min-width: 768px) {
  .desc-clamp-3 {
    display: -webkit-box !important;
    display: box !important;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Custom Line Clamp 4 Baris (Semua Layar - Untuk Kartu Testimoni) */
.desc-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Custom Vehicle Select Dropdown */
.custom-select {
  position: relative;
  width: 100%;
}
.select-trigger {
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #1a1c1e;
  transition: border-color 0.2s;
}
.select-trigger:hover {
  border-color: #999;
}
.custom-select.open .select-trigger {
  border-color: #cc0000;
}
.custom-select.open .chevron {
  transform: rotate(180deg);
}
.chevron {
  transition: transform 0.2s;
}

.select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  margin-top: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.custom-select.open .select-dropdown {
  display: block;
}

.select-group-label {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  color: #666;
  background: #f9f9f9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f0f0f0;
}
.select-subgroup-header {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1c1e;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}
.select-subgroup-header::after {
  content: "+";
  font-size: 18px;
  font-weight: 400;
  color: #999;
}
.select-subgroup.expanded .select-subgroup-header::after {
  content: "-";
  color: #cc0000;
}
.select-subgroup-items {
  display: none;
}
.select-subgroup.expanded .select-subgroup-items {
  display: block;
}

.select-option {
  padding: 8px 24px;
  font-size: 13px;
  cursor: pointer;
  color: #333;
  border-bottom: 1px solid #f9f9f9;
}
.select-option:hover {
  background: #fee2e2;
  color: #cc0000;
}

/* Animasi Stagger Share Button Mobile */
.mobile-share-popup {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.9);
  transform-origin: top right;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-share-popup.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.mobile-share-item {
  opacity: 0;
  transform: translateX(20px);
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Efek Stagger (Muncul satu per satu) */
.mobile-share-popup.active .mobile-share-item:nth-child(1) {
  transition-delay: 0.05s;
}
.mobile-share-popup.active .mobile-share-item:nth-child(2) {
  transition-delay: 0.1s;
}
.mobile-share-popup.active .mobile-share-item:nth-child(3) {
  transition-delay: 0.15s;
}
.mobile-share-popup.active .mobile-share-item:nth-child(4) {
  transition-delay: 0.2s;
}

.mobile-share-popup.active .mobile-share-item {
  opacity: 1;
  transform: translateX(0);
}

/* =========================================================
   OVERRIDE TAILWIND PROSE UNTUK ARTIKEL PROMO
========================================================= */

#article-content {
  color: #202124 !important;
}

#article-content h1,
#article-content h2,
#article-content h3,
#article-content h4,
#article-content h5,
#article-content h6 {
  font-weight: 700 !important;
  color: #262729 !important;
  margin-top: 24px !important;
  margin-bottom: 12px !important;
}
#article-content h1 {
  font-size: 32px !important;
  line-height: 1.25 !important;
}
#article-content h2 {
  font-size: 26px !important;
  line-height: 1.3 !important;
}
#article-content h3 {
  font-size: 21px !important;
  line-height: 1.4 !important;
}
#article-content h4 {
  font-size: 18px !important;
  line-height: 1.4 !important;
}
#article-content h5 {
  font-size: 16px !important;
  line-height: 1.4 !important;
}
#article-content h6 {
  font-size: 14px !important;
  line-height: 1.4 !important;
  text-transform: uppercase !important;
}

#article-content p {
  margin-bottom: 16px !important;
  line-height: 1.8 !important;
}

/* BLOCKQUOTE */
#article-content blockquote {
  margin: 24px 0 !important;
  padding: 16px 20px !important;
  border-left: 4px solid #cc0000 !important;
  background: #f8f8f8 !important;
  color: #202124 !important;
}

/* TABLE */
#article-content figure.table {
  margin: 24px 0 !important;
}
#article-content table {
  width: 100% !important;
  border-collapse: collapse !important;
}
#article-content table td,
#article-content table th {
  border: 1px solid #d9dce1 !important;
  padding: 8px !important;
}

/* LINK */
#article-content a {
  color: #cc0000 !important;
  text-decoration: underline !important;
}

/* =========================================================
   TYPOGRAPHY & LINE SPACING (JARAK BARIS) ARTIKEL FRONTEND
========================================================= */

/* Pengaturan jarak baris untuk Paragraf */
#article-content {
  line-height: 1.8 !important; /* <--- ATUR JARAK BARIS PARAGRAF DI SINI */
}
#article-content p {
  margin-bottom: 16px !important;
}

/* Pengaturan jarak baris untuk Judul (Heading) dibuat lebih rapat */
#article-content h1,
#article-content h2,
#article-content h3,
#article-content h4,
#article-content h5,
#article-content h6 {
  line-height: 1.3 !important; /* <--- ATUR JARAK BARIS JUDUL DI SINI */
}

/* =========================================================
   LIST (BULLETS & NUMBERS) - KONTROL MANUAL
========================================================= */

/* Hilangkan margin pada tag <p> di dalam <li> agar tidak ada spasi aneh */
:is(#editor-container.ck-content, #article-content) li p {
  margin-bottom: 0 !important;
  margin-top: 0 !important;
}

/* Pengaturan Dasar List */
:is(#editor-container.ck-content, #article-content) ul,
:is(#editor-container.ck-content, #article-content) ol {
  padding-left: 1px !important;
  margin-bottom: 16px !important;
  margin-top: 8px !important;
}

:is(#editor-container.ck-content, #article-content) li {
  margin-bottom: 8px !important;
  line-height: 1.8 !important;
  padding-left: 4px !important;
}

/* Agar Sub-list (Tab) tetap menjorok tapi TIDAK mengubah bentuknya otomatis */
:is(#editor-container.ck-content, #article-content) :is(ul, ol) :is(ul, ol) {
  padding-left: 1px !important;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
}

/* ==========================================
   CLASS PILIHAN MANUAL (Dari Dropdown Style)
   ========================================== */
:is(#editor-container.ck-content, #article-content) ul.list-circle,
:is(#editor-container.ck-content, #article-content) ul.list-circle li {
  list-style-type: circle !important;
}

:is(#editor-container.ck-content, #article-content) ul.list-square,
:is(#editor-container.ck-content, #article-content) ul.list-square li {
  list-style-type: square !important;
}

:is(#editor-container.ck-content, #article-content) ol.list-zero,
:is(#editor-container.ck-content, #article-content) ol.list-zero li {
  list-style-type: decimal-leading-zero !important;
}

:is(#editor-container.ck-content, #article-content) ol.list-roman,
:is(#editor-container.ck-content, #article-content) ol.list-roman li {
  list-style-type: lower-roman !important;
}

:is(#editor-container.ck-content, #article-content) ol.list-upper-roman,
:is(#editor-container.ck-content, #article-content) ol.list-upper-roman li {
  list-style-type: upper-roman !important;
}

:is(#editor-container.ck-content, #article-content) ol.list-alpha,
:is(#editor-container.ck-content, #article-content) ol.list-alpha li {
  list-style-type: lower-alpha !important;
}

:is(#editor-container.ck-content, #article-content) ol.list-upper-alpha,
:is(#editor-container.ck-content, #article-content) ol.list-upper-alpha li {
  list-style-type: upper-alpha !important;
}

/* Hilangkan margin atas untuk elemen pertama */
:is(#editor-container.ck-content, #article-content) > *:first-child {
  margin-top: 0 !important;
}

/* =========================================================
   STANDAR BAWAAN CKEDITOR UNTUK GAMBAR
========================================================= */

/* Dasar Gambar */
:is(#article-content, #editor-container.ck-content) .image {
  display: table;
  clear: both;
  margin: 1em auto;
  text-align: center;
}
:is(#article-content, #editor-container.ck-content) .image img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

/* In Line */
:is(#article-content, #editor-container.ck-content) .image-inline {
  display: inline-block;
  vertical-align: middle;
  margin: 0 5px;
}

/* Wrap Text (Kiri & Kanan) */
:is(#article-content, #editor-container.ck-content) .image-style-align-left,
:is(#article-content, #editor-container.ck-content)
  .image-style-block-align-left {
  float: left;
  margin-right: 1.5em;
  margin-top: 0.5em;
  margin-bottom: 1em;
}
:is(#article-content, #editor-container.ck-content) .image-style-align-right,
:is(#article-content, #editor-container.ck-content)
  .image-style-block-align-right {
  float: right;
  margin-left: 1.5em;
  margin-top: 0.5em;
  margin-bottom: 1em;
}

/* Break Text (Kiri, Tengah, Kanan) */
:is(#article-content, #editor-container.ck-content)
  .image-style-block-align-left {
  float: none;
  margin-left: 0;
  margin-right: auto;
}
:is(#article-content, #editor-container.ck-content) .image-style-align-center,
:is(#article-content, #editor-container.ck-content)
  .image-style-block-align-center {
  float: none;
  margin-left: auto;
  margin-right: auto;
}
:is(#article-content, #editor-container.ck-content)
  .image-style-block-align-right {
  float: none;
  margin-left: auto;
  margin-right: 0;
}

/* Caption Gambar */
:is(#article-content, #editor-container.ck-content) .image > figcaption {
  display: table-caption;
  caption-side: bottom;
  word-break: break-word;
  color: #333;
  background-color: #f7f7f7;
  padding: 0.6em;
  font-size: 0.75em;
  outline-offset: -1px;
  text-align: center;
}

/* ===== CSS UNTUK AI CHATBOT WIDGET ===== */
#ai-chat-button {
  position: fixed;
  bottom: 60px;
  right: 20px;
  z-index: 9999;
  background: #d71920;
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
#ai-chat-button:hover {
  transform: scale(1.05);
}
#ai-chat-window {
  position: fixed;
  bottom: 130px;
  right: 20px;
  z-index: 9999;
  width: 350px;
  max-width: calc(100% - 40px);
  height: 450px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #ddd;
}
.ai-header {
  background: #d71920;
  color: white;
  padding: 15px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-header span {
  font-size: 12px;
  font-weight: normal;
  opacity: 0.9;
}
.ai-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}
#ai-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9fafb;
}
.ai-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.ai-msg.user {
  background: #d71920;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.ai-msg.bot {
  background: #e5e7eb;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.ai-typing {
  font-size: 12px;
  color: #888;
  align-self: flex-start;
  padding: 5px 15px;
  display: none;
}
.ai-input-area {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ddd;
  background: white;
}
#ai-input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  outline: none;
}
#ai-send-btn {
  background: #d71920;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0 15px;
  margin-left: 10px;
  cursor: pointer;
  font-weight: bold;
}
#ai-send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}
