/* Search Page Container */
.search-page-container {
  padding-top: 40px; /* Add space below header */
  min-height: 100vh;
}

@media (max-width: 991.98px) {
  .search-page-container {
    padding-top: 0px; /* Reduce space on mobile */
  }
}

/* Search Header */
.search-header {
  position: relative;
  padding: 80px 0 60px;
    background: linear-gradient(135deg, rgba(255, 106, 224, 0.05) 0%, rgba(233, 30, 99, 0.1) 100%);
  overflow: hidden;
}

.search-header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
    background: conic-gradient(from 0deg, transparent, rgba(233, 30, 99, 0.1), transparent 120deg);
  animation: rotate 20s linear infinite;
}

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

.search-header-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

/* Search Results Header */
.search-results-header {
  max-width: 600px;
  margin: 0 auto;
}

.search-icon-wrapper {
  width: 80px;
  height: 80px;
  background: var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(233, 30, 99, 0.2);
  animation: pulse 2s infinite;
}

.search-icon-wrapper i {
  font-size: 2rem;
  color: white;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.search-title {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--primary-blue);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
}

.search-term-display {
  margin-bottom: 20px;
}

.search-label {
  font-size: 1.1rem;
  color: #666;
  margin-left: 10px;
}

.search-term {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--secondary-pink);
  background: rgba(233, 30, 99, 0.1);
  padding: 5px 15px;
  border-radius: 20px;
  border: 1px solid rgba(233, 30, 99, 0.2);
}

.search-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.results-count {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  border-radius: 25px;
  border: 1px solid var(--gray-200);
  font-weight: 600;
  color: var(--gray-800);
}

.btn-reset {
  background: linear-gradient(135deg, #ff6b6b, #ff5252);
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-reset:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
  color: white;
}

/* All Products Header */
.all-products-header {
  max-width: 700px;
  margin: 0 auto;
}

.products-icon-wrapper {
  width: 100px;
  height: 100px;
  background: var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
    box-shadow: 0 15px 40px rgba(233, 30, 99, 0.2);
}

.products-icon-wrapper i {
  font-size: 2.5rem;
  color: white;
}

.products-title {
  font-size: 3rem;
  font-weight: 700;
  background: var(--primary-blue);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
}

.products-subtitle {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 25px;
  line-height: 1.6;
}

/* Statistics Cards */
.search-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.products-stats {
  margin-top: 25px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.stats-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(15px);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--primary-blue);
  transition: left 0.5s ease;
}

.stats-card:hover::before {
  left: 0;
}

.stats-card:hover {
  transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(233, 30, 99, 0.15);
}

.stats-card i {
  font-size: 1.8rem;
  color: var(--secondary-pink);
  margin-bottom: 10px;
  display: block;
}

.stats-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: 5px;
}

.stats-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

/* Products Section */
.products-section {
  padding: 40px 15px 60px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  background: var(--blue-200);
  border: 1px solid var(--primary-blue);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
  backdrop-filter: blur(5px);
}

.filter-info {
  font-weight: 600;
  color: var(--gray-900);
}

.showing-results {
  font-size: 1rem;
  color: var(--gray-900);
}

.showing-results b {
  color: var(--gray-900);
  font-weight: 600;
}

.view-options {
  display: flex;
  gap: 10px;
}

.view-btn {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: #666;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
}

.view-btn:hover,
.view-btn.active {
  background: var(--primary-blue);
  color: white;
  border-color: transparent;
}

/* Products Container */
.products-container {
  width: 100%;
}

/* Products Grid Layout */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

/* Products List Layout */
.products-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.products-list .product-card-wrapper {
  width: 100%;
}

.products-list .product-card {
  display: flex;
  padding: 25px;
  align-items: flex-start;
  gap: 25px;
  min-height: 200px;
}

.products-list .product-image-container {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
}

