
/* Tile Mega Menu — Modern E-commerce Enhanced (2025) */

/* Design Tokens */
:root {
  --mm2-bg: #ffffff;
  --mm2-surface: #ffffff;
  --mm2-surface-elevated: rgba(255,255,255,0.98);
  --mm2-muted: #f8fafc;
  --mm2-border: #e2e8f0;
  --mm2-border-strong: #cbd5e1;
  --mm2-accent: #6366f1;
  --mm2-accent-hover: #4f46e5;
  --mm2-accent-10: rgba(99,102,241,.10);
  --mm2-accent-20: rgba(99,102,241,.20);
  --mm2-fg: #0f172a;
  --mm2-fg-muted: #64748b;
  --mm2-fg-light: #94a3b8;
  
  /* Enhanced Shadows - Multi-layer elevation */
  --mm2-shadow-sm: 0 2px 8px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --mm2-shadow-md: 0 8px 24px rgba(15,23,42,.10), 0 2px 8px rgba(15,23,42,.06);
  --mm2-shadow-lg: 0 20px 60px rgba(15,23,42,.14), 0 8px 24px rgba(15,23,42,.08);
  --mm2-shadow-xl: 0 32px 80px rgba(15,23,42,.18), 0 12px 32px rgba(15,23,42,.10);
  --mm2-shadow-hover: 0 16px 40px rgba(15,23,42,.16), 0 6px 16px rgba(15,23,42,.08);
  
  /* Border Radius */
  --mm2-radius-xl: 20px;
  --mm2-radius-lg: 16px;
  --mm2-radius-md: 12px;
  --mm2-radius-sm: 10px;
  
  --mm2-z: 60;
  
  /* Animation Timing */
  --mm2-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --mm2-transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --mm2-transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar { position: relative; z-index: var(--mm2-z); }

/* Trigger Button - Enhanced */
.mm2-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--mm2-radius-md);
  border: 1.5px solid var(--mm2-border);
  background: var(--mm2-surface); color: var(--mm2-fg);
  cursor: pointer; user-select: none;
  transition: all var(--mm2-transition-fast);
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--mm2-shadow-sm);
}
.mm2-trigger:hover { 
  border-color: var(--mm2-accent); 
  background: var(--mm2-muted);
  box-shadow: var(--mm2-shadow-md);
  transform: translateY(-1px);
}
.mm2-trigger:active { transform: translateY(0); }
.mm2-trigger svg {max-width: unset !important; transition: transform var(--mm2-transition-fast); }
.mm2-trigger:hover svg { transform: scale(1.05); }

/* Backdrop - Enhanced Glassmorphism */
.mm2-backdrop {
  position: fixed; 
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15,23,42,.40);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  opacity: 0; 
  pointer-events: none;
  z-index: 499;
  transition: opacity var(--mm2-transition-base);
}
.mm2-open .mm2-backdrop { opacity: 1; pointer-events: auto; }

/* Panel - Glassmorphism Enhanced */
.mm2-panel {
  position: fixed;
  left: 50%;
  top: 120px;
  transform: translateX(-50%) translateY(-16px);
  width: min(1200px, 95vw);
  background: var(--mm2-surface-elevated);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border: 1.5px solid var(--mm2-border-strong);
  border-radius: var(--mm2-radius-xl);
  box-shadow: var(--mm2-shadow-xl);
  display: none;
  overflow: hidden;
  opacity: 0;
  z-index: 500;
  transition: transform var(--mm2-transition-slow), opacity var(--mm2-transition-base);
}
.mm2-open .mm2-panel { 
  display: block; 
  opacity: 1; 
  transform: translateX(-50%) translateY(0);
}

/* View switcher */
.mm2-view { display: none; }
.mm2-open .mm2-view.is-active { display: block; }

/* Top grid (level-1 tiles) - Enhanced */
.mm2-top {
  padding: 24px;
  max-height: 75vh; overflow: auto;
}
.mm2-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
}
@media (max-width: 1200px) { .mm2-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 960px)  { .mm2-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; } }

