/* Items Page Layout */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #e3f2fd 0%, #f5f5f5 100%);
  color: #333;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.6;
  padding-top: 0;
}

/* Page Header Styling */
.items-container h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #2d3748;
  text-align: center;
}

.items-container h2 span:first-child {
  color: #2d3748;
}

.items-container h2 span:last-child {
  color: #2196f3;
}

/* Search and Filter Section Improvements */
.search-filter-section {
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-container {
  max-width: 500px;
  margin: 0 auto 1.5rem auto;
  position: relative;
}

.search-container input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  background: #fff;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

.search-container input:focus {
  border-color: #2196f3;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.15);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #9ca3af;
  pointer-events: none;
}

/* Category Filter Styling */
#category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.category-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #e5e7eb;
  border-radius: 25px;
  color: #4a5568;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  font-size: 0.9rem;
  text-transform: capitalize;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-btn:hover {
  background: rgba(33, 150, 243, 0.1);
  border-color: #2196f3;
  color: #1976d2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.category-btn.active {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%) !important;
  border-color: #1976d2 !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

/* Filter Controls Styling */
.filter-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

/* Additional Filters */
.additional-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.additional-filters select {
  padding: 0.5rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  cursor: pointer;
}

.additional-filters select:focus {
  border-color: #2196f3;
}

#clear-filters {
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  display: none;
}

#clear-filters:hover {
  background: #e5e7eb;
  color: #374151;
}

/* Results Summary */
#results-summary {
  text-align: center;
  margin-top: 1rem;
  color: #6b7280;
  font-size: 0.9rem;
}

/* Quick Filters Styling */
#quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

#quick-filters > div {
  display: flex !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  margin-bottom: 1rem !important;
}

.quick-filter-btn {
  padding: 0.4rem 0.8rem !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 20px !important;
  font-size: 0.8rem !important;
  color: #495057 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.quick-filter-btn:hover {
  background: rgba(33, 150, 243, 0.1) !important;
  border-color: #2196f3 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 10px rgba(33, 150, 243, 0.2) !important;
}

.quick-filter-btn.active,
.quick-filter-btn[style*="rgb(33, 150, 243)"] {
  background: #2196f3 !important;
  color: white !important;
  border-color: #2196f3 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 12px rgba(33, 150, 243, 0.3) !important;
}

/* Navigation Link Hover Effects - Match Homepage */

/* Logo Hover Animation */
#logo-link:hover svg {
  animation: cartBounce 0.6s ease;
}

@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1) rotate(5deg); }
}

/* Cart Icon Shimmer Effect */
#cart-icon:hover {
  filter: drop-shadow(0 0 8px rgba(33, 150, 243, 0.6));
  animation: cartShimmer 0.6s ease;
}

@keyframes cartShimmer {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05) rotate(2deg); }
}

/* Enhanced Container with Mobile Support */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  margin-top: 0;
  padding-top: 1rem;
}

/* Enhanced Items Page Styles with Mobile Responsiveness */
.items-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin: 2rem auto;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Improved Layout with Enhanced Controls */
.items-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Search Bar Improvements */
.search-container {
  position: relative;
  background: white;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

.search-container:focus-within {
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.15);
}

.search-container input {
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #333;
}

.search-container button {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

.search-container button:hover {
  background: #1976d2;
}

/* Enhanced Filter and Sort Options */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.filter-select {
  flex: 1;
  min-width: 150px;
  appearance: none;
  padding: 0.8rem 1.5rem;
  background-color: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  color: #424242;
  cursor: pointer;
  transition: all 0.3s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2em;
}

.filter-select:hover, .filter-select:focus {
  border-color: #2196f3;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.filter-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background-color: #f5f5f5;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  color: #424242;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-button:hover {
  background-color: #eeeeee;
  border-color: #bdbdbd;
}

.filter-button.active {
  background-color: #e3f2fd;
  border-color: #2196f3;
  color: #1976d2;
}

/* Enhanced Card Grid Layout with Flex Support */
.card-grid,
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.item-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.item-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(33, 150, 243, 0.15);
}

