/* ============================================
   AFRICREATIVA - MODERN E-COMMERCE DESIGN SYSTEM
   Small, Minimal, Professional
   ============================================ */

:root {
  /* === Africreativa Design Tokens === */
  --af-bg: #f7f7f9;
  --af-surface: #ffffff;
  --af-surface-muted: #f0f1f5;
  --af-border: #e1e1e6;
  --af-border-light: #f4f5f8;
  --af-text-main: #22252a;
  --af-text-muted: #6b6f7a;
  --af-text-light: #9ea3af;
  --af-text-on-dark: #ffffff;
  --af-primary: #b80000;
  --af-primary-soft: #fdeaea;
  --af-primary-dark: #960909;
  --af-accent: #ffb020;
  --af-accent-soft: #fff1d8;
  --af-success: #10b981;
  --af-warning: #f59e0b;
  --af-error: #ef4444;
  --af-info: #0f6efd;

  --af-font-base: 13px;
  --af-font-small: 12px;
  --af-font-large: 16px;
  --af-line-tight: 1.25;
  --af-line-normal: 1.5;
  --af-line-relaxed: 1.7;
  --font-primary: 'Segoe UI', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  --af-gap-xs: 4px;
  --af-gap-sm: 8px;
  --af-gap-md: 12px;
  --af-gap-lg: 16px;
  --af-gap-xl: 24px;
  --af-gap-2xl: 32px;

  --af-radius-sm: 6px;
  --af-radius-md: 10px;
  --af-radius-lg: 16px;
  --af-radius-pill: 999px;
  --af-shadow-soft: 0 2px 8px rgba(15, 23, 42, 0.06);
  --af-shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);

  --header-height: 70px;
  --sub-header-height: 50px;
  --header-total: 120px;
  --sidebar-width: 280px;
  --container-max: 1400px;

  /* Legacy aliases */
  --color-primary: var(--af-primary);
  --color-primary-dark: var(--af-primary-dark);
  --color-primary-light: var(--af-primary);
  --color-accent: var(--af-accent);
  --color-accent-light: var(--af-accent-soft);
  --color-bg: var(--af-bg);
  --color-surface: var(--af-surface);
  --color-surface-hover: var(--af-surface-muted);
  --color-text-main: var(--af-text-main);
  --color-text-muted: var(--af-text-muted);
  --color-text-light: var(--af-text-light);
  --color-text-on-dark: var(--af-text-on-dark);
  --color-border: var(--af-border);
  --color-border-light: var(--af-border-light);
  --color-success: var(--af-success);
  --color-warning: var(--af-warning);
  --color-error: var(--af-error);
  --color-info: var(--af-info);

  --spacing-xs: var(--af-gap-xs);
  --spacing-sm: var(--af-gap-sm);
  --spacing-md: var(--af-gap-md);
  --spacing-lg: var(--af-gap-lg);
  --spacing-xl: var(--af-gap-xl);
  --spacing-2xl: var(--af-gap-2xl);
  --spacing-3xl: 3rem;

  --radius-sm: var(--af-radius-sm);
  --radius-md: var(--af-radius-md);
  --radius-lg: var(--af-radius-lg);
  --radius-xl: 20px;
  --radius-full: var(--af-radius-pill);

  --shadow-soft: var(--af-shadow-soft);
  --shadow-md: var(--af-shadow-md);
  --shadow-lg: 0 10px 30px rgba(15,23,42,0.12);
  --shadow-xl: 0 18px 40px rgba(15,23,42,0.16);

  --transition: all 0.2s ease;
  --transition-fast: all 0.15s ease;
  --transition-slow: all 0.3s ease;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.9375rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;

  --line-height-tight: var(--af-line-tight);
  --line-height-normal: var(--af-line-normal);
  --line-height-relaxed: var(--af-line-relaxed);

  --amazon-primary: var(--af-primary);
  --amazon-secondary: #232F3E;
  --amazon-orange: var(--af-accent);
  --amazon-yellow: var(--af-accent-soft);
  --amazon-dark: var(--af-text-main);
  --amazon-light: var(--af-surface);
  --card-shadow: var(--af-shadow-md);
  --border-radius: var(--af-radius-md);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--af-font-base);
  line-height: var(--af-line-normal);
  color: var(--af-text-main);
  background-color: var(--af-bg);
  padding-top: var(--header-total);
  min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY - Small & Modern
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--af-line-tight);
  color: var(--af-text-main);
  margin-bottom: var(--af-gap-md);
}

