/* ===== MODERN CSS RESET & NORMALIZATION ===== */

/* Modern CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Modern CSS Reset with better defaults */
html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Remove default button styling */
button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
}

/* Remove default list styling */
ul, ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Remove default link styling */
a {
  text-decoration: none;
  color: inherit;
}

/* Remove default input styling */
input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Remove default table styling */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Remove default form styling */
form {
  margin: 0;
  padding: 0;
}

/* Remove default fieldset styling */
fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

/* Remove default legend styling */
legend {
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  line-height: inherit;
}

/* Remove default hr styling */
hr {
  border: 0;
  height: 0;
  border-top: 1px solid rgba(0,0,0,0.1);
}

/* Remove default button focus outline */
button:focus {
  outline: none;
}

/* Remove default input focus outline */
input:focus, select:focus, textarea:focus {
  outline: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#main-content {
  flex: 1;
}

.header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  color: white;
  white-space: nowrap;
}

.logo-accent {
  color: #e94560;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  color: #a0a0b8;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: white;
  background: rgba(255,255,255,0.1);
}

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

.search-container {
  display: flex;
  gap: 0;
}

.search-input {
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px 0 0 6px;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 0.875rem;
  width: 200px;
  outline: none;
  transition: all 0.2s;
}

.search-input::placeholder {
  color: #6c6c8a;
}

.search-input:focus {
  background: rgba(255,255,255,0.15);
  border-color: #e94560;
}

.search-btn {
  padding: 8px 16px;
  background: #e94560;
  color: white;
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.search-btn:hover {
  background: #d63851;
}

.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 1.25rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.cart-btn:hover {
  background: rgba(255,255,255,0.1);
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #e94560;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
}

.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 16px;
  color: white;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero h1 span {
  color: #e94560;
}

.hero p {
  font-size: 1.1rem;
  color: #a0a0b8;
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  min-height: 44px;
}

.btn-primary {
  background: #e94560;
  color: white;
}

.btn-primary:hover {
  background: #d63851;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: #1a1a2e;
}

.featured-products {
  margin-bottom: 48px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.product-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid #eef0f5;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  border-color: #e94560;
}

.product-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.product-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #1a1a2e;
  line-height: 1.3;
}

.product-category {
  font-size: 0.8rem;
  color: #6c6c8a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #e94560;
  margin-bottom: 12px;
}

.product-compare {
  font-size: 0.85rem;
  color: #6c6c8a;
  margin-bottom: 12px;
}

.product-rating {
  color: #f59e0b;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.product-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-compare {
  background: #1a1a2e;
  color: white;
  flex: 1;
}

.btn-compare:hover {
  background: #16213e;
}

.btn-cart {
  background: #e94560;
  color: white;
  flex: 1;
}

.btn-cart:hover {
  background: #d63851;
}

.deals-section {
  margin-bottom: 48px;
}

.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.deal-card {
  background: linear-gradient(135deg, #e94560 0%, #d63851 100%);
  border-radius: 12px;
  padding: 28px;
  color: white;
  position: relative;
  overflow: hidden;
}

.deal-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.deal-discount {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
}

.deal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
  position: relative;
}

.deal-desc {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 16px;
  position: relative;
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.5);
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  min-height: 40px;
}

.btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: white;
}

.categories-section {
  margin-bottom: 48px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.category-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #eef0f5;
  text-decoration: none;
  color: inherit;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  border-color: #e94560;
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.category-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
}

.category-count {
  font-size: 0.85rem;
  color: #6c6c8a;
  margin-top: 4px;
}

.trending-section {
  margin-bottom: 48px;
}

.footer {
  background: #1a1a2e;
  color: #a0a0b8;
  padding: 48px 20px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 32px;
}