.item-image {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.item-card:hover .item-image img {
  transform: scale(1.05);
}

.item-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.item-badge.sale {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.item-badge.new {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.item-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.item-category {
  font-size: 0.85rem;
  color: #757575;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.item-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #212121;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.item-description {
  font-size: 0.95rem;
  color: #616161;
  margin-bottom: 1rem;
  line-height: 1.6;
  flex-grow: 1;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.item-rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stars {
  color: #ffc107;
  font-size: 1rem;
  letter-spacing: 0.1rem;
}

.rating-count {
  font-size: 0.85rem;
  color: #757575;
}

.item-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1976d2;
}

.item-original-price {
  font-size: 1rem;
  color: #9e9e9e;
  text-decoration: line-through;
  margin-left: 0.5rem;
}

.item-footer {
  padding: 1.25rem;
  display: flex;
  border-top: 1px solid #f0f0f0;
  justify-content: space-between;
}

.add-to-cart {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  justify-content: center;
}

.add-to-cart:hover {
  background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.item-action {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  background: white;
  color: #757575;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.item-action:hover {
  border-color: #2196f3;
  color: #2196f3;
  background: #e3f2fd;
}

/* Pagination Controls */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  gap: 0.5rem;
}

.page-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  font-size: 1rem;
  color: #424242;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-item.active {
  background: #2196f3;
  color: white;
  border-color: #2196f3;
  font-weight: 600;
}

.page-item:hover:not(.active) {
  border-color: #2196f3;
  background: #e3f2fd;
  color: #1976d2;
}

.page-nav {
  width: auto;
  padding: 0 1rem;
}

/* No Items Found State */
.no-items {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.no-items img {
  width: 200px;
  height: auto;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.no-items h3 {
  font-size: 1.5rem;
  color: #424242;
  margin-bottom: 1rem;
}

.no-items p {
  font-size: 1rem;
  color: #757575;
  max-width: 500px;
  margin-bottom: 1.5rem;
}

.refresh-button {
  padding: 0.75rem 2rem;
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.refresh-button:hover {
  background: #1976d2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* No Results Styling */
#no-results {
  display: none;
  text-align: center;
  padding: 3rem;
  color: #6b7280;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  margin: 2rem 0;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

#no-results svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: #d1d5db;
}

#no-results h3 {
  margin-bottom: 0.5rem;
  color: #374151;
  font-size: 1.5rem;
  font-weight: 600;
}

#no-results p {
  color: #6b7280;
  font-size: 1rem;
  margin: 0;
}

/* Recently Viewed Container */
#recently-viewed-container {
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Clear search button styling */
#clear-search {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  display: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 1.2rem;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
}

#clear-search:hover {
  background: rgba(156, 163, 175, 0.1);
  color: #374151;
}

/* Navigation Link Hover Effects - Match Homepage */

/* Footer Styling */
footer {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2rem 0;
  margin-top: 4rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

footer .container {
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.footer-links a {
  color: #4a5568;
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.footer-links a:hover {
  color: #2196f3;
}

footer p {
  color: #6b7280;
  margin: 0;
  font-size: 0.9rem;
}

/* Related Products Section */
.related-products {
  margin-top: 3rem;
  padding: 2rem 0;
}

.related-products h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 2rem;
}

/* Item Modal Improvements */
#item-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  padding: 1em;
  backdrop-filter: blur(5px);
}

#item-modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 900px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Item Container */
.item-container {
  display: none;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .items-container {
    padding: 1.5rem;
    margin: 1rem auto;
  }

  .items-container h2 {
    font-size: 2rem;
  }

  .search-filter-section {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  .search-container {
    margin-bottom: 1rem;
  }

  #category-filter {
    gap: 0.5rem;
  }

  .category-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .quick-filter-btn {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.75rem !important;
  }

  .additional-filters {
    flex-direction: column;
    gap: 0.75rem;
  }

  .additional-filters select {
    width: 100%;
    max-width: 250px;
  }

  .card-grid,
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .item-image {
    height: 180px;
  }

  .item-content {
    padding: 1.25rem;
  }
  
  .item-name {
    font-size: 1.1rem;
  }
}

/* Tablet and Up Responsive Adjustments */
@media (min-width: 768px) {
  .items-controls {
    grid-template-columns: 1fr 1fr;
  }
  
  .filter-container {
    justify-content: flex-end;
  }
  
  .add-to-cart {
    transform: translateY(5px);
    opacity: 0;
  }
  
  .item-card:hover .add-to-cart {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Larger Desktop Responsive Adjustments */
@media (min-width: 1200px) {
  .card-grid,
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
  }
  
  .item-image {
    height: 220px;
  }
  
  .items-container {
    padding: 2.5rem;
  }
}
