/*
 * SKATEZAR - Gorilla-Powered Marketplace 🦍
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  /* Base Colors - Warm Beige Skateboard Theme */
  --background: #F5F1E8;        /* Warm beige */
  --surface: #FEFAF3;           /* Light cream */
  --white: #FEFAF3;
  --background-grey: #F5F1E8;
  --bg-light: #F5F1E8;
  --card-white: #FEFAF3;
  --bg-card: #FEFAF3;

  /* Primary - Terracotta */
  --primary: #D4704A;
  --primary-dark: #B7410E;
  --primary-light: #E88B65;
  --primary-bg: #FCE8DD;

  /* Secondary - Sage Green */
  --secondary: #8BA888;
  --secondary-dark: #6B8A6A;
  --secondary-light: #A5C2A3;
  --secondary-bg: #E8F0E7;

  /* Accent - Mustard */
  --accent: #E5A846;
  --accent-dark: #D19534;
  --accent-light: #F0BC5E;
  --accent-bg: #FDF4E3;

  /* Highlight - Deep Teal */
  --highlight: #4A8B8A;
  --highlight-dark: #3A6F6E;
  --highlight-light: #5FA5A4;
  --highlight-bg: #E1F0F0;

  /* Success - Forest Green */
  --success: #6B8A6A;
  --success-dark: #556E54;
  --success-light: #8BA888;
  --success-bg: #E8F0E7;

  /* Warning - Golden Yellow */
  --warning: #E5A846;
  --warning-dark: #D19534;
  --warning-light: #F0BC5E;

  /* Error - Burnt Orange */
  --error: #D14E10;
  --error-dark: #B7410E;
  --error-bg: #FCE8DD;

  /* Text & Borders - Dark on light */
  --text: #3A3A3A;
  --text-dark: #2C2C2C;
  --text-primary: #3A3A3A;
  --text-medium: #6B6B6B;
  --text-secondary: #7A7A7A;
  --text-light: #9A9A9A;
  --border-grey: #D9D3C7;
  --border-light: #E5DFD3;

  /* Legacy aliases for backward compatibility */
  --blue-main: var(--secondary);
  --blue-dark: var(--secondary-dark);
  --blue-light: var(--secondary-light);
  --blue-lightest: var(--secondary-bg);
  --accent-blue: var(--secondary);
  --accent-lighter: var(--secondary-bg);
  --accent-light: var(--accent-bg);
  --gorilla-green: var(--success);
  --gorilla-green-dark: var(--success-dark);
  --gorilla-green-light: var(--success-light);
  --gorilla-green-bg: var(--success-bg);

  /* Typography */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 40px;

  /* Font Weights */
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.15);
}

body {
  background: var(--background);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

/* === HEADER / NAV === */
header {
  background: var(--surface);
  border-bottom: 3px solid var(--primary);
  padding: 20px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(212, 112, 74, 0.15);
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

header h1 {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

header h1 a {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

header h1 a:hover {
  color: var(--accent);
  transform: scale(1.05);
}

header .nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

header .nav-links a,
header .nav-links button {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

header .nav-links a:hover,
header .nav-links button:hover {
  background: var(--bg-light);
  color: var(--accent);
  transform: translateY(-2px);
}

header .nav-links button {
  background: var(--primary);
  color: var(--text-primary);
}

header .nav-links button:hover {
  background: var(--primary-light);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(183, 65, 14, 0.5);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

/* Hide mobile list button on desktop */
.mobile-list-btn {
  display: none !important;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* === MAIN CONTENT === */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* === ALERTS === */
/* Alerts are now handled by toast notifications in application.html.erb */

/* === BUTTONS === */
.btn, input[type="submit"], button[type="submit"] {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--surface);
  border: none;
  padding: 14px 28px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
  border-radius: var(--radius-lg);
  transition: all 0.1s ease;
  box-shadow: 0 4px 0 var(--primary-dark), 0 6px 12px rgba(212, 112, 74, 0.2);
  text-transform: none;
  position: relative;
  border-bottom: 4px solid var(--primary-dark);
}

.btn:hover, input[type="submit"]:hover, button[type="submit"]:hover {
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--primary-dark), 0 8px 16px rgba(212, 112, 74, 0.3);
  color: var(--surface);
}

.btn:active, input[type="submit"]:active, button[type="submit"]:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--secondary-dark), 0 3px 6px rgba(0, 0, 0, 0.1);
}

.btn-danger {
  background: var(--error);
  color: var(--surface);
}

.btn-danger:hover {
  background: var(--error-dark);
  box-shadow: var(--shadow-md);
  color: var(--surface);
}

/* === FORMS === */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 14px 18px;
  border: 3px solid var(--border-light);
  background: var(--white);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  margin: 8px 0;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  font-weight: 500;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
textarea:hover,
select:hover {
  border-color: var(--border-grey);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 4px 0 var(--primary-light), 0 6px 12px rgba(212, 112, 74, 0.2);
  transform: translateY(-2px);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 8px 0;
  color: var(--text-primary);
}

/* === PRODUCTS GRID === */
.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--accent-bg) 50%, var(--secondary-bg) 100%);
  padding: 32px;
  border-radius: var(--radius-xl);
  border: 3px solid var(--primary);
  box-shadow: 0 6px 20px rgba(212, 112, 74, 0.15);
}

