/* ========== ZOOM OVERLAY  ========== */
.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(18 18 18 / 90%);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  animation: fadeInZoom 0.2s ease-out forwards;
  pointer-events: auto !important;
  touch-action: auto !important;
  -webkit-user-select: auto !important;
  user-select: auto !important;
}
.zoom-overlay. zoom-info {
    position: relative;
    width: 100%;0
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============== ZOOM CONTENT  ================*/
.zoom-content {
    position: absolute;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    height: 50%;
    top: 100px;
}

.zoom-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-content-info {
    position: absolute;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    height: 35%;
    bottom: 10px;
    width: 100%;
    line-height: 0.8;
}
/* ---------- PANEL INFO ---------- */
.zoom-info {
  background: rgb(10 73 43 / 85%);
  color: white;
  padding: 0px;
  font-size: 12px;
  line-height: 1.4;
  max-height: 40vh;
  overflow-y: auto;
  border-radius: 8px;
  display: none;
  flex: 1;
}

.zoom-info.show {
  display: block;
  background: rgba(0,0,0,0.85);  /* Latar hitam transparan */
  color: yellow;
  padding: 12px;
  font-size: 12px;
  line-height: 1.4;
  max-height: 30vh;
  overflow-y: auto;
  border-radius: 8px;
  display: none;
}
}

.zoom-part-number {
  font-weight: bold;
  color: #4fc3f7;
  margin-bottom: 6px;
}

.zoom-desc, .zoom-dim {
  font-family: monospace;
  white-space: pre-wrap;
  margin: 0;
}

.zoom-dim {
  color: #4fc3f7;
}



/* ---------- ZOOM GALLERY CONTAINER ---------- */

.zoom-gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    overflow: hidden;
    touch-action: none;
    cursor: default;
}


.zoom-gallery-container--grabbing {
    cursor: grabbing !important;
}

#mainZoomImage {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
    transform-origin: center center;
    will-change: transform;
    touch-action: manipulation;
    
    user-select: none;
    touch-action: auto !important;   
    user-select: auto !important;
 


}


    .gallery-nav.prev-btn {
        left: 10px;
    }
    
    .gallery-nav.next-btn {
        right: 10px;
    }
    
    .thumbnail-item {
        flex: 0 0 45px;
        height: 45px;
    }
    
    .gallery-counter {
        bottom: 10px;
        left: 10px;
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .wa-icon {
        width: 35px;
        height: 35px;
    }
    

    
    .zoom-tool {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    

    

/* Thumbnail tetap pakai pan-y */
.part-image,
.part-item img {
    touch-action: pan-y !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}


/* ---------- PANEL INFO ---------- */

.zoom-part-number {
  font-weight: bold;
  color: #4fc3f7;
  margin-bottom: 6px;
}

.zoom-desc, .zoom-dim {
  font-family: monospace;
  white-space: pre-wrap;
  margin: 0;
}

.zoom-dim {
  color: #4fc3f7;
}


/* ---------- ZOOM TOOLS (TOMBOL INFO) ---------- */
.zoom-tools {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 10;

}

.zoom-tool {
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.zoom-tool:hover {
  background: rgba(0,0,0,0.9);
}


/* WhatsApp Button di Zoom Overlay */
.zoom-whatsapp-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid #25D366;
}

.zoom-whatsapp-btn:hover {
    transform: scale(1.1);
    background: white;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

.zoom-whatsapp-btn:active {
    transform: scale(0.95);
}

.zoom-whatsapp-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}



/* Image Navigation di Zoom */
.zoom-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
    transition: all 0.2s;
}

.zoom-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 101;
    display: flex;
    align-items: center;
    gap: 5px;
}

.current-image {
    color: #25D366;
}

/* Zoom Navigation */
.zoom-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 100;
}

.zoom-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
}

.zoom-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.prev-image {
    left: 20px;
}

.next-image {
    right: 20px;
}

.multi-image-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(25, 118, 210, 0.95);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.3);
    pointer-events: none;
}


/* Status display untuk debug (opsional) */
.zoom-status {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: #4CAF50;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 25;
    display: none;
}

.zoom-status.show {
    display: block;
}


/* ---------- TOMBOL NAVIGASI GALLERY NAV PRE BTN ---------- */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
    z-index: 20;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}


/* ---------- COUNTER GAMBAR ---------- */
.gallery-counter {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 20;
}

.current-image {
    color: #25D366;
}

.total-images {
    color: white;
}