.products-list .product-info {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.products-list .product-name {
  font-size: 1.3rem;
  margin-bottom: 15px;
}

.products-list .product-description {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}

.products-list .price-section {
  margin-bottom: 20px;
}

.products-list .current-price {
  font-size: 1.5rem;
}

.products-list .product-actions {
  margin-top: auto;
  max-width: 200px;
}

/* Product Card */
.product-card-wrapper {
  position: relative;
}

.product-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(15px);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-blue);
}

.product-card.out-of-stock {
  opacity: 0.7;
  filter: grayscale(0.3);
}

/* Product Badges */
.product-badges {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.discount-badge {
  background-color: var(--gray-900);
  color: var(--white);
}

.limited-badge {
  background-color: var(--primary-blue);
  color: var(--white);
}

.out-of-stock-badge {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  color: white;
}

/* Product Image */
.product-image-container {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.quick-view-btn {
  background: var(--primary-blue);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.quick-view-btn:hover {
  transform: scale(1.05);
  color: white;
}

/* Product Info */
.product-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  line-height: 1.3;
}

.product-name a {
  color: var(--gray-800);
  font-family: 'Cairo', sans-serif;
  text-decoration: none;
  transition: color 0.3s ease;
}

.product-name a:hover {
  color: var(--secondary-pink);
}

.product-description {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 15px;
}

/* Price Section */
.price-section {
  margin-bottom: 15px;
}

.price-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.current-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary-pink);
}

.original-price {
  font-size: 1rem;
  color: #999;
  text-decoration: line-through;
}

.savings {
  background: rgba(46, 204, 113, 0.1);
  color: #27ae60;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Stock Status */
.stock-status {
  margin-bottom: 15px;
}

.in-stock {
  color: #27ae60;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.out-of-stock {
  color: #e74c3c;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Product Actions */
.product-actions {
  margin-top: auto;
}

.btn-primary {
  background: var(--primary-blue);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  border: none;
  width: 100%;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--primary-blue-dark);
  color: white;
  text-decoration: none;
}

.btn-primary:focus {
  color: white;
  text-decoration: none;
  outline: none;
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.3);
}

.btn-primary:visited {
  color: white;
  text-decoration: none;
}

.btn-disabled {
  background: #ecf0f1;
  color: #95a5a6;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  width: 100%;
  cursor: not-allowed;
}

/* No Results */
.no-results-container {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}

.no-results-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(15px);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 50px 40px;
  text-align: center;
  max-width: 600px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.no-results-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
}

.no-results-icon i {
  font-size: 2rem;
  color: white;
}

.no-results-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 15px;
}

.no-results-text {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 30px;
  line-height: 1.6;
}

.no-results-suggestions {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
  text-align: right;
}

.no-results-suggestions h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 15px;
}

.no-results-suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.no-results-suggestions li {
  padding: 8px 0;
  color: #666;
  position: relative;
  padding-right: 20px;
}

.no-results-suggestions li::before {
  content: '•';
  color: var(--secondary-pink);
  position: absolute;
  right: 0;
  font-weight: bold;
}

.btn-back-to-products {
  background: var(--primary-blue);
  color: white;
  padding: 12px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-back-to-products:hover {
  transform: translateY(-3px);
  background: var(--primary-blue-dark);
  color: white;
}

/* Pagination */
.pagination-section {
  padding: 40px 0;
  border-top: 1px solid var(--gray-200);
  margin-top: 40px;
}

.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.pagination-info {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  font-weight: 600;
  color: var(--gray-800);
}

.custom-pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 10px;
}

.custom-pagination .page-item {
  display: flex;
}

.custom-pagination .page-link {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--gray-200);
  color: var(--gray-800);
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 45px;
  text-align: center;
}