/* Stagger animation for cards */
.mm2-open .mm2-card {
  animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.mm2-open .mm2-card:nth-child(1)  { animation-delay: 0.02s; }
.mm2-open .mm2-card:nth-child(2)  { animation-delay: 0.04s; }
.mm2-open .mm2-card:nth-child(3)  { animation-delay: 0.06s; }
.mm2-open .mm2-card:nth-child(4)  { animation-delay: 0.08s; }
.mm2-open .mm2-card:nth-child(5)  { animation-delay: 0.10s; }
.mm2-open .mm2-card:nth-child(6)  { animation-delay: 0.12s; }
.mm2-open .mm2-card:nth-child(7)  { animation-delay: 0.14s; }
.mm2-open .mm2-card:nth-child(8)  { animation-delay: 0.16s; }
.mm2-open .mm2-card:nth-child(9)  { animation-delay: 0.18s; }
.mm2-open .mm2-card:nth-child(10) { animation-delay: 0.20s; }
.mm2-open .mm2-card:nth-child(11) { animation-delay: 0.22s; }
.mm2-open .mm2-card:nth-child(12) { animation-delay: 0.24s; }
.mm2-open .mm2-card:nth-child(n+13) { animation-delay: 0.26s; }

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mm2-card {
  position: relative;
  display: flex; gap: 14px; align-items: center;
  padding: 16px; border-radius: var(--mm2-radius-md);
  background: var(--mm2-surface);
  border: 1.5px solid var(--mm2-border);
  text-decoration: none; color: var(--mm2-fg);
  transition: all var(--mm2-transition-fast);
  min-height: 72px;
  box-shadow: var(--mm2-shadow-sm);
}
.mm2-card:hover { 
  border-color: var(--mm2-accent);
  background: linear-gradient(135deg, rgba(255,255,255,1), rgba(248,250,252,1));
  box-shadow: var(--mm2-shadow-hover);
  transform: translateY(-3px);
}
.mm2-card:active { transform: translateY(-1px); }

/* Icon with category-specific gradients */
.mm2-card .mm2-ico {
  width: 48px; height: 48px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e0e7ff, #fff);
  border: 1.5px solid #c7d2fe;
  color: #4f46e5;
  flex-shrink: 0;
  transition: all var(--mm2-transition-fast);
  box-shadow: 0 2px 8px rgba(99,102,241,0.1);
}
.mm2-card:hover .mm2-ico {
  transform: scale(1.08) rotate(2deg);
  box-shadow: 0 4px 16px rgba(99,102,241,0.2);
}
.mm2-card .mm2-ico svg { transition: transform var(--mm2-transition-fast); }
.mm2-card:hover .mm2-ico svg { transform: scale(1.1); }

.mm2-card .mm2-title { 
  font-weight: 700; 
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.mm2-card .mm2-sub { 
  color: var(--mm2-fg-muted); 
  font-size: 12.5px; 
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm2-card .mm2-count {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--mm2-accent-10);
  color: var(--mm2-accent);
  font-weight: 600;
  font-size: 11px;
  margin-left: 4px;
}

/* Detail view (level-2 + level-3) - Enhanced */
.mm2-detail {
  position: relative;
  padding: 16px 24px 24px;
  max-height: 70vh; overflow: auto;
}
.mm2-detail-header {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0 16px; border-bottom: 2px solid var(--mm2-muted); margin-bottom: 16px;
}
.mm2-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1.5px solid var(--mm2-border); background: #fff; color: var(--mm2-fg);
  cursor: pointer;
  transition: all var(--mm2-transition-fast);
  box-shadow: var(--mm2-shadow-sm);
}
.mm2-back:hover {
  border-color: var(--mm2-accent);
  background: var(--mm2-muted);
  transform: translateX(-3px);
  box-shadow: var(--mm2-shadow-md);
}
.mm2-detail-title { 
  font-weight: 800; 
  font-size: 18px;
  letter-spacing: -0.02em;
}

/* Two-pane layout (desktop) - Enhanced */
.mm2-detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

/* Left: subnav (level-2 list) - Enhanced */
.mm2-subnav {
  position: sticky; top: 8px;
  align-self: start;
  max-height: calc(70vh - 56px);
  overflow: auto;
  padding-right: 6px;
}
.mm2-subnav::-webkit-scrollbar { width: 8px; height: 8px; }
.mm2-subnav::-webkit-scrollbar-track { background: transparent; }
.mm2-subnav::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.mm2-subnav::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.mm2-subitem {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--mm2-fg);
  cursor: pointer;
  text-align: left;
  transition: all var(--mm2-transition-fast);
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  position: relative;
}
.mm2-subitem::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--mm2-accent);
  border-radius: 0 2px 2px 0;
  transition: height var(--mm2-transition-fast);
}
.mm2-subitem:hover { 
  background: var(--mm2-muted);
  color: var(--mm2-accent-hover);
}
.mm2-subitem.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(99,102,241,0.04));
  border-color: var(--mm2-accent-20);
  color: var(--mm2-accent-hover);
  box-shadow: inset 0 0 0 1px rgba(99,102,241,0.1);
}
.mm2-subitem.active::before {
  height: 24px;
}

/* Right: subcontent (level-3 grid) - Enhanced */
.mm2-subcontent { min-height: 240px; }
.mm2-links {
  display: grid; gap: 12px 14px;
  grid-template-columns: repeat(3, minmax(0,1fr));
}
@media (max-width: 1200px) { .mm2-links { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.mm2-link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1.5px solid var(--mm2-border); border-radius: var(--mm2-radius-md);
  background: var(--mm2-surface); color: var(--mm2-fg); text-decoration: none;
  min-height: 52px;
  font-weight: 500;
  font-size: 14px;
  transition: all var(--mm2-transition-fast);
  box-shadow: var(--mm2-shadow-sm);
  position: relative;
  justify-content: space-between;
}
.mm2-link:hover { 
  background: var(--mm2-muted); 
  border-color: var(--mm2-accent);
  transform: translateX(4px);
  box-shadow: var(--mm2-shadow-md);
}
.mm2-link-text {
  flex: 1;
}

/* Product Thumbnails */
.mm2-thumbs {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}
.mm2-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid var(--mm2-border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all var(--mm2-transition-fast);
  background: var(--mm2-muted);
}
.mm2-link:hover .mm2-thumb {
  border-color: var(--mm2-accent);
  box-shadow: 0 4px 10px rgba(99,102,241,0.15);
  transform: scale(1.08);
}

/* Thumbnail Skeleton Loader */
.mm2-thumb-skeleton {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border: 1.5px solid var(--mm2-border);
}

.mm2-badge {
  font-size: 11px; padding: 3px 10px; margin-left: auto;
  border-radius: 12px; background: var(--mm2-accent-10); color: var(--mm2-accent);
  font-weight: 700;
  border: 1px solid var(--mm2-accent-20);
}

/* "See all" highlight card - Enhanced */
.mm2-seeall {
  border: 2px dashed var(--mm2-accent);
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(99,102,241,.02));
  font-weight: 700;
}
.mm2-seeall:hover {
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(99,102,241,.06));
  border-style: solid;
  transform: translateX(6px) scale(1.02);
}