h1 { font-size: clamp(1.8rem, 3vw, 2rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.6rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.35rem); }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.95rem; }

p {
  margin-bottom: var(--af-gap-md);
  line-height: var(--af-line-relaxed);
  color: var(--af-text-main);
}

small, .text-sm {
  font-size: var(--af-font-small);
  color: var(--af-text-muted);
}

.text-xs {
  font-size: 11px;
  color: var(--af-text-muted);
}

.text-muted,
.af-text-muted {
  color: var(--af-text-muted);
}

.text-light {
  color: var(--af-text-light);
}

.af-section {
  padding: var(--af-gap-xl) 0;
}

.af-section + .af-section {
  border-top: 1px solid var(--af-border-light);
}

.af-card {
  background: var(--af-surface);
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius-md);
  box-shadow: var(--af-shadow-soft);
  padding: var(--af-gap-lg);
}

.af-card__title {
  font-size: 1rem;
  margin-bottom: var(--af-gap-sm);
}

.af-card__meta {
  font-size: var(--af-font-small);
  color: var(--af-text-muted);
}

.af-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: var(--af-font-base);
  font-weight: 600;
  border-radius: var(--af-radius-sm);
  padding: 0.45rem 1rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.af-btn--primary {
  background: var(--af-primary);
  color: #fff;
}

.af-btn--primary:hover {
  background: var(--af-primary-dark);
}

.af-btn--outline {
  border: 1px solid var(--af-primary);
  background: transparent;
  color: var(--af-primary);
}

.af-btn--outline:hover {
  background: var(--af-primary-soft);
}

.af-pill {
  border-radius: var(--af-radius-pill);
  padding: 0.2rem 0.75rem;
  background: var(--af-surface-muted);
  font-size: var(--af-font-small);
  color: var(--af-text-muted);
}

/* ============================================
   UTILITY CLASSES - Layout & Spacing
   ============================================ */

/* Flex Utilities */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-start { display: flex; justify-content: flex-start; align-items: center; }
.flex-end { display: flex; justify-content: flex-end; align-items: center; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* Spacing Utilities */
.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.px-sm { padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); }
.px-md { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.px-lg { padding-left: var(--spacing-lg); padding-right: var(--spacing-lg); }

.py-sm { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-md { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-lg { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }

/* ============================================
   BUTTONS - Small & Modern
   ============================================ */

.btn-primary,
.btn-outline,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  min-height: 36px;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-on-dark);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-text-on-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-main);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.btn-sm {
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-xs);
  min-height: 28px;
}

.btn-lg {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: var(--font-size-md);
  min-height: 44px;
}

/* ============================================
   HEADER - Modern & Compact
   ============================================ */

.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--color-primary);
  color: var(--color-text-on-dark);
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-lg);
  flex-wrap: wrap;
  min-height: var(--header-height);
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text-on-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.logo:hover {
  opacity: 0.9;
}

.logo img {
  height: 36px;
  width: auto;
  margin-right: var(--spacing-sm);
  object-fit: contain;
}

.location {
  display: flex;
  align-items: center;
  margin: 0 var(--spacing-lg);
  font-size: var(--font-size-sm);
  color: var(--color-text-on-dark);
}

.location i {
  margin-right: var(--spacing-xs);
}

.search-bar {
  flex: 1;
  display: flex;
  min-width: 250px;
  max-width: 600px;
  margin: 0 var(--spacing-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
}

.search-bar select {
  border: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-surface);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--color-text-main);
  border-right: 1px solid var(--color-border-light);
}

.search-bar input {
  flex: 1;
  border: none;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-base);
  color: var(--color-text-main);
  background: var(--color-bg);
}

.search-bar input:focus {
  outline: none;
}

