/* Search Tabs Styling - Updated Design */
.search-tabs-container {
  margin-bottom: 15px;
  border-bottom: 1px solid #e5e7eb;
}

.search-tabs {
  display: flex;
  gap: 8px;
}

.search-tabs .nav-link {
  font-size: 16px;
  font-weight: 500;
  color: #6c757d;
  border-radius: 8px 8px 0 0;
  padding: 12px 20px;
  transition: all 0.3s ease;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  background-color: #f8f9fa;
}

.search-tabs .nav-link:hover {
  color: #0d6efd;
  background-color: #f0f7ff;
}

.search-tabs .nav-link.active {
  color: #0d6efd;
  background-color: #ffffff;
  border-bottom: none;
  position: relative;
  font-weight: 600;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
}

.search-tabs .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #fff;
}

/* Filter Section Styling - Improved Design */
.filter-section {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-container {
  width: 100%;
}

.filters-wrapper {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  flex: 1 1 auto;
  min-width: 160px;
}

.filter-select {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background-color: #fff;
  font-size: 14px;
  color: #212529;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.filter-select:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Loading Spinner Styling */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
  vertical-align: middle;
}

/* Search Results Count - Improved styling */
.searched-name {
  color: #495057;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 15px;
  background-color: rgba(240, 240, 240, 0.6);
  padding: 8px 16px;
  border-radius: 8px;
  display: inline-block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.searched-name-cont {
  display: flex;
  justify-content: center;
}

/* Improved Pagination Styling */
.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 30px 0 40px 0; /* Increased bottom margin */
}

/* Style for the "Showing x to y of z results" text */
.pagination-container div:first-child {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 12px;
  background-color: rgba(240, 240, 240, 0.6);
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 500;
}

.pagination {
  display: inline-flex;
  padding: 0;
  margin: 0;
  gap: 8px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 8px 12px;
}

.pagination .page-item {
  list-style: none;
}

.pagination .page-item .page-link {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #495057;
  background-color: transparent;
  border: 1px solid #eef0f3;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.pagination .page-item .page-link:hover {
  z-index: 2;
  color: #0d6efd;
  background-color: #f0f7ff;
  border-color: #e1efff;
}

.pagination .page-item .page-link:active {
  transform: scale(0.97);
}

.pagination .page-item.active .page-link {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
  box-shadow: 0 3px 8px rgba(13, 110, 253, 0.25);
}

.pagination .page-item.active .page-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.5);
}

.pagination .page-item.disabled .page-link {
  color: #ced4da;
  pointer-events: none;
  background-color: #f8f9fa;
  border-color: #eef0f3;
}

/* Pagination Styling for Bootstrap structure */
.d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin: 30px 0 40px 0;
}

/* Style for the "Showing x to y of z results" text */
.d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between .small.text-muted {
  font-size: 13px;
  color: #6c757d;
  background-color: rgba(240, 240, 240, 0.6);
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 400;
  margin-bottom: 5px;
  text-align: center;
}

/* Pagination container */
.d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between > div:last-child {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Pagination UL */
.d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between .pagination {
  display: inline-flex;
  padding: 0;
  margin: 0;
  gap: 8px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 8px 12px;
}

.d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between .pagination .page-item {
  list-style: none;
}

.d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between .pagination .page-item .page-link {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #495057;
  background-color: transparent;
  border: 1px solid #eef0f3;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between
  .pagination
  .page-item
  .page-link:hover {
  z-index: 2;
  color: #0d6efd;
  background-color: #f0f7ff;
  border-color: #e1efff;
}

.d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between
  .pagination
  .page-item
  .page-link:active {
  transform: scale(0.97);
}

.d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between
  .pagination
  .page-item.active
  .page-link {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
  box-shadow: 0 3px 8px rgba(13, 110, 253, 0.25);
}

.d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between
  .pagination
  .page-item.active
  .page-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.5);
}

.d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between
  .pagination
  .page-item.disabled
  .page-link {
  color: #ced4da;
  pointer-events: none;
  background-color: #f8f9fa;
  border-color: #eef0f3;
}

/* Media queries */
@media (min-width: 576px) {
  .d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between {
    flex-direction: column; /* Keep it as column even on larger screens */
  }
}

@media (max-width: 576px) {
  .d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between .pagination {
    gap: 4px;
    padding: 6px 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .d-none.flex-sm-fill.d-sm-flex.align-items-sm-center.justify-content-sm-between .pagination .page-item .page-link {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .search-tabs .nav-link {
    padding: 10px 15px;
    font-size: 14px;
  }

  .filters-wrapper {
    flex-direction: column;
    gap: 10px;
  }

  .filter-group {
    width: 100%;
  }

  .filter-select {
    padding: 8px 12px;
  }
}

/* Loading Indicator for Favorites */
.btn-favorite .spinner-border {
  width: 1rem;
  height: 1rem;
  color: #dc3545;
}

/* Loading indicators */
.global-loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.9);
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  color: #495057;
}

/* Filter select loading state */
.filter-select[wire\:loading] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23007bff' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z' opacity='.25'/%3E%3Cpath fill='%23007bff' d='M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z'%3E%3CanimateTransform attributeName='transform' dur='0.75s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/animateTransform%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
}

/* Pagination loading state */
.pagination-container[wire\:loading] .page-link {
  opacity: 0.6;
  pointer-events: none;
}

/* Disable pointer events during loading */
[wire\:loading] {
  position: relative;
}

.product-sec[wire\:loading] {
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

/* Product card loading effect */
@keyframes cardShimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

[wire\:loading] .product-card,
[wire\:loading] .prod-container {
  position: relative;
  overflow: hidden;
}

[wire\:loading] .product-card::after,
[wire\:loading] .prod-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: cardShimmer 2s infinite linear;
  background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  z-index: 1;
}

.search-tabs-container {
  position: relative;
}