.products-header h1 {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.gorilla-accent {
  font-size: 48px;
  display: inline-block;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(-5deg);
  }
  50% {
    transform: translateY(0) rotate(0deg);
  }
  75% {
    transform: translateY(-5px) rotate(5deg);
  }
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.product-card {
  background: var(--white);
  border: 3px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--border-light), 0 6px 12px rgba(0, 0, 0, 0.08);
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 0 var(--primary-light), 0 12px 24px rgba(212, 112, 74, 0.25);
  border-color: var(--primary);
}

.product-card-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--bg-light);
  position: relative;
}

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

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

.product-card-content {
  padding: 20px;
}

.product-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 600;
}

.product-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin: 12px 0;
  display: inline-block;
}

.product-condition {
  display: inline-block;
  background: var(--secondary);
  color: var(--surface);
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 4px rgba(107, 138, 106, 0.3);
  text-transform: capitalize;
}

.product-seller {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 12px;
}

/* === PRODUCT DETAIL === */
.product-detail {
  max-width: 900px;
  margin: 0 auto;
}

.product-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.product-images img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.product-images img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.product-info {
  background: var(--white);
  border: 1px solid var(--border-light);
  padding: 32px;
  border-radius: 12px;
  margin: 32px 0;
  box-shadow: var(--shadow-sm);
}

.product-info h1 {
  font-size: 28px;
  margin-bottom: 16px;
}

.product-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
}

/* === FORM CONTAINERS === */
.form-container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border-light);
  padding: 32px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.form-section {
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 80px 40px;
  background: linear-gradient(135deg, var(--accent-bg) 0%, var(--primary-bg) 100%);
  border: 3px dashed var(--primary);
  border-radius: var(--radius-xl);
  margin: 32px 0;
  box-shadow: 0 6px 20px rgba(212, 112, 74, 0.1);
}

.empty-state::before {
  content: "🦍";
  font-size: 80px;
  display: block;
  margin-bottom: 24px;
  animation: wave 3s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-15deg);
  }
  75% {
    transform: rotate(15deg);
  }
}

.empty-state h2 {
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--text-primary);
  font-weight: 800;
}

.empty-state p {
  color: var(--text-medium);
  font-size: 18px;
  font-weight: 500;
}

/* === FILE UPLOAD === */
input[type="file"] {
  padding: 16px;
  background: var(--bg-light);
  border: 2px dashed var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="file"]:hover {
  border-color: var(--accent-blue);
  background: var(--accent-light);
}

/* === GORILLA DECORATIONS === */
.gorilla-accent {
  font-size: 20px;
  display: inline-block;
  animation: gentle-bounce 2s ease-in-out infinite;
}

@keyframes gentle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* === BACK LINK === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
  transition: all 0.2s ease;
}

.back-link:hover {
  color: var(--accent-blue);
}

/* === DUOLINGO-INSPIRED COMPONENTS === */

/* Primary Button (3D Effect) */
.btn-primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--surface);
  padding: 16px 32px;
  border-radius: var(--radius-lg);
  font-weight: var(--font-bold);
  font-size: var(--text-base);
  border: none;
  border-bottom: 4px solid var(--primary-dark);
  box-shadow: 0 4px 0 var(--primary-dark), 0 6px 12px rgba(212, 112, 74, 0.3);
  transition: all 0.1s ease;
  cursor: pointer;
  display: inline-block;
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--primary-dark), 0 8px 16px rgba(212, 112, 74, 0.4);
  color: var(--surface);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--primary-dark), 0 3px 6px rgba(212, 112, 74, 0.2);
}

