/* ========================================
   BPPBJ E-Order Design System
   Tokopedia-Inspired Modern UI
   ======================================== */

/* === COLOR PALETTE === */
:root {
  /* Primary Colors */
  --primary: #DC143C;
  --primary-dark: #B01030;
  --primary-light: #FF4D6D;
  
  /* Secondary Colors */
  --secondary: #1E2228;
  --secondary-light: #2C3339;
  
  /* Status Colors */
  --success: #28A745;
  --warning: #FFC107;
  --danger: #DC3545;
  --info: #17A2B8;
  
  /* Neutral Colors */
  --white: #FFFFFF;
  --gray-50: #F8F9FA;
  --gray-100: #F4F6F9;
  --gray-200: #E9ECEF;
  --gray-300: #DEE2E6;
  --gray-400: #CED4DA;
  --gray-500: #ADB5BD;
  --gray-600: #6C757D;
  --gray-700: #495057;
  --gray-800: #343A40;
  --gray-900: #212529;
  --black: #000000;
  
  /* Spacing (8px grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Typography */
  --font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-2xl: 32px;
  
  /* Z-Index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* === MOBILE BOTTOM NAVIGATION === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 9999 !important; /* Force on top */
  display: none;
  padding: var(--space-sm) 0;
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--gray-600);
  padding: var(--space-xs);
  min-width: 60px;
  transition: all 0.2s ease;
  position: relative;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
  text-decoration: none;
  color: var(--primary);
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item i {
  font-size: 24px;
  margin-bottom: 2px;
}

.bottom-nav-item span {
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.bottom-nav-badge {
  position: absolute;
  top: 0;
  right: 8px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-full);
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* Show bottom nav on mobile */
@media (max-width: 768px) {
  .bottom-nav {
    display: block !important;
  }
  
  /* Add padding to body to prevent content from being hidden */
  body {
    padding-bottom: 70px;
  }
}

/* === PRODUCT CARD === */
.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.product-card-image {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  overflow: hidden;
  background: var(--gray-100);
}

.product-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  background: var(--primary);
  color: var(--white);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.product-card-body {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-price {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: var(--space-xs);
}

.product-card-name {
  font-size: var(--font-size-sm);
  color: var(--gray-700);
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  min-height: 2.8em;
}

.product-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: auto;
  font-size: var(--font-size-xs);
  color: var(--gray-600);
}

.product-card-location {
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-card-rating i {
  color: var(--warning);
}

/* === FILTER CHIPS === */
.filter-chips {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 12px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: var(--gray-200);
  border-color: var(--gray-400);
}

.filter-chip.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--white);
}

.filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.filter-chip-remove:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* === BUTTONS === */
.btn-tokopedia {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  min-height: 44px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-tokopedia:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-tokopedia-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-tokopedia-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
}

.btn-tokopedia-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-tokopedia-outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* === CATEGORY ICONS === */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--gray-700);
  transition: all 0.2s ease;
}

.category-item:hover {
  text-decoration: none;
  color: var(--primary);
}

.category-icon {
  width: 60px;
  height: 60px;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
  font-size: 28px;
  transition: all 0.2s ease;
}

.category-item:hover .category-icon {
  background: var(--primary-light);
  color: var(--white);
  transform: scale(1.05);
}

.category-name {
  font-size: var(--font-size-xs);
  font-weight: 500;
}

/* === RESPONSIVE UTILITIES === */
@media (max-width: 767px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
  }
  
  .category-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .category-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* === RATING STARS === */
.rating-stars {
  display: inline-flex;
  gap: 2px;
}

.rating-stars i {
  color: var(--gray-300);
  font-size: var(--font-size-sm);
}

.rating-stars i.filled {
  color: var(--warning);
}

/* === LOADING SKELETON === */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 16px;
  margin-bottom: var(--space-sm);
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: var(--space-md);
}

.skeleton-image {
  width: 100%;
  padding-top: 100%;
}