/* Mobile panel styles - Enhanced with drag handle & better touch targets */
@media (max-width: 960px) {
  .mm2-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-height: 88vh;
    transform: translateX(0) translateY(100%);
    border-radius: var(--mm2-radius-xl) var(--mm2-radius-xl) 0 0;
    border-bottom: none;
  }
  .mm2-open .mm2-panel {
    transform: translateX(0) translateY(0); z-index: 9999;
  }
  
  /* Enhanced backdrop for mobile */
  .mm2-backdrop {
    backdrop-filter: blur(6px) saturate(1.2);
    -webkit-backdrop-filter: blur(6px) saturate(1.2);
  }
  
  /* Mobile close button - Soft glassmorphism */
  .mm2-mobile-close {
    position: absolute;
    top: 4px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(226, 232, 240, 0.6);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(1.8);
    -webkit-backdrop-filter: blur(12px) saturate(1.8);
    color: var(--mm2-fg-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--mm2-transition-fast);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    z-index: 20;
  }
  .mm2-mobile-close:hover {
    background: rgba(254, 242, 242, 0.95);
    border-color: rgba(252, 165, 165, 0.8);
    color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
  }
  .mm2-mobile-close:active {
    transform: scale(0.92);
  }
  
  /* Drag handle indicator */
  .mm2-top::before,
  .mm2-detail::before {
    content: '';
    position: sticky;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--mm2-border-strong);
    border-radius: 999px;
    margin: 12px auto 20px;
    display: block;
    z-index: 10;
    transition: background var(--mm2-transition-fast);
  }
  .mm2-panel:active .mm2-top::before,
  .mm2-panel:active .mm2-detail::before {
    background: #94a3b8;
  }
  
  .mm2-top {
    padding: 10px;  
  }
  
  .mm2-top, .mm2-detail { 
    max-height: min(82vh, 720px);
    padding-top: 8px;
  }

  /* Two-pane collapses: subnav becomes GRID (no horizontal scroll) */
  .mm2-detail-layout { display: block; }
  .mm2-subnav {
    position: static; max-height: none; overflow: visible;
    display: grid; gap: 10px; padding: 10px 4px 16px; margin-bottom: 16px;
    grid-template-columns: repeat(2, minmax(0,1fr));
    border-bottom: 2px solid var(--mm2-muted);
  }
  .mm2-subitem {
    margin: 0; width: 100%; text-align: center;
    border-radius: 14px;
    background: #fff; border: 1.5px solid var(--mm2-border);
    white-space: normal; line-height: 1.3; min-height: 48px;
    justify-content: center;
    padding: 12px 10px;
    font-size: 13.5px;
    box-shadow: var(--mm2-shadow-sm);
  }
  .mm2-subitem::before { display: none; }
  .mm2-subitem:hover {
    transform: scale(1.02);
  }
  .mm2-subitem.active {
    background: linear-gradient(135deg, var(--mm2-accent), var(--mm2-accent-hover));
    border-color: var(--mm2-accent-hover);
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
    font-weight: 700;
  }

  /* Level-3 grid tetap 2 kolom dengan spacing lebih baik */
  .mm2-links { 
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
  }
  
  /* Mobile: hide thumbnails untuk save space */
  .mm2-thumbs {
    display: none;
  }
  
  /* Larger touch targets for mobile */
  .mm2-card {
    min-height: 80px;
    padding: 18px 14px;
  }
  .mm2-card .mm2-ico {
    width: 50px;
    height: 50px;
  }
  .mm2-card .mm2-title {
    font-size: 14px;
  }
  .mm2-card .mm2-sub {
    font-size: 11.5px;
  }
  .mm2-link {
    min-height: 56px;
    padding: 16px;
  }
  .mm2-back {
    width: 44px;
    height: 44px;
  }
  
  /* Grid spacing */
  .mm2-grid {
    gap: 10px;
  }
}
  
/* Product Compare Feature Styles */

/* Compare Button in Product Detail - Modern Chip Style */
.pd-compare-section {
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pd-compare-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #fff;
  color: #64748b;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.pd-compare-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

.pd-compare-btn.added {
  border-color: #16a34a;
  color: #16a34a;
  background: #f0fdf4;
}

.pd-compare-btn .compare-remove {
  display: none;
}

.pd-compare-btn.added .compare-text {
  display: none;
}

.pd-compare-btn.added .compare-remove {
  display: flex !important;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #dc2626 !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 1;
  position: relative;
}

.pd-compare-btn.added .compare-remove[hidden] {
  display: flex !important;
}

/* Force visibility for added state */
.pd-compare-btn.added .compare-remove {
  display: flex !important;
}

[hidden].compare-remove {
  display: none !important;
}

.pd-compare-btn.added [hidden].compare-remove {
  display: flex !important;
}

/* Ensure the added state text is always visible */
.pd-compare-btn.added {
  border-color: #dc2626 !important;
  color: #dc2626 !important;
  background: #fef2f2 !important;
}

.pd-compare-btn.added .compare-remove svg {
  color: #dc2626 !important;
}

.pd-compare-btn.added:hover {
  border-color: #15803d;
  color: #15803d;
  background: #dcfce7;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.2);
}

.pd-compare-btn .compare-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pd-compare-info {
  display: inline-flex;
  align-items: center;
}

.compare-note {
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.pd-compare-btn.added + .pd-compare-info .compare-note {
  color: #16a34a;
  font-weight: 600;
}

/* Compare Badge in Navigation */
.compare-indicator {
  position: relative;
}

.compare-indicator .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: white;
  border-radius: 9px;
  font-size: 11px;
 

/* Floating Compare Badge (Sticky) */
.compare-floating-badge {
  position: fixed;
  right: 16px;
  bottom: calc(20px + 60px); /* Above scroll-to-top button */
  width: auto;
  min-width: 56px;
  height: 56px;
  padding: 0 16px;
  border-radius: 28px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(59, 130, 246, 0.5);
  cursor: pointer;
  z-index: 1104;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  pointer-events: none;
}

.compare-floating-badge.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.compare-floating-badge:hover {
  box-shadow: 0 12px 32px -10px rgba(59, 130, 246, 0.6);
  transform: translateY(-2px) scale(1.02);
}

.compare-floating-badge:active {
  transform: translateY(0) scale(0.98);
}

.compare-floating-badge .cfb-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.compare-floating-badge .cfb-count {
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
}

.compare-floating-badge .cfb-text {
  display: none;
}

@media (min-width: 641px) {
  .compare-floating-badge .cfb-text {
    display: block;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .compare-floating-badge {
    right: 14px;
    bottom: calc(var(--scroll-top-bottom, calc(68px + 18px + env(safe-area-inset-bottom))) + 60px);
    min-width: 48px;
    height: 48px;
    padding: 0 12px;
    border-radius: 24px;
  }
  
  .compare-floating-badge .cfb-icon {
    width: 18px;
    height: 18px;
  }
  
  .compare-floating-badge .cfb-count {
    font-size: 0.8rem;
    padding: 2px 6px;
    height: 20px;
  }
} font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0);
  transition: transform 0.2s ease;
}

.compare-indicator .badge.active {
  transform: scale(1);
}

/* Compare Sidebar */
.compare-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}

.compare-sidebar.open {
  right: 0;
}

.compare-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.compare-overlay.active {
  opacity: 1;
  visibility: visible;
}

.compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.compare-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.compare-count {
  color: #64748b;
  font-weight: 400;
}

.compare-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.compare-close:hover {
  background: #e2e8f0;
  color: #374151;
}

.compare-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.compare-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 2rem 1rem;
}

.compare-empty h5 {
  margin: 1rem 0 0.5rem;
  color: #374151;
}

.compare-empty p {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
}

.compare-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.compare-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  transition: all 0.2s ease;
}

.compare-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.compare-item-image {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.compare-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-item-info {
  flex: 1;
  min-width: 0;
}

.compare-item-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: #1e293b;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.compare-item-price {
  font-weight: 600;
  font-size: 0.8rem;
  color: #059669;
}

.compare-item-remove {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.2s ease;
}

.compare-item-remove:hover {
  background: #fef2f2;
  color: #991b1b;
}

.compare-actions {
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 0.75rem;
}