.search-bar button {
  background: var(--color-accent);
  border: none;
  padding: 0 var(--spacing-lg);
  cursor: pointer;
  transition: var(--transition);
  color: var(--color-text-on-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-bar button:hover {
  background: #e88a00;
}

.nav-icons {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.nav-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--color-text-on-dark);
  text-decoration: none;
  font-size: var(--font-size-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  min-width: 50px;
}

.nav-icon:hover {
  background: rgba(255,255,255,0.1);
}

.nav-icon i {
  font-size: var(--font-size-lg);
  margin-bottom: 2px;
}

.nav-icon span {
  font-size: var(--font-size-xs);
  line-height: 1;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-accent);
  color: var(--color-text-main);
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border: 2px solid var(--color-primary);
}

.sub-header {
  background: #232F3E;
  padding: var(--spacing-sm) var(--spacing-lg);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-height: var(--sub-header-height);
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--color-text-on-dark);
  font-size: var(--font-size-base);
  padding: var(--spacing-xs) var(--spacing-sm);
  cursor: pointer;
  margin-right: var(--spacing-md);
  transition: var(--transition);
  border-radius: var(--radius-sm);
}


.category-sidebar {
  position: sticky;
  top: 120px; /* adjust if your header is sticky */
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}


.sidebar-toggle:hover {
  background: rgba(255,255,255,0.1);
}

.sub-nav {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  align-items: center;
}

.sub-nav a {
  color: var(--color-text-on-dark);
  text-decoration: none;
  font-size: var(--font-size-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.sub-nav a:hover {
  background: rgba(255,255,255,0.1);
}

/* Enhanced Banner */
.banner {
  background: linear-gradient(135deg, #1a2a6c, #2a5298);
  color: white;
  padding: 40px 10px;
  text-align: center;
  margin-bottom: 30px;
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
}

.banner h1 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 700;
}

.banner p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 25px;
  opacity: 0.9;
}

.signin-btn {
  background: var(--amazon-yellow);
  border: 1px solid #a88734;
  border-radius: 4px;
  padding: 12px 25px;
  color: #111;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.signin-btn:hover {
  background: #e6b800;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ============================================
   SECTION HEADERS - Small & Modern
   ============================================ */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--spacing-xl) 0 var(--spacing-lg);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--color-accent);
}

.section-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  margin: 0;
}

.section-title i {
  margin-right: var(--spacing-sm);
  color: var(--color-accent);
  font-size: var(--font-size-lg);
}

.see-all {
  color: #007185;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}

.see-all:hover {
  color: #C7511F;
  text-decoration: underline;
}

/* Enhanced Card Grid with Image Improvements */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

/* Enhanced Card Styles - Image Display Improvements */
.card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  border: 1px solid #e7e7e7;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border-color: var(--amazon-orange);
}

.card-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--amazon-orange);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  z-index: 2;
}

.card-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-border-light);
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.card-content {
  padding: var(--spacing-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: var(--font-size-md);
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-main);
  line-height: var(--line-height-tight);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.card-description {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-md);
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
}