.custom-pagination .page-link:hover {
  background: var(--primary-blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(233, 30, 99, 0.2);
}

.custom-pagination .page-item.active .page-link {
  background: var(--primary-blue);
  color: white;
  box-shadow: 0 5px 15px rgba(233, 30, 99, 0.2);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }
  
  .products-list .product-card {
    padding: 20px;
    gap: 20px;
  }
  
  .products-list .product-image-container {
    width: 150px;
    height: 150px;
  }
  
  .products-list .product-name {
    font-size: 1.2rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .search-header {
    padding: 60px 0 40px;
  }
  
  .search-title, .products-title {
    font-size: 2rem;
  }
  
  .products-subtitle {
    font-size: 1rem;
  }
  
  .search-stats {
    flex-direction: column;
    gap: 15px;
  }
  
  .filter-bar {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }
  
  .products-list .product-card {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .products-list .product-image-container {
    width: 100%;
    height: 220px;
    margin-bottom: 15px;
  }
  
  .products-list .product-info {
    align-items: center;
    text-align: center;
  }
  
  .products-list .product-actions {
    max-width: 100%;
    width: 100%;
  }
  
  .no-results-card {
    padding: 30px 20px;
    margin: 0 15px;
  }
  
  .pagination-container {
    padding: 0 15px;
  }
  
  .custom-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .stats-card {
    padding: 15px;
  }
  
  .stats-number {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .search-title, .products-title {
    font-size: 1.8rem;
  }
  
  .search-icon-wrapper, .products-icon-wrapper {
    width: 60px;
    height: 60px;
  }
  
  .search-icon-wrapper i {
    font-size: 1.5rem;
  }
  
  .products-icon-wrapper i {
    font-size: 2rem;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .products-list .product-card {
    padding: 15px;
  }
  
  .products-list .product-image-container {
    height: 200px;
  }
  
  .filter-bar {
    padding: 15px;
    flex-direction: column;
    gap: 15px;
  }
  
  .product-image-container {
    height: 200px;
  }
  
  .product-info {
    padding: 15px;
  }
  
  .product-name {
    font-size: 1rem;
  }
  
  .current-price {
    font-size: 1.2rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .view-options {
    width: 100%;
    justify-content: center;
  }
  
  .btn-primary, .btn-disabled {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
}

.search-mode-container {
  display: none;
  width: 100%;
  padding: 1rem 0;
  background: linear-gradient(135deg, var(--secondary-pink) 0%, #ffb6d5 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1000;
  border-bottom: 1px solid rgba(233, 30, 99, 0.1);
}

.search-mode-container form {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 15px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-mode-input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-left: 2.5rem;
  border: 1px solid rgba(233, 30, 99, 0.2);
  border-radius: 50px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, var(--secondary-pink) 0%, #ffb6d5 100%);
}

.search-mode-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 0.25rem rgba(233, 30, 99, 0.25);
  outline: none;
}

.search-input-wrapper button {
  position: absolute;
  left: 10px;
  background: none;
  border: none;
  color: var(--primary-blue);
  font-size: 1.1rem;
  cursor: pointer;
}

/* Search Icon in Header */
.search-icon-container {
  cursor: pointer;
  padding: 0.5rem;
  margin-left: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon-container i {
  font-size: 1.25rem;
  color: #333;
  transition: color 0.2s ease;
}

.search-icon-container:hover i {
  color: var(--primary-blue);
}

/* Close Button in Search Mode */
#close-search {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #666;
  margin-left: 0.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

#close-search:hover {
  color: var(--secondary-pink);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .search-mode-container form {
    padding: 0 10px;
  }
  
  .search-mode-input {
    padding: 0.6rem 0.8rem;
    padding-left: 2.2rem;
    font-size: 0.9rem;
  }
  
  .search-input-wrapper button {
    left: 8px;
    font-size: 1rem;
  }
}

.filter-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.badge-sale {
  background-color: var(--secondary-pink);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-limited {
  background-color: var(--primary-blue);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-reset-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background-color: var(--gray-100);
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast) ease;
  border: 1px solid var(--primary-blue);
}

.btn-reset-filter:hover {
  background-color: var(--primary-blue);
  color: var(--gray-100);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--gray-100);
}

.btn-reset-filter i {
  font-size: 0.8rem;
}