/* Secondary Button */
.btn-secondary {
  background: var(--surface);
  color: var(--text-dark);
  padding: 16px 32px;
  border-radius: var(--radius-lg);
  font-weight: var(--font-bold);
  border: 3px solid var(--border-grey);
  border-bottom: 4px solid var(--border-grey);
  box-shadow: 0 4px 0 var(--border-grey);
  transition: all 0.1s ease;
  cursor: pointer;
  display: inline-block;
}

.btn-secondary:hover {
  background: var(--bg-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--border-grey);
  color: var(--text-dark);
  border-color: var(--text-light);
}

.btn-secondary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--border-grey);
}

/* Card with Gorilla */
.card-with-gorilla {
  position: relative;
  padding-top: var(--space-10);
}

.card-with-gorilla::before {
  content: "🦍";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 48px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

/* Progress Bars (Gamified) */
.progress-container {
  background: var(--blue-lightest);
  border-radius: var(--radius-full);
  height: 16px;
  overflow: hidden;
  position: relative;
  border: 2px solid var(--blue-light);
}

.progress-bar {
  background: linear-gradient(90deg, var(--blue-main) 0%, var(--blue-dark) 100%);
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(244, 238, 227, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Badges & Achievements */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: #F4EEE3;
  border: 3px solid var(--blue-main);
  border-radius: var(--radius-full);
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-sm);
  animation: pop-in 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes pop-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.badge-locked {
  opacity: 0.3;
  border-color: var(--border-grey);
  filter: grayscale(100%);
}

/* Gorilla Avatar */
.gorilla-avatar {
  font-size: 64px;
  display: inline-block;
  animation: wave 3s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

/* Gorilla Speech Bubble */
.gorilla-speech {
  position: relative;
  background: #F4EEE3;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 3px solid var(--blue-light);
  box-shadow: var(--shadow-md);
  margin-left: var(--space-6);
}

.gorilla-speech::before {
  content: "🦍";
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
}

.gorilla-speech::after {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid white;
}

/* Gorilla Tooltip */
.gorilla-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--blue-lightest);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  animation: slide-in-right 0.4s ease;
}

@keyframes slide-in-right {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Success Card */
.success-card {
  background: linear-gradient(135deg, var(--success) 0%, #22C55E 100%);
  color: #F4EEE3;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: celebrate 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes celebrate {
  0% {
    transform: scale(0.5) rotate(-5deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Level Badge */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: var(--text-dark);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-weight: var(--font-bold);
  border: 3px solid #FF8C00;
  box-shadow: 0 4px 0 #FF8C00;
  font-size: var(--text-sm);
}

/* Empty State (Friendly) */
.empty-state-gorilla {
  font-size: 120px;
  margin-bottom: var(--space-4);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #F4EEE3;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-left: 4px solid var(--blue-main);
  animation: slide-in-down 0.4s ease;
  z-index: 1000;
}

@keyframes slide-in-down {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast-gorilla {
  font-size: 32px;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--error);
}

/* Loading States */
.loading-gorilla {
  text-align: center;
  padding: var(--space-8);
}

.loading-gorilla-emoji {
  font-size: 64px;
  display: inline-block;
  animation: loading-spin 2s linear infinite;
}

@keyframes loading-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--background-grey) 25%,
    #E5E7EB 50%,
    var(--background-grey) 75%
  );
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* Filter Section Styles */
.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--blue-main) !important;
  box-shadow: 0 0 0 3px var(--blue-lightest) !important;
}

/* Active Filter Badge */
.active-filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--blue-lightest);
  border: 2px solid var(--blue-light);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--blue-dark);
}