.card-meta {
  display: flex;
  align-items: center;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.partner-logo {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
  border: 1px solid #eee;
}

.partner-name {
  font-size: 0.9rem;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-button {
  background: var(--amazon-yellow);
  border: 1px solid #a88734;
  border-radius: 4px;
  padding: 12px;
  color: #111;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.card-button:hover {
  background: #e6b800;
}

.category-card {
  text-align: center;
}

.category-card .card-image {
  height: 180px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.category-card .card-title {
  font-size: 1.2rem;
  margin: 10px 0;
}

/* Enhanced Sidebar */
.category-sidebar { 
  background: #fff; 
  border-radius: var(--border-radius); 
  padding: 20px; 
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 120px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.category-header h5 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--amazon-primary);
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list > li { 
  position: relative; 
  margin-bottom: 5px;
}

.category-list > li > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-radius: 8px;
  color: var(--amazon-dark);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.category-list > li > a:hover, 
.category-list > li > a.active {
  background: rgba(26, 42, 108, 0.05);
  color: var(--amazon-primary);
}

.category-count {
  background: #eaeaea;
  color: #555;
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 30px;
  text-align: center;
}

.subcats {
  list-style: none;
  padding: 10px 0 5px 20px;
  margin: 0;
  display: block;
}

.subcats li {
  margin-bottom: 5px;
}

.subcats a {
  display: flex;
  justify-content: space-between;
  padding: 8px 15px;
  border-radius: 8px;
  color: #555;
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.95rem;
}

.subcats a:hover, 
.subcats a.active {
  background: rgba(26, 42, 108, 0.03);
  color: var(--amazon-primary);
}

/* Enhanced Active Filters */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 25px;
}

.filter-badge {
  display: flex;
  align-items: center;
  background: rgba(26, 42, 108, 0.1);
  color: var(--amazon-primary);
  padding: 8px 15px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
}

.filter-badge .close {
  margin-left: 8px;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-badge .close:hover {
  opacity: 1;
}

/* Enhanced Toast Notification */
.toast-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 9999;
}

.toast {
  background: var(--amazon-primary);
  color: white;
  border-radius: 8px;
  padding: 15px 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
}

.toast i {
  font-size: 1.5rem;
  color: var(--amazon-orange);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Enhanced Footer */
footer { 
  background: var(--amazon-secondary); 
  color: #ccc; 
  padding: 40px 0 20px; 
  margin-top: 40px; 
}

.footer-content {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
}

.back-to-top {
  background: var(--amazon-secondary);
  text-align: center;
  padding: 15px 0;
  border-bottom: 1px solid #3a4553;
}

.back-to-top a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  padding: 40px 0;
}

.footer-column h5 { 
  color: white; 
  margin-bottom: 20px;
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-links-list {
  list-style: none;
  padding: 0;
}

.footer-links-list li {
  margin-bottom: 12px;
}

.footer-links-list a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.footer-links-list a:hover {
  color: white;
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid #3a4553;
  text-align: center;
  font-size: 0.9rem;
  color: #999;
}

/* Enhanced Pagination */
.pagination {
  margin-top: 30px;
  display: flex;
  justify-content: center;
}

.page-item {
  margin: 0 5px;
}

.page-link {
  color: var(--amazon-primary);
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 15px;
  transition: all 0.2s ease;
}

.page-link:hover {
  background: var(--amazon-primary);
  color: white;
  border-color: var(--amazon-primary);
}

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

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
  margin-left: auto;
}

.mobile-nav {
  display: none;
  background: var(--amazon-secondary);
  padding: 15px;
}

.mobile-nav .nav-icons {
  flex-direction: column;
  gap: 15px;
  align-items: flex-start;
}

.mobile-nav .nav-icon {
  flex-direction: row;
  gap: 10px;
  padding: 8px 15px;
  width: 100%;
}

.mobile-nav .nav-icon i {
  font-size: 18px;
  margin-bottom: 0;
}

/* Responsive Design Enhancements */
@media (max-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 992px) {
  .top-header {
    flex-direction: column;
    gap: 15px;
  }
  
  .search-bar {
    width: 100%;
    max-width: 100%;
    margin: 10px 0;
  }
  
  body {
    padding-top: 160px;
  }
  
  .category-sidebar {
    top: 160px;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .banner h1 {
    font-size: 1.8rem;
  }
  
  .banner p {
    font-size: 1rem;
  }
  
  .card-image {
    height: 200px;
  }
}

/* ============================================
   RESPONSIVE BREAKPOINTS - Mobile First
   ============================================ */

/* Mobile: < 576px */
@media (max-width: 575.98px) {
  /* Header adjustments */
  .top-header {
    padding: var(--spacing-xs) var(--spacing-sm);
    flex-wrap: wrap;
  }
  
  .logo img {
    height: 28px;
  }
  
  .search-bar {
    order: 3;
    width: 100%;
    margin: var(--spacing-xs) 0 0;
    min-width: unset;
    max-width: 100%;
  }
  
  .nav-icons {
    gap: var(--spacing-sm);
  }
  
  .nav-icon {
    min-width: 40px;
    font-size: var(--font-size-xs);
  }
  
  .nav-icon i {
    font-size: var(--font-size-md);
  }
  
  .sub-header {
    padding: var(--spacing-xs) var(--spacing-sm);
  }
  
  .sub-nav {
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
  }
  
  .sub-nav a {
    padding: var(--spacing-xs);
  }
  
  /* Cards - 1 per row on mobile */
  .card-scroll-row {
    gap: var(--spacing-sm);
  }
  
  .scroll-card {
    flex: 0 0 calc(100% - var(--spacing-sm));
    min-width: 0;
  }
  
  /* Section headers */
  .section-header {
    margin: var(--spacing-lg) 0 var(--spacing-md);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }
  
  .section-title {
    font-size: var(--font-size-lg);
  }
}

/* Tablet: 576px - 991px */
@media (min-width: 576px) and (max-width: 991.98px) {
  .search-bar {
    max-width: 500px;
  }
  
  .scroll-card {
    flex: 0 0 calc(50% - var(--spacing-md));
  }
  
  .section-title {
    font-size: var(--font-size-xl);
  }
}

/* Desktop: >= 992px */
@media (min-width: 992px) {
  .scroll-card {
    flex: 0 0 calc(25% - var(--spacing-md));
  }
}

/* Legacy mobile menu toggle */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .nav-icons {
    display: none;
  }
  
  .sub-nav {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
    flex-wrap: nowrap;
  }
  
  .sub-nav a {
    white-space: nowrap;
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
  }
  
  .card-image {
    height: 180px;
  }
  
  .footer-links {
    grid-template-columns: 1fr;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  body {
    padding-top: 140px;
  }
  
  .category-sidebar {
    position: relative;
    top: 0;
  }
}

@media (max-width: 768px) {
  .search-bar {
    flex-direction: column;
    width: 100%;
  }

  .search-bar select,
  .search-bar input {
    width: 100%;
    margin-bottom: 8px;
    border-radius: 4px;
  }

  .search-bar button {
    width: 50px;
    align-self: flex-end;
    border-radius: 50%;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .search-bar {
    gap: 0;
  }
}
    
@media (max-width: 576px) {
  .logo-container {
    width: 100%;
    justify-content: space-between;
  }
  
  .location {
    margin: 5px 0;
    width: 100%;
    justify-content: center;
  }
  
  .sub-header {
    padding: 10px 15px;
  }
  
  .sidebar-toggle {
    margin-right: 10px;
  }
  
  body {
    padding-top: 180px;
  }
  
  .banner {
    padding: 20px 15px;
  }
  
  .card-content {
    padding: 15px;
  }
  
  .card-title {
    font-size: 1rem;
  }
  
  .card-price {
    font-size: 1.2rem;
  }
  
  .section-title {
    font-size: 1.3rem;
  }
  
  .card-image {
    height: 160px;
  }
}

.mobile-nav {
  display: none;
  background: var(--amazon-secondary);
  padding: 15px;
  transition: all 0.3s ease;
}
.mobile-nav.show {
  display: block;
}

/* Image Loading Enhancements */
.card-image {
  position: relative;
}

.card-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  z-index: 1;
}

.card-image.loaded::before {
  display: none;
}

.card-image img {
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-image.loaded img {
  opacity: 1;
}

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

/* Today's Deals Section */
.deals-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.deals-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.deal-link {
  display: flex;
  align-items: center;
  color: var(--amazon-dark);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 8px 15px;
  border-radius: 20px;
  background: rgba(255,255,255,0.8);
  transition: var(--transition);
  white-space: nowrap;
}

.deal-link:hover {
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.deal-link i {
  margin-right: var(--spacing-xs);
  color: var(--color-accent);
}

/* Improved Sidebar */
.category-header .btn-outline-primary {
  font-size: 0.85rem;
  padding: 4px 8px;
}

.category-list a.active {
  background: rgba(26, 42, 108, 0.1);
  color: #232F3E;
  font-weight: 600;
}

.category-list a.active .category-count {
  background: rgba(26, 42, 108, 0.2);
}

/* Active Filter Badges */
.filter-badge {
  background: rgba(26, 42, 108, 0.15);
  padding: 6px 12px;
}

/* Scrollbar styling for sidebar */
.category-sidebar::-webkit-scrollbar {
  width: 8px;
}

.category-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.category-sidebar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.category-sidebar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Lazy loading enhancements */
.lazy-img {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lazy-img.loaded {
  opacity: 1;
}

/* ============================================
   PRODUCT CARD COMPONENT
   Modern, clean, responsive product cards
   ============================================ */

.product-card {
  background: var(--af-surface);
  border-radius: var(--af-radius-md);
  overflow: hidden;
  box-shadow: var(--af-shadow-soft);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.product-card:hover {
  box-shadow: var(--af-shadow-md);
  transform: translateY(-2px);
}

.product-card__media {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 aspect ratio */
  overflow: hidden;
  background: var(--af-surface-muted);
}

.product-card__figure {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  text-decoration: none;
}

.product-card__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.product-card__badge {
  position: absolute;
  top: var(--af-gap-sm);
  left: var(--af-gap-sm);
  background: var(--af-primary);
  color: var(--af-text-on-dark);
  padding: 0.25rem 0.5rem;
  border-radius: var(--af-radius-sm);
  font-size: var(--af-font-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
  box-shadow: var(--af-shadow-soft);
}

.product-card__hover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--af-gap-md);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.product-card:hover .product-card__hover {
  opacity: 1;
}

.product-card__hover-btn,
.product-card__hover-form button {
  background: var(--af-surface);
  color: var(--af-text-main);
  border: none;
  padding: var(--af-gap-md) var(--af-gap-lg);
  border-radius: var(--af-radius-sm);
  font-size: var(--af-font-small);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--af-gap-sm);
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--af-shadow-soft);
}

.product-card__hover-btn:hover {
  background: var(--af-primary);
  color: var(--af-text-on-dark);
  transform: translateY(-2px);
}

.product-card__hover-form button:hover {
  background: var(--af-primary);
  color: var(--af-text-on-dark);
  transform: translateY(-2px);
}

.product-card__body {
  padding: var(--af-gap-md);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--af-gap-sm);
}

.product-card__title {
  font-size: var(--af-font-base);
  font-weight: 500;
  color: var(--af-text-main);
  text-decoration: none;
  line-height: var(--af-line-tight);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.5em;
  transition: color 0.2s ease;
}

.product-card__title:hover {
  color: var(--af-primary);
}

.product-card__meta {
  display: flex;
  align-items: center;
  gap: var(--af-gap-sm);
  flex-wrap: wrap;
  font-size: var(--af-font-small);
  color: var(--af-text-muted);
}

.product-card__vendor {
  font-weight: 500;
}

.product-card__country {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.product-card__country img {
  width: 24px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
  border: 1px solid var(--af-border);
  flex-shrink: 0;
  display: block;
  background: var(--af-surface-muted);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.product-card__price {
  font-size: var(--af-font-large);
  font-weight: 700;
  color: var(--af-primary);
  margin-top: auto;
}

.product-card__actions-mobile {
  display: flex;
  gap: var(--af-gap-sm);
  margin-top: var(--af-gap-sm);
}

.product-card__view-btn,
.product-card__cart-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border-radius: var(--af-radius-sm);
  font-size: var(--af-font-small);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  border: 1px solid var(--af-border);
  background: var(--af-surface);
  color: var(--af-text-main);
  cursor: pointer;
}

.product-card__view-btn:hover {
  background: var(--af-primary-soft);
  color: var(--af-primary);
  border-color: var(--af-primary);
}

.product-card__cart-btn {
  background: var(--af-primary);
  color: var(--af-text-on-dark);
  border-color: var(--af-primary);
}

.product-card__cart-btn:hover {
  background: var(--af-primary-dark);
  border-color: var(--af-primary-dark);
}

@media (min-width: 769px) {
  .product-card__actions-mobile {
    display: none;
  }
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--af-gap-lg);
  margin-bottom: var(--af-gap-xl);
}

@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--af-gap-md);
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}