.compare-actions .btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline-danger {
  border: 1px solid #dc2626;
  background: transparent;
  color: #dc2626;
}

.btn-outline-danger:hover {
  background: #dc2626;
  color: white;
}

.btn-primary {
  border: 1px solid #3b82f6;
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary:disabled:hover {
  background: #3b82f6;
  border-color: #3b82f6;
}

/* AI Comparison Modal */
.ai-compare-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.ai-compare-modal.open {
  display: flex;
}

.ai-compare-modal .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-container {
  position: relative;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #e2e8f0;
  color: #374151;
}

.modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* AI Loading State */
.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
}

.loading-animation {
  margin-bottom: 1rem;
}

.typing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 1rem;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.ai-loading p {
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.ai-loading small {
  color: #64748b;
}

/* AI Error State */
.ai-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
}

.ai-error h4 {
  margin: 1rem 0 0.5rem;
  color: #dc2626;
}

.ai-error p {
  color: #64748b;
  margin-bottom: 1.5rem;
}

/* AI Results */
.ai-results > div {
  margin-bottom: 2rem;
}

.ai-summary-card,
.ai-comparison-table,
.ai-detailed-analysis,
.ai-recommendations,
.ai-tips {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
}

.ai-results h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1rem;
}

.summary-text {
  font-size: 1rem;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 1rem;
}

.winner-badge {
  padding: 1rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 8px;
}

.winner-badge strong {
  display: block;
  margin-bottom: 0.25rem;
}

.winner-badge small {
  opacity: 0.9;
  font-size: 0.875rem;
}

/* Comparison Table */
.comparison-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.comparison-category {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.category-header {
  background: #f1f5f9;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
}

.category-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: #e2e8f0;
}

.product-score {
  background: white;
  padding: 1rem;
  text-align: center;
}

.score-value {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.score-stars {
  color: #fbbf24;
}

.score-note {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.3;
}

/* Product name header in comparison table */
.product-name-header {
  margin-bottom: 0.5rem;
}

.product-name-header strong {
  font-size: .8rem; /* h5 size (18px) */
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
  display: block;
  word-break: break-word;
}

.product-price {
  font-size: 0.8rem;
  font-weight: 600;
  color: #059669;
}

/* Detailed Analysis */
.products-analysis {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.product-analysis {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.product-analysis h5 {
  color: #1e293b;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.analysis-section {
  margin-bottom: 0.75rem;
}

.analysis-section:last-child {
  margin-bottom: 0;
}

.analysis-section h6 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.analysis-section h6.strengths {
  color: #059669;
}

.analysis-section h6.weaknesses {
  color: #dc2626;
}

.analysis-section h6.best-for {
  color: #7c3aed;
}

.analysis-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.analysis-section li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.analysis-section li:before {
  content: "•";
  color: #64748b;
  font-weight: bold;
  margin-top: 0.1rem;
}

.best-for-text {
  font-size: 0.875rem;
  color: #374151;
  font-style: italic;
}

/* Recommendations */
.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.recommendation-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.recommendation-card h5 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: #1e293b;
}

.recommendation-card p {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
}

/* Tips */
.tips-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
}

.tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #374151;
}

.tips-list li:before {
  content: "💡";
  font-size: 1rem;
  margin-top: 0.1rem;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.btn-outline-secondary {
  border: 1px solid #64748b;
  background: transparent;
  color: #64748b;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
  background: #64748b;
  color: white;
}

/* Responsive for chip button */
@media (max-width: 880px) {
  .pd-compare-section {
    margin: 1rem 0;
    display: block;
  }

  .pd-compare-btn {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    justify-content: center;
    min-height: 44px;
  }
  
  .pd-compare-btn .compare-icon {
    width: 16px;
    height: 16px;
  }

  .pd-compare-info {
    margin-top: 0.5rem;
    display: block;
    text-align: center;
  }

  .compare-note {
    font-size: 0.7rem;
    display: block;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .compare-sidebar {
    width: 100%;
    right: -100%;
    /* Fix for mobile viewport height changes */
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for modern browsers */
  }
  
  .compare-actions {
    /* Ensure actions are always visible */
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 2px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
  }
  
  .compare-actions .btn {
    /* Larger touch targets for mobile */
    min-height: 48px;
    font-size: 0.9rem;
    font-weight: 700;
  }
  
  .modal-container {
    width: 95%;
    max-height: 95vh;
    max-height: 95dvh; /* Dynamic viewport height */
  }
  
  .modal-header,
  .modal-content,
  .modal-footer {
    padding: 1rem;
  }
  
  .recommendations-grid {
    grid-template-columns: 1fr;
  }
  
  .category-products {
    grid-template-columns: 1fr;
  }
  
  .modal-footer {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
  
  /* Ensure compare button is visible on mobile */
  .pd-compare-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 1rem 0;
    padding: 0;
    position: relative !important;
    z-index: 1 !important;
    max-width: 100%;
    overflow: hidden;
  }
  
  .pd-compare-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    min-height: 48px; /* Minimum touch target for mobile */
    border: 2px solid #e2e8f0 !important;
    background: #fff !important;
    position: relative !important;
    z-index: 2 !important;
    box-sizing: border-box;
    white-space: normal !important; /* Allow text wrapping on mobile */
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .pd-compare-btn .compare-text {
    display: inline !important;
    visibility: visible !important;
    font-weight: 600;
    color: #475569 !important;
  }
  
  .pd-compare-btn .compare-remove {
    display: none !important; /* Hidden by default */
  }
  
  .pd-compare-btn.added .compare-remove {
    display: flex !important; /* Only show when added */
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    white-space: normal !important;
    word-break: break-word;
  }
  
  .pd-compare-btn .compare-icon {
    display: inline-block !important;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  
  .pd-compare-info {
    margin-top: 0.5rem;
  }
  
  .compare-note {
    font-size: 0.85rem !important;
    display: block !important;
    visibility: visible !important;
    color: #64748b !important;
  }
}

/* iOS Safari specific fixes */
@media (max-width: 480px) {
  #compareBtn { 
    width:46px;
    height:46px;
  }
  
  .pd-compare-section {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  
  .pd-compare-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  /* Fix sidebar height for iOS address bar */
  .compare-sidebar {
    /* Use fixed positioning that accounts for iOS address bar */
    height: 100vh;
    height: -webkit-fill-available; /* iOS Safari compatibility */
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }
  
  /* Ensure compare actions stay at bottom */
  .compare-actions {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 2px solid #e2e8f0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    padding: 1.25rem 1rem;
    z-index: 20;
  }
  
  .compare-actions .btn {
    min-height: 52px; /* Larger for easier tapping */
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
  }
  
  /* Adjust content padding to account for sticky actions */
  .compare-content {
    padding-bottom: 6rem; /* Extra space for sticky actions */
  }
}

/* High-resolution mobile devices (iPhone 12 Pro, etc.) */
@media (-webkit-min-device-pixel-ratio: 2) and (max-width: 430px) {
  .pd-compare-section {
    display: block !important;
  }
  
  .pd-compare-btn {
    display: flex !important;
    min-height: 44px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  /* Enhanced fixes for iPhone 12 Pro and similar devices */
  .compare-sidebar {
    /* Ensure full height coverage */
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height */
    height: -webkit-fill-available; /* iOS fallback */
    max-height: 100vh;
    max-height: 100dvh;
    max-height: -webkit-fill-available;
    overflow: hidden; /* Prevent scroll issues */
  }
  
  .compare-content {
    /* Flexible content area */
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1rem 8rem 1rem; /* Extra bottom padding */
  }
  
  .compare-actions {
    /* Force actions to stay visible */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    border-top: 2px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    z-index: 9999;
    display: flex !important;
    gap: 0.75rem;
  }
  
  .compare-actions .btn {
    flex: 1;
    min-height: 30px; /* Extra large for high-DPI screens */
    font-size: .8rem;
    font-weight: 600;
    border-radius: 12px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }
  
  /* Ensure AI analyze button is always visible and prominent */
  #compareAnalyze {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  }
  
  #compareAnalyze:not(:disabled) {
    background: #2563eb !important;
    border-color: #2563eb !important;
    transform: scale(1.02);
  }
  
  #compareAnalyze:disabled {
    opacity: 0.6 !important;
    background: #9ca3af !important;
    border-color: #9ca3af !important;
  }
}

/* AI Disclaimer Styles */
.ai-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  margin: 0;
}

.disclaimer-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.disclaimer-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #92400e;
}