/* ---------- THUMBNAIL STRIP ---------- */
.thumbnail-strip {
    width: 100%;
    background: #111;
    padding: 10px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.thumbnail-container {
    display: flex;
    gap: 8px;
    padding: 0 15px;
    justify-content: center;
}

.thumbnail-item {
    flex: 0 0 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.thumbnail-item:hover {
    border-color: #666;
}

.thumbnail-item.active {
    border-color: #1976d2;
    transform: scale(1.05);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-item.active {
    border-color: #1976d2;
    transform: scale(1.05);
}

/* ========== TEXT STYLES ========== */
.part-number {
  font-weight: bold;
  font-size: 11px;
  display: block;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: white;
  padding: 2px 0;
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  line-height: 1.2;
  margin: 0;
}

.dim-ket {
  font-size: 9px;
  color: #666;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 0;
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  line-height: 1.2;
  margin: 0;
}

.part-desc {
  display: block;
  font-size: 11px;
  color: #666;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-name {
    font-size: 9px;
    color: #666;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    line-height: 1.2;
}

.text-container {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 30px;
}

/* ========== NO IMAGE PLACEHOLDER ========== */
.image-container .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    color: #999;
    font-size: 10px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: absolute;
    top: 0;
    left: 0;
}

.part-image.image-error {
    display: none;
}

.part-image.image-error + .no-image-fallback {
    display: flex !important;
}

.no-image-fallback {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    color: #999;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.part-image.no-image-placeholder {
    opacity: 0.7;
    filter: grayscale(30%);
}



/* ========== KOMPATIBILITAS ========== */
.compatibility-section {
    padding: 15px;
    text-align: left;
}

.compatibility-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.compatibility-list {
    max-height: 300px;
    overflow-y: auto;
}

.compatibility-text {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 3px solid #2196F3;
}

.compatibility-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compatibility-items li {
    padding: 8px 12px;
    margin: 5px 0;
    background: #f5f5f5;
    border-radius: 4px;
    border-left: 3px solid #4CAF50;
}

.equivalent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.equivalent-chip {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.cross-reference {
    margin-top: 15px;
}

.cross-reference h5 {
    color: #666;
    margin: 0 0 8px 0;
    font-size: 14px;
}

.cross-ref-content {
    padding: 10px;
    background: #fff8e1;
    border-radius: 5px;
    font-size: 13px;
    color: #5d4037;
    border: 1px solid #ffecb3;
}

.no-compatibility {
    text-align: center;
    padding: 30px 20px;
    color: #999;
}

.sparepart-compatibility,
.filter-compatibility {
    padding: 20px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
}

.compat-header h4 {
    margin: 0;
    color: #1976d2;
    font-size: 18px;
}

.part-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid #bbdefb;
}

.compat-section {
    margin-bottom: 25px;
    padding: 18px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
    font-size: 16px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #ddd;
}

.section-content {
    padding: 0 5px;
}

/* Keterangan Styles */
.single-keterangan {
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
    line-height: 1.5;
}

.keterangan-list {
    margin: 0;
    padding-left: 20px;
}

.keterangan-list li {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #2196F3;
}

/* Grid Styles */
.vehicle-grid,
.component-grid,
.tech-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vehicle-item,
.component-item,
.tech-item {
    display: flex;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.label {
    flex: 0 0 120px;
    color: #1976d2;
    font-weight: 600;
    padding-right: 10px;
    border-right: 1px solid #eee;
}

.value {
    flex: 1;
    padding-left: 10px;
    color: #333;
}

/* No Data State */
.no-data-section {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #ddd;
}

.no-data-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #9e9e9e;
}

.no-data-section h5 {
    color: #666;
    margin: 10px 0;
}

.no-data-section p {
    color: #888;
    margin: 5px 0;
}

.note {
    font-size: 13px;
    font-style: italic;
    color: #999;
}

/* ========== LOADING & ERROR STATES ========== */
.loading-state, .no-data, .error {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.loading-state {
  color: #666;
}

.no-data {
  color: #999;
}

.error {
  color: #f44336;
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

.retry-btn {
  margin-top: 20px;
  padding: 10px 20px;
  background: #2196F3;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.retry-btn:hover {
  background: #1976D2;
}

/* ========== ANIMATIONS ========== */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInZoom {
  from { 
    opacity: 0; 
    transform: scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: scale(1); 
  }
}


/* ========== ZOOM COMPATIBILITY ========== */
.zoom-compatibility {
    background: white;
    max-width: 95vw;
    max-height: 30vh;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
}

.zoom-compatibility h4 {
    display: none;
}

.loading-compat {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.api-error {
    padding: 20px;
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    color: #c62828;
    font-size: 13px;
}

.api-error h4 {
    margin-top: 0;
    font-size: 14px;
}

.zoom-compatibility::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.zoom-compatibility::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.zoom-compatibility::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}



.back-to-tools { 
    background: none; 
    bottom:130px;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    color: firebrick;
    left: 160px;
    position: relative;
    top: 125px;a
}



.api-error { padding: 20px; background: #fff3f3; border: 1px solid #ffcdd2; color: #c62828; font-size: 13px; }

/* ---------- TOMBOL CLOSE ---------- */

.zoom-close { 
position: absolute; 
top: 110px; right: 
10px; background: rgba(0,0,0,0.7);
color: white; 
border: none; 
width: 40px; 
height: 40px; 
border-radius: 50%;
font-size: 24px; cursor: pointer; 
display: flex; 
align-items: center; 
justify-content: center;
transition: background 0.2s; z-index: 40; }

.zoom-close:hover { background: rgba(255,0,0,0.7); }


/* ========== WHATSAPP FLOAT ========== */
.wa-float {
  position: fixed;
  bottom: 70px;
  right: 15px;
  z-index: 1001;
}

.wa-float img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.wa-float img:active {
  transform: scale(0.95);
}

/* ---------- WHATSAPP ICON ---------- */
.wa-container {
    position: absolute; 
    top: 10px; 
    left: 10px; 
    z-index: 30;
}

.wa-icon {
    width: 50px; 
    height: 50px; 
    cursor: pointer; 
    border-radius: 50%; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    object-fit: contain;
}

.wa-icon:hover {
    transform: scale(1.1);
    background: white;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

.wa-icon:active {
    transform: scale(0.95);
}