/* ============================================
   AFRICREATIVA - MODERN MINIMAL COMPONENTS
   Small, Compact, Professional American Style
   ============================================ */

:root {
  /* Typography - Small & Modern */
  --font-xs: 0.75rem;      /* 12px */
  --font-sm: 0.8125rem;    /* 13px */
  --font-base: 0.875rem;   /* 14px */
  --font-md: 0.9375rem;    /* 15px */
  --font-lg: 1rem;         /* 16px */
  --font-xl: 1.125rem;     /* 18px */
  --font-2xl: 1.25rem;     /* 20px */
  
  /* Spacing - Compact */
  --space-1: 0.25rem;      /* 4px */
  --space-2: 0.5rem;       /* 8px */
  --space-3: 0.75rem;      /* 12px */
  --space-4: 1rem;         /* 16px */
  --space-5: 1.25rem;      /* 20px */
  --space-6: 1.5rem;       /* 24px */
  
  /* Colors */
  --primary: #b80000;
  --primary-dark: #8f0000;
  --accent: #fec703;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --bg-light: #f9fafb;
}

/* ============================================
   MODERN PRODUCT CARD - Small & Compact
   ============================================ */

.product-card-modern {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.product-card-modern:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(184, 0, 0, 0.1);
  transform: translateY(-2px);
}

.product-card-modern .card-image {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 aspect ratio */
  overflow: hidden;
  background: var(--bg-light);
}

.product-card-modern .card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card-modern:hover .card-image img {
  transform: scale(1.05);
}

/* Lazy loading placeholder */
.product-card-modern .card-image img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.product-card-modern .card-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  background: var(--primary);
  color: white;
  padding: var(--space-1) var(--space-2);
  border-radius: 4px;
  font-size: var(--font-xs);
  font-weight: 600;
  z-index: 2;
}

.product-card-modern .card-body {
  padding: var(--space-3);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-card-modern .card-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 var(--space-2) 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.product-card-modern .card-category {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-card-modern .card-price {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-2);
}

.product-card-modern .card-price .currency {
  font-size: var(--font-sm);
  font-weight: 500;
  margin-right: 2px;
}

.product-card-modern .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.product-card-modern .stock-info {
  font-size: var(--font-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.product-card-modern .card-actions {
  display: flex;
  gap: var(--space-1);
}

.product-card-modern .action-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: var(--font-sm);
}

.product-card-modern .action-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ============================================
   COMPACT GRID LAYOUT
   ============================================ */

.products-grid-modern {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
  padding: var(--space-4) 0;
}

@media (min-width: 640px) {
  .products-grid-modern {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .products-grid-modern {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* ============================================
   SEARCH AUTOCOMPLETE
   ============================================ */

.search-autocomplete {
  position: relative;
}

.search-autocomplete-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.search-autocomplete-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184, 0, 0, 0.1);
}

.search-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-top: var(--space-1);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-autocomplete-dropdown.active {
  display: block;
}

.search-autocomplete-item {
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border);
}

.search-autocomplete-item:last-child {
  border-bottom: none;
}

.search-autocomplete-item:hover {
  background: var(--bg-light);
}

.search-autocomplete-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.search-autocomplete-item-info {
  flex: 1;
  min-width: 0;
}

.search-autocomplete-item-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-autocomplete-item-price {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

/* ============================================
   COMPACT PAGINATION
   ============================================ */

.pagination-modern {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-1);
  margin: var(--space-6) 0;
}

.pagination-modern .page-link {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-sm);
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all 0.2s ease;
  min-width: 36px;
  text-align: center;
}

.pagination-modern .page-link:hover {
  background: var(--bg-light);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-modern .page-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.pagination-modern .page-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

/* ============================================
   COMPACT FILTERS
   ============================================ */

.filter-section-modern {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-3);
  margin-bottom: var(--space-4);
}

.filter-section-modern h6 {
  font-size: var(--font-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  font-size: var(--font-sm);
  cursor: pointer;
}

.filter-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-xs { font-size: var(--font-xs); }
.text-sm { font-size: var(--font-sm); }
.text-base { font-size: var(--font-base); }
.text-lg { font-size: var(--font-lg); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }

