/* Additional styles for product cards and quick view */

/* Critical fix to ensure product cards are visible */
.products-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 20px !important;
  margin-bottom: 30px !important;
}

.product-card {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10 !important;
  position: relative !important;
  background-color: white !important;
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  padding: 15px !important;
  margin-bottom: 20px !important;
  min-height: 320px !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.product-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

.product-card-header,
.product-thumbnail,
.product-card-body,
.product-card-footer {
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
}

.product-card-header {
  height: 180px !important;
  position: relative !important;
  overflow: hidden !important;
  margin-bottom: 15px !important;
  background-color: #f8f8f8 !important;
  border-radius: 6px !important;
}

.product-thumbnail {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background-color: #f8f8f8 !important;
}

/* Feature badges for Smart variants */
.feature-badge {
  background-color: #3498db;
  color: white;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

/* New badge is already styled, positioning multiple badges */
.product-card-header .product-badge:nth-child(3) {
  top: 35px;
}

/* Specs group styling */
.specs-group-title {
  color: #2c3e50;
  font-size: 16px;
  margin-top: 15px;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

/* Quick view modal improvements */
.product-quick-view-specs {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 15px;
}

/* Improved spec styling */
.spec {
  margin-bottom: 6px;
  font-size: 14px;
}

.spec strong {
  color: #34495e;
}

/* Loading message fix */
.loading-message {
  display: block !important;
  grid-column: 1 / -1 !important;
}

/* When products are loaded, hide the loading message */
.products-container:not(:empty) .loading-message {
  display: none !important;
}

/* Improved search input styling */
.product-search {
  position: relative;
  display: flex;
  flex: 1;
  max-width: 400px;
}

.product-search input[type="search"] {
  width: 100%;
  padding: 12px 45px 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--body-font);
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.product-search input[type="search"]:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 2px rgba(243, 0, 0, 0.1);
}

.product-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  width: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E") no-repeat center center;
  cursor: pointer;
  margin-right: 5px;
}

.search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--dark-gray);
  font-size: 1rem;
  cursor: pointer;
  padding: 5px 10px;
  transition: color var(--transition-fast);
}

.search-btn:hover {
  color: var(--primary-red);
}

/* Highlight search matches - adds a subtle highlight to matched items */
.product-card.search-match .product-card-title,
.product-card.search-match .product-card-model {
  position: relative;
}

/* Enhanced no results message */
.no-products-message {
  grid-column: 1 / -1;
  background-color: #f8f8f8;
  padding: 20px;
  text-align: center;
  border-radius: 8px;
  margin: 30px 0;
  color: #555;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  animation: fadeIn 0.4s ease-out;
}

.no-products-message::before {
  content: "\f071";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-right: 10px;
  color: #d32f2f;
}

/* Loading indicator style for search */
.products-container.searching {
  position: relative;
  min-height: 200px;
}

.products-container.searching::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
