/* Product Images Responsive Styling */
.products-place {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap:3rem; /* Increased gap for more space between boxes */
  padding: 3rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  
}

.item {
  max-width: 400px;
  width: 100%;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 1.5rem; /* Increased padding for more space */
  text-align: center;
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

/* Enhanced Image Styling for Consistency */
.item img {
  width: 100%;
  height: 250px; /* Fixed height for uniform appearance */
  object-fit: cover; /* Ensures proper cropping without distortion */
  object-position: center; /* Centers the image within the container */
  border-radius: 12px;
  background: #f8f9fa; /* Light gray background for loading/placeholder */
  display: block; /* Removes extra space below images */
  margin: 0 auto; /* Centers the image horizontally */
}

/* Image container for better control */
.image-container {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  border-radius: 12px;
  background: #f8f9fa;
  margin-bottom: 1rem;
}

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

.item:hover .image-container img {
  transform: scale(1.05); /* Subtle zoom effect on hover */
}

/* Responsive Design with Media Queries */

/* Tablets (768px and below) */
@media (max-width: 768px) {
  .products-place {
    padding: 2rem 1rem;
    gap: 1.25rem;
  }
  
  .item {
    max-width: 350px;
    padding: 1rem;
  }
  
  .item img,
  .image-container {
    height: 220px; /* Slightly smaller height for tablets */
  }
}

/* Mobile Phones (480px and below) */
@media (max-width: 480px) {
  .products-place {
    padding: 1.5rem 0.75rem;
    gap: 1rem;
  }
  
  .item {
    max-width: 100%;
    padding: 0.875rem;
  }
  
  .item img,
  .image-container {
    height: 200px; /* Smaller height for mobile devices */
    border-radius: 10px;
  }
  
  .image-container {
    margin-bottom: 0.75rem;
  }
}

/* Large screens (1200px and above) */
@media (min-width: 1200px) { 
  .products-place {
    padding: 3rem 2rem;
    gap: 4rem;
  }
  
  .item {
    max-width: 380px;
    padding: 1.5rem;
  }
  
  .item img,
  .image-container {
    height: 280px; /* Larger height for big screens */
  }
}

/* High DPI/Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .item img {
    /* Ensure crisp images on high DPI screens - Edge compatible */
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .item,
  .item img,
  .image-container img {
    transition: none;
  }
  
  .item:hover {
    transform: none;
  }
}

/* Fallback for older browsers */
@supports not (object-fit: cover) {
  .item img {
    width: auto;
    max-width: 100%;
    max-height: 250px;
    margin: 0 auto;
  }
}

/* Search Results Page - Professional Styling */
.find-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem 1rem;
}

.find-header {
  text-align: center;
  color: white;
  margin-bottom: 2rem;
}

.find-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.find-header p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  background: rgba(255,255,255,0.1);
  border-radius: 50px;
  -webkit-backdrop-filter: blur(10px); /* Added for Safari support */
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}

.back-link:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.back-link::before {
  content: "←";
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

/* Search Results Container */
.search-results {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.search-info {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 15px;
  border-left: 4px solid #667eea;
}

.search-info h2 {
  color: #495057;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.search-keyword {
  color: #667eea;
  font-weight: 700;
  font-size: 1.3rem;
}

.results-count {
  color: #6c757d;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* Enhanced Product Grid for Search Results */
.search-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.search-item {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  border: 1px solid rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}

.search-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.search-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.search-item:hover::before {
  transform: scaleX(1);
}

.search-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.search-item:hover img {
  transform: scale(1.05);
}

.search-item h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.search-item .price {
  font-size: 1.4rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 1rem;
}

.search-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.search-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.search-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.search-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.search-btn-outline {
  background: transparent;
  border: 2px solid #667eea;
  color: #667eea;
}

.search-btn-outline:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

/* No Results State */
.no-results {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.no-results h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #495057;
}

.no-results p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Responsive Design for Search Page */
@media (max-width: 768px) {
  .find-header h1 {
    font-size: 2rem;
  }
  
  .search-results {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .search-products {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .search-actions {
    flex-direction: column;
  }
  
  .search-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .find-page {
    padding: 1rem 0.5rem;
  }
  
  .search-results {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 15px;
  }
  
  .search-item {
    padding: 1rem;
  }
  
  .search-item img {
    height: 180px;
  }
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Home Page - Professional Styling */
.home-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Hero Header */
.hero-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
  padding: 4rem 1rem;
  text-align: center;
  color: white;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
  font-size: 1.3rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* Hero Search */
.hero-search {
  max-width: 600px;
  margin: 0 auto;
}

.search-container {
  display: flex;
  background: white;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.hero-search-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  outline: none;
  font-size: 1.1rem;
}

.hero-search-btn {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.hero-search-btn:hover {
  transform: translateX(-2px);
}

/* Enhanced Main Navigation */
.main-nav {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: #667eea;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo::before {
  content: "🛒";
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: #2d3748;
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  font-size: 1rem;
}

.nav-link:hover {
  color: #667eea;
  transform: translateY(-2px);
}

.nav-link.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: #667eea;
  border-radius: 50%;
}

/* Cart badge */
.cart-badge {
  position: relative;
}

.cart-badge::after {
  content: '0';
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-btn span {
  width: 25px;
  height: 3px;
  background: #2d3748;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Main Content */
.main-content {
  background: white;
  min-height: 60vh;
}

.featured-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.5rem;
  color: #2d3748;
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.2rem;
  color: #6c757d;
}

/* Product Actions */
.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-outline {
  background: transparent;
  border: 2px solid #667eea;
  color: #667eea;
}

.btn-outline:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

/* Main Footer */
.main-footer {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  color: white;
  padding: 3rem 1rem 1rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  margin-bottom: 1rem;
  color: #667eea;
}

.footer-section a {
  color: #cbd5e0;
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: #667eea;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #a0aec0;
}

/* Responsive Design for Home Page */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-content p {
    font-size: 1.1rem;
  }
  
  .search-container {
    flex-direction: column;
    border-radius: 15px;
  }
  
  .hero-search-input {
    border-radius: 15px 15px 0 0;
  }
  
  .hero-search-btn {
    border-radius: 0 0 15px 15px;
  }
  
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-header {
    padding: 2rem 1rem;
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .featured-section {
    padding: 2rem 1rem;
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

/* Print styles */
@media print {
  .item img {
    height: auto;
    max-height: 200px;
    object-fit: contain;
  }
}