.footer-col h4 {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col p {
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-col a {
  display: block;
  color: #6c6c8a;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #e94560;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  min-height: 120px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #e94560;
}

.stat-label {
  font-size: 0.85rem;
  color: #6c6c8a;
  margin-top: 4px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.page-header p {
  color: #6c6c8a;
  font-size: 1rem;
}

.products-page-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  font-size: 0.9rem;
  color: #1a1a2e;
  cursor: pointer;
}

.compare-page .compare-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.compare-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #eef0f5;
}

.compare-card.featured {
  border-color: #e94560;
  box-shadow: 0 4px 16px rgba(233,69,96,0.15);
}

.compare-card h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.compare-retailer {
  font-size: 0.85rem;
  color: #6c6c8a;
  margin-bottom: 16px;
}

.compare-price {
  font-size: 2rem;
  font-weight: 800;
  color: #e94560;
  margin-bottom: 16px;
}

.compare-features {
  list-style: none;
  margin-bottom: 16px;
}

.compare-features li {
  padding: 8px 0;
  border-bottom: 1px solid #eef0f5;
  font-size: 0.9rem;
  color: #4a4a6a;
}

.compare-features li::before {
  content: '✓ ';
  color: #10b981;
  font-weight: 700;
}

/* ===== RESPONSIVE DESIGN & MEDIA QUERIES ===== */

/* Mobile-first approach - base styles for mobile */
@media (max-width: 480px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
  }
  
  .logo {
    font-size: 1.25rem;
  }
  
  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    gap: 2px;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  
  .nav-link {
    padding: 8px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .header-actions {
    order: 2;
    width: 100%;
    justify-content: space-between;
  }
  
  .search-container {
    order: 1;
    flex: 1;
    max-width: 180px;
  }
  
  .search-input {
    width: 100%;
    font-size: 0.75rem;
    min-height: 40px;
  }
  
  .search-btn {
    padding: 8px 12px;
    font-size: 0.75rem;
    min-height: 40px;
  }
  
  .cart-btn {
    padding: 8px;
    font-size: 1.1rem;
    min-width: 40px;
    min-height: 40px;
  }
  
  .hero {
    padding: 24px 16px;
  }
  
  .hero h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }
  
  .hero p {
    font-size: 1rem;
    padding: 0 8px;
    line-height: 1.5;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .btn {
    padding: 14px 24px;
    font-size: 0.9rem;
    min-height: 44px;
  }
  
  .page {
    padding: 20px 16px;
  }
  
  .section-title {
    font-size: 1.25rem;
    margin-bottom: 20px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
  
  .product-card {
    padding: 16px;
    min-height: 280px;
  }
  
  .product-image {
    height: 140px;
    font-size: 2.5rem;
    min-height: 140px;
  }
  
  .product-card h3 {
    font-size: 1rem;
    line-height: 1.3;
  }
  
  .product-price {
    font-size: 1.1rem;
  }
  
  .deals-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .deal-card {
    padding: 20px;
    min-height: 200px;
  }
  
  .deal-discount {
    font-size: 1.5rem;
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .category-card {
    padding: 16px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .category-icon {
    font-size: 1.5rem;
  }
  
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .footer-bottom {
    font-size: 0.8rem;
  }
  
  /* Enhanced mobile touch targets */
  button, .btn, .nav-link {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Mobile-specific search optimizations */
  .search-container {
    position: relative;
  }
  
  .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
  }
  
  .search-input {
    padding-left: 36px;
  }
}

/* Small mobile devices */
@media (max-width: 360px) {
  .header-inner {
    padding: 10px 12px;
  }
  
  .logo {
    font-size: 1.1rem;
  }
  
  .nav-link {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  
  .search-input {
    font-size: 0.7rem;
  }
  
  .hero {
    padding: 20px 12px;
  }
  
  .hero h1 {
    font-size: 1.6rem;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .page {
    padding: 16px 12px;
  }
}

/* Tablet styles */
@media (min-width: 481px) and (max-width: 768px) {
  .header-inner {
    padding: 16px 20px;
  }
  
  .logo {
    font-size: 1.4rem;
  }
  
  .nav {
    gap: 4px;
  }
  
  .nav-link {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
  
  .search-input {
    width: 220px;
    font-size: 0.875rem;
  }
  
  .hero {
    padding: 40px 20px;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
  }
  
  .deals-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }
  
  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
  
  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
  
  /* Tablet-specific optimizations */
  .hero p {
    max-width: 500px;
  }
  
  .page {
    padding: 28px 20px;
  }
}

/* Small desktop */
@media (min-width: 769px) and (max-width: 1024px) {
  .header-inner {
    padding: 0 24px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  
  .deals-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .stats-bar {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .page {
    padding: 32px 24px;
  }
  
  /* Small desktop optimizations */
  .hero {
    padding: 50px 24px;
  }
  
  .hero h1 {
    font-size: 2.3rem;
  }
  
  .nav-link {
    padding: 10px 16px;
  }
}

/* Large desktop */
@media (min-width: 1025px) {
  .header-inner {
    padding: 0 32px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  
  .deals-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .stats-bar {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .page {
    padding: 32px 32px;
  }
  
  /* Large desktop optimizations */
  .hero {
    padding: 60px 32px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero-actions {
    gap: 16px;
  }
}

/* Ultra-wide displays */
@media (min-width: 1440px) {
  .hero {
    max-width: 1400px;
    margin: 0 auto 40px;
  }
  
  .hero h1 {
    font-size: 2.8rem;
  }
  
  .product-grid {
    max-width: 1400px;
    margin: 0 auto;
  }
  
  .deals-grid {
    max-width: 1400px;
    margin: 0 auto;
  }
  
  .categories-grid {
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .product-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --text-primary: #e4e6eb;
    --text-secondary: #a0a0b8;
    --accent: #e94560;
  }
  
  body {
    background: var(--bg-primary);
    color: var(--text-primary);
  }
  
  .product-card,
  .category-card,
  .stat-card,
  .compare-card {
    background: var(--bg-secondary);
    border-color: #2a3142;
  }
  
  .nav-link {
    color: var(--text-secondary);
  }
  
  .nav-link:hover,
  .nav-link.active {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
  }
}

.spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

.spinner::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid #eef0f5;
  border-top-color: #e94560;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Authentication Styles */
.auth-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-section .welcome-text {
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  animation: fadeIn 0.3s ease-out;
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  border-radius: 8px;
  padding: 0;
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: slideIn 0.3s ease-out;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 1.25rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.close-btn:hover {
  background-color: #f3f4f6;
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #374151;
  font-size: 0.875rem;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #e94560;
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.auth-note {
  margin-top: 20px;
  padding: 12px;
  background-color: #f8fafc;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== ACCESSIBILITY & ENHANCED FEATURES ===== */

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #e94560;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 6px;
}

/* ===== CSS FEATURE DETECTION STYLES ===== */

/* Feature detection classes - these help with health checks */
.flexbox-detected {
  display: flex;
}

.grid-detected {
  display: grid;
}

.media-queries-detected {
  /* This will be applied via JavaScript if media queries work */
}

/* Modern CSS feature demonstration */
:root {
  --primary-color: #e94560;
  --secondary-color: #1a1a2e;
  --accent-color: #16213e;
  --text-color: #1a1a2e;
  --text-light: #6c6c8a;
  --bg-light: #f5f7fa;
  --border-color: #eef0f5;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.1);
}

/* CSS Variables usage for enhanced theming */
body {
  --primary-color: #e94560;
  --secondary-color: #1a1a2e;
  --accent-color: #16213e;
  --text-color: #1a1a2e;
  --text-light: #6c6c8a;
  --bg-light: #f5f7fa;
  --border-color: #eef0f5;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.1);
}

/* Enhanced CSS Grid and Flexbox usage */
.responsive-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  padding: 24px;
  background: var(--bg-light);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.responsive-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

/* CSS Custom Properties for consistent theming */
.theme-primary {
  background-color: var(--primary-color);
  color: white;
}

.theme-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.theme-accent {
  background-color: var(--accent-color);
  color: white;
}

/* ===== ANIMATIONS & TRANSITIONS ===== */

/* Enhanced animations */
@keyframes fadeIn {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Enhanced hover effects with transform and transition */
.product-card {
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.category-card {
  transform: translateY(0);
  transition: all 0.25s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.deal-card {
  transform: translateY(0);
  transition: all 0.3s ease;
}

.deal-card:hover {
  transform: translateY(-6px);
}

/* Loading animation for better UX */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Focus styles for accessibility */
.btn:focus,
.nav-link:focus,
.input:focus,
.select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced motion preference support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .product-card:hover,
  .category-card:hover,
  .deal-card:hover {
    transform: none;
  }
}

/* Print styles */
@media print {
  .header,
  .footer,
  .cart-btn,
  .search-container,
  .auth-section {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .product-card,
  .category-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
