/* Shop Page Styles */
.shop-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 2rem 0;
  border-bottom: 1px solid #dee2e6;
}

.shop-title {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 3rem;
  color: var(--dark-grey);
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

/* Shop Main Content */
.shop-main {
  padding: 3rem 0;
  min-height: 80vh;
}

/* Filters Sidebar */
.filters-sidebar {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  position: static;
  height: fit-content;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.filters-header h3 {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  color: var(--dark-grey);
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.clear-filters-btn {
  background: none;
  border: none;
  color: #6c757d;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.clear-filters-btn:hover {
  color: var(--dark-grey);
}

/* Filter Groups */
.filter-group {
  margin-bottom: 1.5rem;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f4;
  transition: all 0.3s ease;
}

.filter-header:hover {
  background: #f8f9fa;
  margin: 0 -1rem;
  padding: 1rem;
  border-radius: 8px;
}

.filter-header span {
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  color: var(--dark-grey);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.filter-header i {
  color: #6c757d;
  transition: transform 0.3s ease;
}

.filter-header.active i {
  transform: rotate(180deg);
}

.filter-options {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.filter-options.active {
  max-height: 500px;
}

/* Filter Links */
.filter-link {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--dark-grey);
  transition: all 0.3s ease;
  border-radius: 8px;
  margin-bottom: 4px;
}

.filter-link:hover {
  background-color: var(--dark-grey);
  color: white;
  text-decoration: none;
}

.filter-link .option-text {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Shop Header Content */
.shop-header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.shop-all-link {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark-grey);
  text-decoration: none;
  font-family: 'Roboto', sans-serif;
}

.shop-all-link:hover {
  color: var(--dark-grey);
  text-decoration: none;
  opacity: 0.8;
}

/* Category Navigation */
.category-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.category-nav-link {
  display: inline-block;
  padding: 8px 16px;
  background-color: #f8f9fa;
  color: var(--dark-grey);
  text-decoration: none;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.category-nav-link:hover {
  background-color: var(--dark-grey);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
}

.category-nav-link:active {
  transform: translateY(0);
}

.category-nav-link.active {
  background-color: var(--dark-grey);
  color: white;
  border-color: var(--dark-grey);
  font-weight: 600;
}

/* Filter Options */
.filter-option {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin: 0.25rem 0;
}

.filter-option:hover {
  background: #f8f9fa;
  padding-left: 0.5rem;
}

.filter-option input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  margin-right: 0.75rem;
  position: relative;
  transition: all 0.3s ease;
}

.filter-option input[type="checkbox"]:checked + .checkmark {
  background: var(--dark-grey);
  border-color: var(--dark-grey);
}

.filter-option input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.option-text {
  font-size: 0.9rem;
  color: var(--dark-grey);
  font-weight: 500;
}

/* Products Section */
.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.products-count {
  font-size: 1rem;
  color: #6c757d;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-btn-shop {
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
}

.contact-btn-shop:hover {
  background: var(--dark-grey);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(23, 43, 56, 0.3);
}

.contact-icon-shop {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #20B2AA, #48CAE4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(32, 178, 170, 0.3);
  align-self: center;
}

.contact-btn-shop:hover .contact-icon-shop {
  background: white;
}

.contact-icon-shop i {
  font-size: 1.2rem;
  color: white;
}

.contact-btn-shop:hover .contact-icon-shop i {
  color: var(--dark-grey);
}

.contact-text-shop {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}

.contact-title-shop {
  font-size: 0.9rem;
  color: var(--dark-grey);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

.contact-btn-shop:hover .contact-title-shop {
  color: white;
}

.contact-subtitle-shop {
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 500;
  line-height: 1.2;
}

.sort-dropdown .form-select {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--dark-grey);
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sort-dropdown .form-select:focus {
  border-color: var(--dark-grey);
  box-shadow: 0 0 0 0.2rem rgba(23, 43, 56, 0.25);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.product-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  z-index: 1;
}

.product-card:hover::before {
  transform: translateX(100%);
}

.product-image-container {
  position: relative;
  overflow: hidden;
  min-height: 475px;
}

/* Product Image Link */
.product-image-link {
  display: block;
  text-decoration: none;
  transition: transform 0.3s ease;
}

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

/* Product ID Link */
.product-id-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.product-id-link:hover {
  color: var(--primary-color);
}

.product-id-link:hover .product-name {
  color: var(--primary-color);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 475px;
  transition: transform 0.4s ease;
}

/* Round rug images should not have min-height */
.product-card[data-category="round-rug"] .product-image {
  min-height: unset;
}

/* Round rug price display */
.product-card[data-category="round-rug"] .product-price {
  line-height: 1.4;
  font-size: 1rem;
}

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

.favorite-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dee2e6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
}

.favorite-btn:hover {
  background: white;
  border-color: #ff6b6b;
  transform: scale(1.1);
}

.favorite-btn.active {
  background: #ff6b6b;
  border-color: #ff6b6b;
  color: white;
}

.favorite-btn i {
  font-size: 1.1rem;
  color: inherit;
  transition: all 0.3s ease;
}

.product-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-name {
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--dark-grey);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.product-category {
  margin-bottom: 0.5rem;
}

.category-tag {
  display: inline-block;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

/* Category-specific colors */
.category-tag[data-category="handmade-collection"] {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.category-tag[data-category="classic-rug"] {
  background: linear-gradient(135deg, #8e44ad, #9b59b6);
}


.category-tag[data-category="machine-made-rug"] {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.category-tag[data-category="pictorial-rug"] {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.category-tag[data-category="digitally-printed-rug"] {
  background: linear-gradient(135deg, #34495e, #2c3e50);
}

.category-tag[data-category="round-rug"] {
  background: linear-gradient(135deg, #e67e22, #f39c12);
}

.product-dimensions {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 1rem;
  font-weight: 500;
}

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark-grey);
  margin-bottom: 1rem;
}

.product-badges {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-handmade {
  background: #e8f5e8;
  color: #2d5a2d;
}

.badge-origin {
  background: #fff3cd;
  color: #856404;
}

.product-actions {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  margin-top: auto;
  padding-top: 1rem;
}

.btn-product {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: white;
  color: var(--dark-grey);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 0.9rem;
}

.btn-product:hover {
  background: #25d366;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-product.primary {
  background: var(--dark-grey);
  color: white;
}

.btn-product.primary:hover {
  background: #0f1e2a;
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.page-item {
  list-style: none;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  color: var(--dark-grey);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.page-link:hover {
  background: var(--dark-grey);
  color: white;
  border-color: var(--dark-grey);
  transform: translateY(-2px);
}

.page-item.active .page-link {
  background: var(--dark-grey);
  color: white;
  border-color: var(--dark-grey);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Loading Animation */
.loading-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 200px;
  grid-column: 1 / -1;
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--dark-grey);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: #6c757d;
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

/* Image Loading Skeleton */
.image-loading-skeleton {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

.loading-spinner-small {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-small {
  width: 24px;
  height: 24px;
  border: 2px solid #e0e0e0;
  border-top: 2px solid var(--dark-grey);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

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

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

.no-results i {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: #dee2e6;
}

.no-results h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dark-grey);
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .shop-title {
    font-size: 2rem;
  }
  
  .products-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .header-actions {
    width: 100%;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .contact-btn-shop {
    width: 100%;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  
  .filters-sidebar {
    position: static;
    margin-bottom: 2rem;
    max-height: none; /* Ensure no height restrictions */
    overflow: visible; /* Ensure no overflow restrictions */
  }
  
  /* Prevent filter options from causing page scroll on mobile */
  .filter-options.active {
    max-height: 300px; /* Reduced height for tablet/mobile */
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .shop-main {
    padding: 2rem 0;
  }
  
  .filters-sidebar {
    padding: 1.5rem;
  }
  
  /* Fix filter options height on mobile to prevent scrolling */
  .filter-options.active {
    max-height: 200px; /* Reduced from 500px for mobile */
  }
  
  /* Ensure filters container doesn't cause page scroll */
  .filters-sidebar {
    overflow: visible !important;
    max-height: none !important;
  }
  
  /* Prevent any unwanted scrolling in filter groups */
  .filter-group {
    overflow: visible;
  }
}

/* Filter Animation Enhancements */
.filter-group {
  animation: slideInFromLeft 0.6s ease forwards;
}

.filter-group:nth-child(2) { animation-delay: 0.1s; }
.filter-group:nth-child(3) { animation-delay: 0.2s; }
.filter-group:nth-child(4) { animation-delay: 0.3s; }
.filter-group:nth-child(5) { animation-delay: 0.4s; }
.filter-group:nth-child(6) { animation-delay: 0.5s; }

/* Product Card Stagger Animation */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }

/* Smooth transitions for filter changes */
.products-grid {
  transition: opacity 0.3s ease;
}

.products-grid.filtering {
  opacity: 0.7;
}

/* Custom scrollbar for filter options */
.filter-options::-webkit-scrollbar {
  width: 4px;
}

.filter-options::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.filter-options::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.filter-options::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
