/* Modern Shop Page Design - Force Override All Bootstrap */

/* Override body styles for shop page */
body {
  background-color: #fafbfc !important;
  padding-top: 110px !important;
}

/* Reset Bootstrap row/col overrides */
.products-container .row,
.products-container .col,
.products-container .col-*,
.products-container [class*="col-"] {
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: none !important;
}

/* Main grid override */
.container .main-content {
  display: grid !important;
  grid-template-columns: 280px 1fr !important;
  gap: 3rem !important;
}

/* Products container force grid */
.products-container,
.main1,
#productsContainer {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 2rem !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Container adjustments */
.container {
  max-width: 1320px;
}

/* Hero Section - Compact */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 0 1.5rem;
  margin-bottom: 2rem;
}

.hero-content {
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 1rem;
}

.breadcrumb-item a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: white;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  padding: 1rem 2rem;
  border-radius: 50px;
  backdrop-filter: blur(10px);
}

.hero-stats .stat-number {
  font-size: 2rem;
  font-weight: 700;
  margin-right: 0.5rem;
}

/* Main Content Layout - Compact */
.main-content {
  display: grid !important;
  grid-template-columns: 260px 1fr !important;
  gap: 2rem !important;
  margin-bottom: 2rem !important;
  width: 100% !important;
}

/* Sidebar */
.sidebar {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.sidebar-section {
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2d3748;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-item {
  margin-bottom: 0.5rem;
}

.category-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #4a5568;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.category-link:hover,
.category-link.active {
  background-color: #667eea;
  color: white;
  transform: translateX(4px);
}

.category-link i {
  margin-right: 0.5rem;
  font-size: 0.8rem;
}

.help-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.help-btn {
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  background: white;
  color: #4a5568;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.2s;
}

.help-btn:hover {
  background-color: #f7fafc;
  border-color: #667eea;
  color: #667eea;
}

/* Products Section */
.products-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.products-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-info {
  font-size: 0.95rem;
  color: #4a5568;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.view-toggle {
  display: flex;
  background: #f7fafc;
  border-radius: 8px;
  padding: 4px;
}

.view-btn {
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: #4a5568;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn.active {
  background: white;
  color: #667eea;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Product Grid */
.products-grid {
  padding: 1.5rem;
}

.products-grid .products-container.main1 {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
  gap: 1.5rem !important;
  margin-bottom: 2rem !important;
  padding: 0 !important;
  width: 100% !important;
}

.products-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
  gap: 1.5rem !important;
  margin-bottom: 2rem !important;
  padding: 0 !important;
}

/* Product Card */
.product-card,
.product-card.postid,
article.product-card {
  background: white !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: 1px solid #e2e8f0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  position: relative !important;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-color: #667eea;
}

.product-image-container {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: #f7fafc;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-badge {
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 6px;
  color: white;
  backdrop-filter: blur(10px);
}

.badge-fda {
  background: rgba(16, 185, 129, 0.9);
}

.badge-sale {
  background: rgba(239, 68, 68, 0.9);
}

.product-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  opacity: 0;
  transition: opacity 0.3s;
}

.product-card:hover .product-actions {
  opacity: 1;
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #4a5568;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.action-btn:hover {
  background: white;
  color: #667eea;
}

.product-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-category {
  font-size: 0.8rem;
  color: #667eea;
  font-weight: 500;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  height: 2.8rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.product-title a:hover {
  color: #667eea;
}

.product-description {
  font-size: 0.9rem;
  color: #718096;
  line-height: 1.5;
  margin-bottom: 1rem;
  height: 3rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.rating-stars {
  display: flex;
  gap: 2px;
}

.star {
  color: #fbbf24;
  font-size: 0.8rem;
}

.rating-text {
  font-size: 0.8rem;
  color: #718096;
}

.product-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.product-price-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #667eea;
}

.price-old {
  font-size: 0.9rem;
  color: #a0aec0;
  text-decoration: line-through;
  margin-left: 0.5rem;
}

.product-actions-footer {
  display: flex;
  gap: 0.75rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: #667eea;
  color: white;
  flex: 1;
}

.btn-primary:hover {
  background: #5a67d8;
  transform: translateY(-1px);
}

.btn-outline {
  border: 1px solid #e2e8f0;
  background: white;
  color: #4a5568;
}

.btn-outline:hover {
  border-color: #667eea;
  color: #667eea;
}

/* Load More */
.load-more-section {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid #e2e8f0;
}

.load-more-btn {
  padding: 1rem 2rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover {
  background: #5a67d8;
  transform: translateY(-1px);
}

.load-more-btn:disabled,
.load-more-btn.disabled {
  background: #a0aec0 !important;
  cursor: not-allowed !important;
  transform: none !important;
  opacity: 0.6 !important;
}

/* List View */
.products-container.list-view {
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.list-view .product-card {
  flex-direction: row;
  height: auto;
}

.list-view .product-image-container {
  width: 200px;
  height: 150px;
  flex-shrink: 0;
}

.list-view .product-content {
  flex: 1;
}

.list-view .product-footer {
  border-top: none;
  padding-top: 0;
}

.list-view .product-actions-footer {
  margin-top: auto;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  font-size: 4rem;
  color: #a0aec0;
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.empty-description {
  color: #718096;
  margin-bottom: 2rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  
  .sidebar {
    position: static !important;
    order: 2 !important;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 70px;
  }
  
  .hero-section {
    padding: 2rem 0 1.5rem;
    margin-bottom: 2rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .products-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  
  .products-grid {
    padding: 1.5rem;
  }
  
  .products-header {
    padding: 1rem 1.5rem;
    flex-direction: column;
    align-items: stretch;
  }
  
  .list-view .product-card {
    flex-direction: column;
  }
  
  .list-view .product-image-container {
    width: 100%;
    height: 200px;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 15px;
  }
  
  .products-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .products-grid {
    padding: 1rem;
  }
  
  .product-content {
    padding: 1rem;
  }
  
  .sidebar-section {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }
}

/* Animation for product cards loading */
.product-card {
  animation: fadeInUp 0.6s ease-out;
}

/* Loading spinner animation */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}