.disclaimer-text strong {
  color: #78350f;
  font-weight: 600;
}

/* Compare Disclaimer in Sidebar */
.compare-disclaimer {
  margin-top: 1rem;
  padding: 1rem;
  background: #f0f9ff;
  border: 1px solid #0ea5e9;
  border-radius: 8px;
}

.compare-disclaimer h6 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0c4a6e;
  margin-bottom: 0.5rem;
}

.compare-disclaimer p {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #075985;
  margin-bottom: 0.5rem;
}

.compare-disclaimer p:last-child {
  margin-bottom: 0;
}

.compare-disclaimer ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.compare-disclaimer li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: #075985;
}

.compare-disclaimer li:before {
  content: "•";
  color: #0ea5e9;
  font-weight: bold;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

/* Mobile Browser Address Bar Fixes */
@supports (height: 100dvh) {
  /* Modern browsers with dynamic viewport support */
  @media (max-width: 768px) {
    .compare-sidebar {
      height: 100dvh !important;
      max-height: 100dvh !important;
    }
    
    .modal-container {
      max-height: 95dvh !important;
    }
  }
}

@supports (height: -webkit-fill-available) {
  /* iOS Safari specific support */
  @media (max-width: 768px) {
    .compare-sidebar {
      height: -webkit-fill-available !important;
      max-height: -webkit-fill-available !important;
    }
  }
}

/* Fallback for older browsers */
@media (max-width: 768px) and (orientation: portrait) {
  .compare-sidebar {
    /* Fixed height that works across different mobile browsers */
    min-height: 600px;
    height: calc(100vh - env(keyboard-inset-height, 0px));
    height: calc(100vh - env(safe-area-inset-bottom, 0px));
  }
  
  /* Ensure actions are always accessible */
  .compare-actions {
    position: sticky !important;
    bottom: env(safe-area-inset-bottom, 0px) !important;
    margin-bottom: 0 !important;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* PWA and fullscreen app support */
@media (display-mode: standalone) {
  .compare-sidebar {
    height: 100vh !important;
    height: 100dvh !important;
  }
}

/* Utilities */
.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

[hidden] {
  display: none !important;
}

/* ===== UX ENHANCEMENTS ===== */

/* Compare Button Highlight Animation */
.pulse-highlight {
  animation: pulse-glow 2s ease-in-out 3;
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

/* Flying Product Animation */
.flying-product {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
}

.flying-product img {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Sticky Compare Bar - REMOVED (using only fly-to-navbar animation) */

/* Inline Compare Preview - REMOVED (keeping it simple and clean) */
  
/**
 * Product Card Quick Actions - 3 Dot Menu + Bottom Sheet
 * Tokopedia-inspired design
 */

/* ===== 3 Dot Button on Product Card ===== */
.prod-card {
    position: relative;
}

.prod-card-actions-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    -webkit-tap-highlight-color: transparent;
}

.prod-card-actions-btn:hover {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.prod-card-actions-btn:active {
    transform: scale(0.95);
}

.prod-card-actions-btn svg {
    width: 20px;
    height: 20px;
    color: #64748b;
    display: block;
}

/* Desktop: Show on hover */
@media (min-width: 641px) {
    .prod-card-actions-btn {
        opacity: 0;
        pointer-events: none;
    }
    
    .prod-card:hover .prod-card-actions-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Mobile: Always visible but smaller */
@media (max-width: 640px) {
    .prod-card-actions-btn {
        width: 28px;
        height: 28px;
        top: 6px;
        right: 6px;
        opacity: 95%;
    }
    
    .prod-card-actions-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ===== Bottom Sheet Overlay ===== */
.pca-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pca-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== Bottom Sheet Container ===== */
.pca-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    max-width: 600px;
    margin: 0 auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pca-bottom-sheet.active {
    transform: translateY(0);
}

/* Drag Handle */
.pca-sheet-handle {
    width: 40px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 999px;
    margin: 12px auto 8px;
}

/* Product Preview */
.pca-sheet-product {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.pca-product-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.pca-product-info {
    flex: 1;
    min-width: 0;
}

.pca-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.pca-product-price {
    font-size: 15px;
    font-weight: 700;
    color: #0ea5e9;
    margin: 0;
}

.pca-product-stock {
    font-size: 12px;
    color: #64748b;
    margin: 2px 0 0 0;
}

.pca-product-stock.in {
    color: #16a34a;
}

.pca-product-stock.low {
    color: #ea580c;
}

.pca-product-stock.out {
    color: #dc2626;
}

/* Action Menu */
.pca-sheet-actions {
    padding: 8px 0 20px;
}

.pca-action-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: transparent;
    border: 0;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.pca-action-item:hover {
    background: #f8fafc;
}

.pca-action-item:active {
    background: #f1f5f9;
}

.pca-action-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pca-action-item:disabled:hover {
    background: transparent;
}

.pca-action-icon {
    width: 24px;
    height: 24px;
    color: #475569;
    flex-shrink: 0;
}

.pca-action-content {
    flex: 1;
    text-align: left;
}

.pca-action-label {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 2px 0;
}

.pca-action-desc {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

.pca-action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #0ea5e9;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    margin-left: auto;
}

.pca-action-badge.compare {
    background: #8b5cf6;
}

/* Action Item Colors */
.pca-action-item.cart .pca-action-icon {
    color: #0ea5e9;
}

.pca-action-item.compare .pca-action-icon {
    color: #8b5cf6;
}

.pca-action-item.compare.active {
    background: rgba(139, 92, 246, 0.05);
}

.pca-action-item.compare.active .pca-action-label {
    color: #8b5cf6;
}

.pca-action-item.compare.active .pca-action-icon {
    color: #8b5cf6;
}

.pca-action-item.share .pca-action-icon {
    color: #64748b;
}

/* Loading State */
.pca-action-item.loading {
    pointer-events: none;
}

.pca-action-item.loading .pca-action-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Success State Animation */
.pca-action-item.success .pca-action-icon {
    animation: checkmark 0.5s ease;
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ===== Safe Area for Mobile Devices ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .pca-sheet-actions {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* ===== Responsive Tweaks ===== */
@media (max-width: 640px) {
    .pca-bottom-sheet {
        border-radius: 16px 16px 0 0;
    }
    
    .pca-sheet-product {
        padding: 10px 16px;
    }
    
    .pca-product-image {
        width: 50px;
        height: 50px;
    }
    
    .pca-product-name {
        font-size: 13px;
    }
    
    .pca-product-price {
        font-size: 14px;
    }
    
    .pca-action-item {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .pca-action-icon {
        width: 22px;
        height: 22px;
    }
    
    .pca-action-label {
        font-size: 14px;
    }
}

/* ===== Animation for Flying Product ===== */
.flying-product {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    animation: fadeOut 0.8s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* ===== Desktop Dropdown (Alternative) ===== */
@media (min-width: 1024px) {
    /* Optional: Could add desktop dropdown menu here */
    /* For now, using bottom sheet for consistency */
}

/* ===== Print Styles ===== */
@media print {
    .prod-card-actions-btn,
    .pca-overlay,
    .pca-bottom-sheet {
        display: none !important;
    }
}

  
/* Modern Modal Dialog for Cart Operations */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.show .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-body {
  padding: 16px 24px 24px;
}

.modal-message {
  font-size: 16px;
  line-height: 1.5;
  color: #475569;
  margin: 0;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.modal-btn-secondary {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.modal-btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.modal-btn-danger {
  background: #ef4444;
  color: white;
}

.modal-btn-danger:hover {
  background: #dc2626;
}

.modal-btn-primary {
  background: #3b82f6;
  color: white;
}

.modal-btn-primary:hover {
  background: #2563eb;
}

.modal-icon {
  font-size: 24px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.modal-icon.danger {
  background: #fef2f2;
  color: #ef4444;
}

.modal-icon.warning {
  background: #fffbeb;
  color: #f59e0b;
}

.modal-icon.success {
  background: #f0fdf4;
  color: #22c55e;
}

.modal-icon.info {
  background: #eff6ff;
  color: #3b82f6;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .modal-dialog {
    margin: 16px;
    max-width: none;
    width: auto;
  }
  
  .modal-header,
  .modal-body {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .modal-btn {
    flex: none;
  }
}

/**
 * Reviews & Points System - Styles
 * Product reviews, rating display, and point redemption UI
 */

/* ===================================
   PRODUCT REVIEWS
   =================================== */

.product-tabs {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin: 24px 0 16px;
  gap: 8px;
}

.tab-btn {
  padding: 12px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: #6b7280;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  top: 2px;
}

.tab-btn:hover {
  color: #111827;
}

.tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.tab-content {
  padding: 20px 0;
}

/* Review Statistics */
.review-stats {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 24px;
  background: #f9fafb;
  border-radius: 12px;
  margin-bottom: 24px;
}

.rating-summary {
  text-align: center;
}

.avg-rating {
  display: block;
  font-size: 48px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.rating-summary .stars {
  font-size: 24px;
  color: #fbbf24;
  margin: 8px 0;
}

.total-reviews {
  display: block;
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

.rating-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rating-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rating-label {
  font-size: 14px;
  color: #374151;
  width: 32px;
  text-align: right;
}

.bar-container {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
  transition: width 0.3s ease;
}

.rating-count {
  font-size: 14px;
  color: #6b7280;
  width: 40px;
  text-align: right;
}

/* Review Filters */
.review-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.review-sort {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

.write-review-btn {
  padding: 10px 20px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.write-review-btn:hover {
  background: #1d4ed8;
}

/* Review List */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-item {
  padding: 20px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  transition: box-shadow 0.2s;
}

.review-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-author strong {
  font-size: 15px;
  color: #111827;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #059669;
  background: #d1fae5;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.anonymous-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  cursor: help;
}

.review-rating .stars {
  font-size: 16px;
  color: #fbbf24;
}

.review-date {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 12px;
}

.review-text {
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 12px;
}

.review-images {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.review-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.review-img:hover {
  transform: scale(1.05);
}

.review-actions {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.btn-helpful {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-helpful:hover {
  background: #f3f4f6;
  color: #111827;
  border-color: #d1d5db;
}

.btn-helpful.voted {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.helpful-icon {
  font-size: 14px;
}

.no-reviews {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
  font-size: 15px;
}

.load-more-btn {
  display: block;
  margin: 24px auto 0;
  padding: 12px 32px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* ===================================
   POINT BALANCE WIDGET (LEGACY - kept for backward compatibility)
   =================================== */

.point-balance-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.point-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.point-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.point-header .balance {
  font-size: 32px;
  font-weight: 700;
}

.point-value {
  font-size: 14px;
  opacity: 0.9;
  margin: 8px 0 16px;
}

.point-stats {
  display: flex;
  gap: 20px;
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 16px;
}

.btn-view-history {
  display: inline-block;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-view-history:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ===================================
   CHECKOUT POINT REDEMPTION
   =================================== */

.checkout-points {
  padding: 16px;
  background: #fef3c7;
  border: 2px solid #fbbf24;
  border-radius: 12px;
  margin-bottom: 16px;
}

.points-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.points-header input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.points-header label {
  font-size: 15px;
  color: #78350f;
  cursor: pointer;
  margin: 0;
}

#points-slider {
  padding: 16px;
  background: white;
  border-radius: 8px;
  margin-top: 12px;
}

#points-slider label {
  display: block;
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
  font-weight: 500;
}

#points-amount {
  width: 100%;
  margin-bottom: 8px;
}

#points-display {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #111827;
  margin-top: 8px;
}

#points-display .discount-amount {
  color: #059669;
  font-weight: 600;
}

.price-row.point-discount {
  color: #059669;
  font-weight: 500;
}

/* ===================================
   REVIEWABLE ORDERS
   =================================== */

.reviewable-orders {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.reviewable-orders h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #111827;
}

.order-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 12px;
}

.order-card:last-child {
  margin-bottom: 0;
}

.order-card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.order-info {
  flex: 1;
}

.order-info h4 {
  font-size: 15px;
  margin: 0 0 4px;
  color: #111827;
}

.order-info p {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 12px;
}

.btn-review {
  padding: 8px 16px;
  background: #059669;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-review:hover {
  background: #047857;
}

/* ===================================
   TOAST NOTIFICATIONS
   =================================== */

.review-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: #111827;
  color: white;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10000;
  max-width: 400px;
  word-wrap: break-word;
}

.review-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Mobile: Position above bottom-nav */
@media (max-width: 768px) {
  .review-toast {
    bottom: 80px; /* Above bottom-nav (50px height + padding + safe margin) */
    right: 16px;
    left: 16px;
    max-width: calc(100% - 32px);
  }
}

.review-toast.toast-success {
  background: #059669;
}

.review-toast.toast-error {
  background: #dc2626;
}

.review-toast.toast-info {
  background: #2563eb;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
  .point-balance-card {
    border-radius: 0;
  }
  
  .review-stats {
    grid-template-columns: 70px 1fr;
    gap: 20px;
    padding: 16px;
  }

  .rating-summary {
    text-align: center;
  }
  
  .rating-summary .avg-rating {
    font-size: 32px;
  }
  
  .rating-summary .stars {
    font-size: 18px;
    margin: 4px 0;
  }
  
  .total-reviews {
    font-size: 11px;
  }
  
  /* Rating breakdown - more compact */
  .rating-breakdown {
    gap: 2px;
  }
  
  .rating-breakdown .rating-bar {
    gap: 4px;
  }
  
  .rating-breakdown .rating-label {
    font-size: 11px;
    width: 16px;
    min-width: 16px;
    text-align: left;
  }
  
  .rating-breakdown .bar-container {
    height: 6px;
  }
  
  .rating-breakdown .rating-count {
    font-size: 11px;
    width: 16px;
    min-width: 16px;
  }
  
  .review-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .review-rating {
    order: -1;
    margin-bottom: 4px;
  }
  
  .review-rating .stars {
    font-size: 14px;
  }

  .review-filters {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .review-sort {
    width: 100%;
  }

  .point-header .balance {
    font-size: 24px;
  }

  .point-stats {
    flex-direction: column;
    gap: 8px;
  }

  .order-card {
    flex-direction: column;
  }

  .order-card img {
    width: 100%;
    height: 200px;
  }
}

/* ===================================
   LOADING & ERROR STATES
   =================================== */

.review-loading {
  text-align: center;
  padding: 40px;
  color: #9ca3af;
  font-size: 14px;
}

.review-error {
  text-align: center;
  padding: 40px;
  color: #dc2626;
  font-size: 14px;
  background: #fee2e2;
  border-radius: 8px;
}

.review-empty {
  text-align: center;
  padding: 10px;
  color: #6b7280;
  font-size: 14px;
}

/* ===================================
   REVIEWABLE ORDERS LIST
   =================================== */

.reviewable-orders-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reviewable-order-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  align-items: center;
  transition: box-shadow 0.2s;
}

.reviewable-order-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.reviewable-order-item .roi-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.reviewable-order-item .roi-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reviewable-order-item .roi-info h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

.reviewable-order-item .roi-meta {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.reviewable-order-item .btn-write-review {
  white-space: nowrap;
  padding: 10px 20px;
  font-size: 14px;
}

@media (max-width: 640px) {
  .reviewable-order-item {
    grid-template-columns: 60px 1fr;
    gap: 12px;
  }
  
  .reviewable-order-item .roi-image {
    width: 60px;
    height: 60px;
  }
  
  .reviewable-order-item .btn-write-review {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* ===================================
   REVIEW SUBMISSION MODAL
   =================================== */

/* Modal Overlay Background */
#review-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999 !important;
  padding: 20px;
}

.review-modal {
  max-width: 600px !important;
  width: 90% !important;
  background: white;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

#review-modal-overlay .modal-content,
.review-modal .modal-content {
  padding: 0 !important;
  flex: initial !important;
  overflow-y: visible !important;
}

.review-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.review-modal .modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.review-modal .modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #6b7280;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-modal .modal-close:hover {
  color: #111827;
}

.review-modal .modal-body {
  padding: 24px;
  max-height: calc(90vh - 140px);
  overflow-y: auto;
}

/* Custom Scrollbar for Modal */
.review-modal .modal-body::-webkit-scrollbar {
  width: 8px;
}

.review-modal .modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.review-modal .modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 4px;
}

.review-modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

/* Firefox Scrollbar */
.review-modal .modal-body {
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 #f1f5f9;
}

.review-modal .modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

.review-product-info {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 24px;
}

.review-product-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.review-product-details h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.review-product-details p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

/* Star Rating Input */
.star-rating-input {
  display: inline-flex;
  gap: 8px;
  margin-right: 12px;
  vertical-align: middle;
}

.star-btn {
  background: none;
  border: none;
  font-size: 32px;
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}

.star-btn:hover,
.star-btn.active {
  color: #fbbf24;
  transform: scale(1.1);
}

.rating-label {
  display: inline-block;
  font-size: 15px;
  color: #6b7280;
  margin: 0;
  vertical-align: middle;
  min-width: 150px;
}

/* Form Elements */
.review-form .form-group {
  margin-bottom: 20px;
}

.review-form .form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.review-form .form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.review-form .form-control:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.review-form .form-hint {
  font-size: 13px;
  color: #6b7280;
  margin-top: 8px;
}

/* Image Upload */
.btn-upload-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  color: #374151;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-upload-trigger:hover {
  background: #f3f4f6;
  border-color: #2563eb;
  color: #2563eb;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-image {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.remove-image:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Point Reward Info */
.point-reward-info {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
}

.pri-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 12px;
}

.pri-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
}

.pri-list li {
  padding: 6px 0;
  font-size: 14px;
  color: #78350f;
  transition: opacity 0.2s;
}

.pri-total {
  padding-top: 12px;
  border-top: 2px solid rgba(251, 191, 36, 0.3);
  font-size: 16px;
  color: #92400e;
  font-weight: 600;
}

.form-error {
  background: #fee2e2;
  border: 1px solid #f87171;
  color: #991b1b;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 16px;
}

/* Buttons */
.review-form .btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.review-form .btn-primary {
  background: #2563eb;
  color: white;
}

.review-form .btn-primary:hover {
  background: #1d4ed8;
}

.review-form .btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.review-form .btn-secondary {
  background: #f1f5f9;
  color: #64748b;
}

.review-form .btn-secondary:hover {
  background: #e2e8f0;
  color: #475569;
}

@media (max-width: 768px) {
    #review-modal-overlay { padding: 0; }
    .review-modal { max-width: 100%; width: 100% !important; }
}

/* ===================================
   POINT SUMMARY GRID (Profile Page)
   =================================== */

.point-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.point-summary-card {
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s;
}

.point-summary-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.point-summary-card .psc-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.point-summary-card .psc-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.point-summary-card .psc-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.point-summary-card .psc-value {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  flex-shrink: 0;
}

/* Point History Section */
.point-history-section {
  margin-top: 32px;
}

.point-history-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px;
}

.point-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.point-history-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 16px;
  padding: 16px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  align-items: center;
  transition: all 0.2s;
}

.point-history-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.point-history-item.credit {
  border-left: 3px solid #10b981;
}

.point-history-item.debit {
  border-left: 3px solid #f59e0b;
}

.point-history-item .phi-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 50%;
  background: #f9fafb;
}

.point-history-item.credit .phi-icon {
  background: #d1fae5;
}

.point-history-item.debit .phi-icon {
  background: #fef3c7;
}

.point-history-item .phi-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.point-history-item .phi-desc {
  font-size: 15px;
  font-weight: 500;
  color: #111827;
}

.point-history-item .phi-date {
  font-size: 13px;
  color: #9ca3af;
}

.point-history-item .phi-amount {
  font-size: 18px;
  font-weight: 700;
}

.point-history-item .phi-amount.credit {
  color: #10b981;
}

.point-history-item .phi-amount.debit {
  color: #f59e0b;
}

@media (max-width: 640px) {
  .point-summary-grid {
    grid-template-columns: 1fr;
  }
  
  .point-summary-card .psc-value {
    font-size: 22px;
  }

  .point-history-item {
    grid-template-columns: 36px 1fr;
    gap: 12px;
  }
  
  .point-history-item .phi-amount {
    grid-column: 2;
    text-align: right;
    margin-top: 8px;
  }
}

/* ── Pending points: compact widget indicator ── */
.pbc-pending {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 4px;
  color: #fde68a;
}

/* ── Pending points: summary card ── */
.point-summary-card.psc-pending-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fcd34d;
}

.point-summary-card.psc-pending-card .psc-value {
  color: #b45309;
}

.point-summary-card .psc-sub {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

/* ── Pending points: history item ── */
.point-history-item.phi-pending {
  opacity: 0.75;
  border-left-color: #fcd34d;
  background: #fffbeb;
}

.point-history-item.phi-pending .phi-icon {
  background: #fef3c7;
}

.phi-pending-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Reversed points: history item ── */
.point-history-item.phi-reversed {
  opacity: 0.55;
  border-left-color: #d1d5db;
  background: #f9fafb;
}

.point-history-item.phi-reversed .phi-icon {
  background: #f3f4f6;
}

.point-history-item.phi-reversed .phi-amount {
  text-decoration: line-through;
  color: #9ca3af !important;
}

.phi-reversed-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  margin-left: 8px;
  vertical-align: middle;
}

/* PlazaIT Product Lightbox (vanilla, no CDN) — v4 */
.pd-lb {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.95);
  display: none;
  color: #fff;
  /* Transition untuk swipe-down feedback */
  transition: transform .18s ease, opacity .18s ease;
}
.pd-lb.show { display: block; }

/* Canvas di bawah (z:1), Controls di atas (z:2) */
.pd-lb-canvas {
  position: absolute; inset: 56px 0 56px 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  touch-action: none;
  z-index: 1;
}

.pd-lb-img {
  max-width: 96vw; max-height: 86vh;
  will-change: transform;
  user-select: none;
  pointer-events: none;
  transform-origin: 50% 50%;
}

.pd-lb-close, .pd-lb-prev, .pd-lb-next, .pd-lb-counter {
  position: absolute;
  z-index: 2;
}

.pd-lb-close, .pd-lb-prev, .pd-lb-next {
  background: rgba(17,24,39,.7);
  color: #fff; border: 0; cursor: pointer;
  width: 40px; height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, transform .05s ease;
  -webkit-tap-highlight-color: transparent;
}
.pd-lb-close:hover, .pd-lb-prev:hover, .pd-lb-next:hover { background: rgba(31,41,55,.85); }
.pd-lb-close:active, .pd-lb-prev:active, .pd-lb-next:active { transform: translateY(.5px); }

.pd-lb-close { top: max(12px, env(safe-area-inset-top, 12px)); right: max(12px, env(safe-area-inset-right, 12px)); }
.pd-lb-prev  { top: 50%; left:  10px; transform: translateY(-50%); }
.pd-lb-next  { top: 50%; right: 10px; transform: translateY(-50%); }

.pd-lb-counter {
  top: max(16px, env(safe-area-inset-top, 16px)); left: 50%;
  transform: translateX(-50%);
  font-weight: 700; font-size: 13px; letter-spacing: .4px;
  background: rgba(17,24,39,.65);
  padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.1);
}

@media (max-width: 640px){
  .pd-lb-img { max-width: 98vw; max-height: 80vh; }
  .pd-lb-prev, .pd-lb-next { width: 36px; height: 36px; }
  .pd-lb-close { width: 38px; height: 38px; }
}