/* === MOBILE RESPONSIVE STYLES === */
@media (max-width: 768px) {
  /* Mobile Filter Modal */
  #mobile-filter-toggle {
    display: block !important;
  }

  #filter-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
  }

  #filter-section.filter-modal-active {
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-6) var(--space-4);
  }

  #filter-section > div:first-child {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    max-width: 600px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: slide-up 0.3s ease;
  }

  @keyframes slide-up {
    from {
      transform: translateY(50px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  #close-filter-modal {
    display: inline-block !important;
  }

  /* Header & Navigation */
  header {
    padding: 12px 16px;
  }

  header nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  header h1 {
    font-size: 20px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  header .nav-links {
    position: fixed;
    top: 60px;
    right: -100%;
    width: 280px;
    height: calc(100vh - 60px);
    background: var(--white);
    border-left: 1px solid var(--border-light);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
  }

  header .nav-links.active {
    right: 0;
  }

  header .nav-links a,
  header .nav-links button {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    text-align: left;
    justify-content: flex-start;
    border-radius: 8px;
  }

  /* Make Sell button more prominent on mobile */
  header .nav-links a[href*="products/new"] {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    color: var(--surface) !important;
    font-weight: 700;
    border: none;
    border-bottom: 4px solid var(--primary-dark);
    box-shadow: 0 4px 0 var(--primary-dark), 0 6px 12px rgba(212, 112, 74, 0.3);
    margin-bottom: 12px;
    order: -1;
  }

  header .nav-links a[href*="products/new"]:hover {
    transform: translateY(-2px);
  }

  /* Main Content */
  main {
    padding: 20px 16px;
  }

  /* Products Grid */
  .products-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .products-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .products-header h1 {
    font-size: 24px;
  }

  /* Product Cards */
  .product-card-image {
    height: 200px;
  }

  /* Product Detail */
  .product-detail {
    padding: 0;
  }

  .product-images {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
  }

  .product-info {
    padding: 20px;
    margin: 20px 0;
  }

  .product-info h1 {
    font-size: 22px;
  }

  .product-price {
    font-size: 28px;
  }

  /* Forms */
  .form-container {
    padding: 20px;
    margin: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Buttons */
  .btn, input[type="submit"], button[type="submit"] {
    width: 100%;
    padding: 14px 20px;
  }

  .product-actions {
    flex-direction: column;
  }

  /* Empty State */
  .empty-state {
    padding: 40px 20px;
  }

  .empty-state::before {
    font-size: 48px;
  }

  .empty-state h2 {
    font-size: 20px;
  }

  /* Alerts */
  .notice, .alert {
    font-size: 14px;
    padding: 12px 16px;
  }

  /* Wizard Steps (Product Form) */
  .wizard-container {
    padding: 0 !important;
  }

  /* Conversations */
  .back-link {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .products-header {
    padding: 20px;
  }

  .gorilla-accent {
    font-size: 36px;
  }
}

/* === ADDITIONAL GAMIFICATION === */

/* Coin Badge */
.coin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: var(--text-dark);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 800;
  border: 3px solid #FF8C00;
  border-bottom: 4px solid #FF8C00;
  box-shadow: 0 4px 0 #FF8C00, 0 6px 12px rgba(255, 165, 0, 0.3);
  font-size: 16px;
  animation: coin-pulse 2s ease-in-out infinite;
}

@keyframes coin-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Achievement Badge */
.achievement-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: #F4EEE3;
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  font-weight: 700;
  border-bottom: 4px solid var(--secondary-dark);
  box-shadow: 0 4px 0 var(--secondary-dark), 0 6px 12px rgba(249, 115, 22, 0.3);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 24px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 3px solid var(--border-grey);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gorilla-green) 0%, var(--gorilla-green-light) 100%);
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(88, 204, 2, 0.4);
}

/* Streak Counter */
.streak-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--warning-light) 0%, var(--warning) 100%);
  color: #F4EEE3;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 18px;
  border: 3px solid var(--warning-dark);
  border-bottom: 4px solid var(--warning-dark);
  box-shadow: 0 4px 0 var(--warning-dark), 0 6px 12px rgba(245, 158, 11, 0.3);
}

/* Confetti Effect (for celebrations) */
@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Shake Animation (for errors) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* Celebration Burst */
@keyframes celebrate {
  0% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.2) rotate(180deg);
  }
  100% {
    transform: scale(1) rotate(360deg);
  }
}

.celebrate {
  animation: celebrate 0.6s ease-in-out;
}

@media (max-width: 480px) {
  /* Extra small devices */
  header h1 {
    font-size: 18px;
  }

  header .nav-links {
    grid-template-columns: 1fr;
  }

  .products-header h1 {
    font-size: 20px;
  }

  .product-card-image {
    height: 180px;
  }

  .product-price {
    font-size: 24px;
  }

  main {
    padding: 16px 12px;
  }

  /* Make share button smaller on mobile */
  .share-btn-mobile {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }

  .share-btn-mobile span:last-child {
    display: none;
  }

  /* Show mobile list button */
  .mobile-list-btn {
    display: inline-flex !important;
  }

  /* Hide the desktop list button from products header on mobile */
  .products-header .desktop-list-btn {
    display: none !important;
  }

  /* Center the heading on mobile */
  .products-header h1 {
    justify-content: center !important;
  }
}
