/* Products Page Styles */

/* Categories Section */
.product-categories {
  padding: var(--space-lg) 0;
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
}

.category-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--space-lg);
}

.category-tab {
  padding: 12px 25px;
  background-color: var(--light-gray);
  color: var(--dark-gray);
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-medium);
  border: none;
  font-family: var(--body-font);
  box-shadow: var(--shadow-sm);
}

.category-tab:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
}

.category-tab.active {
  background-color: var(--primary-red);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

/* Product Filters */
.product-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background-color: var(--light-gray);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  font-weight: 500;
  color: var(--primary-black);
}

.filter-select {
  padding: 8px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--white);
  color: var(--dark-gray);
  font-family: var(--body-font);
  transition: all var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--primary-red);
  outline: none;
  box-shadow: 0 0 0 2px rgba(243, 0, 0, 0.1);
}

.filter-btn {
  background-color: var(--primary-red);
  color: var(--white);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition-medium);
}

.filter-btn:hover {
  background: var(--red-gradient);
  transform: translateY(-2px);
}

/* Product Controls */
.product-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.product-search {
  display: flex;
  position: relative;
  flex: 1;
  max-width: 400px;
}

.product-search input {
  width: 100%;
  padding: 12px 20px;
  padding-right: 45px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--body-font);
  transition: all var(--transition-fast);
}

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

.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;
}

.search-btn:hover {
  color: var(--primary-red);
  background: none;
  transform: translateY(-50%);
  box-shadow: none;
}

.product-sort {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-sort label {
  font-weight: 500;
  color: var(--primary-black);
}

.product-sort select {
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--white);
  color: var(--dark-gray);
  font-family: var(--body-font);
  transition: all var(--transition-fast);
}

.product-sort select:focus {
  border-color: var(--primary-red);
  outline: none;
  box-shadow: 0 0 0 2px rgba(243, 0, 0, 0.1);
}

/* Featured Products Section */
.featured-products {
  padding: var(--space-xxl) 0;
  background-color: var(--white);
}

.featured-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-lg);
}

.featured-product {
  background-color: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-medium);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  min-height: 400px;
}

.featured-product:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.product-image-wrapper {
  height: 250px;
  background-color: #f0f0f0; /* Fallback color */
  position: relative;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background-color: #f8f8f8;
}

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

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-medium);
}

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

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  background-color: var(--primary-red);
  color: white;
  z-index: 5;
}

.product-details {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-name {
  font-size: 1.4rem;
  margin-bottom: var(--space-sm);
  color: var(--primary-black);
  font-family: var(--heading-font);
}

.product-specs {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.product-specs span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: var(--light-gray);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  color: var(--dark-gray);
}

.product-specs i {
  color: var(--primary-red);
}

.product-description {
  color: var(--dark-gray);
  margin-bottom: var(--space-md);
  font-size: 0.95rem;
  line-height: 1.5;
  flex-grow: 1;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary-red);
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-top: auto;
}

.product-link:hover {
  gap: 8px;
  color: var(--primary-black);
}

/* Products Grid */
.products-grid {
  padding: var(--space-xxl) 0;
  background-color: var(--light-gray);
}

.alt-bg {
  background-color: var(--white);
}

.products-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

/* Product Card Styles */
.product-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 450px;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.product-card-header {
  position: relative;
  height: 250px;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.product-thumbnail {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  margin: auto;
  display: block;
}

.product-quick-view {
  position: absolute;
  bottom: -50px;
  left: 0;
  width: 100%;
  text-align: center;
  transition: all var(--transition-medium);
  padding: 10px;
  background: rgba(0, 0, 0, 0.7);
}

.product-card:hover .product-quick-view {
  bottom: 0;
}

.quick-view-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--white);
  font-size: 0.8rem;
  padding: 6px 15px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-view-btn:hover {
  background: var(--primary-red);
  border-color: var(--primary-red);
  transform: translateY(0);
}

.product-card-body {
  padding: var(--space-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-card-title {
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
  color: var(--primary-black);
  font-family: var(--heading-font);
}

.product-card-specs {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.product-card-specs .spec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  background-color: var(--light-gray);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: var(--dark-gray);
}

.product-card-specs i {
  color: var(--primary-red);
}

.product-card-desc {
  color: var(--dark-gray);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
  line-height: 1.5;
  flex-grow: 1;
}

.product-card-footer {
  padding: var(--space-md);
  background-color: var(--light-gray);
  display: flex;
  justify-content: center;
}

.product-card-footer .btn {
  width: 100%;
  text-align: center;
  font-weight: 500;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0.5rem 1rem;
  border: 2px solid #e0e0e0;
  background-color: #fff;
  color: #333;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
  background-color: #f8f8f8;
  border-color: #d32f2f;
  color: #d32f2f;
}

.pagination-btn.active {
  background-color: #d32f2f;
  border-color: #d32f2f;
  color: #fff;
}

.pagination-btn.prev,
.pagination-btn.next {
  background-color: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}

.pagination-btn.prev:hover:not(:disabled),
.pagination-btn.next:hover:not(:disabled) {
  background-color: #d32f2f;
  border-color: #d32f2f;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f0f0f0;
  border-color: #e0e0e0;
  color: #999;
}

/* Chargers Grid */
.chargers-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.charger-card {
  border: 1px solid var(--border-color);
}

.view-all-btn {
  margin-top: var(--space-lg);
}

/* Custom Solutions Section */
.custom-solutions {
  padding: var(--space-xxl) 0;
  background-color: var(--light-gray);
}

.solutions-tabs {
  margin-top: var(--space-lg);
}

.tabs-navigation {
  display: flex;
  overflow-x: auto;
  gap: 2px;
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2px;
}

.tab-btn {
  padding: 12px 25px;
  background: transparent;
  color: var(--dark-gray);
  border: none;
  cursor: pointer;
  font-weight: 600;
  position: relative;
  white-space: nowrap;
  transition: all var(--transition-medium);
}

.tab-btn:hover {
  color: var(--white);
  background-color: var(--primary-red);
}

.tab-btn::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: transparent;
  transition: background-color var(--transition-fast);
}

.tab-btn.active {
  color: var(--white);
  background-color: var(--primary-red);
}

.tab-btn.active::after {
  background-color: transparent;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

.solution-content-grid {
  display: grid;
  grid-template-columns: 45% 55%;
  gap: var(--space-lg);
  align-items: center;
}

.solution-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.solution-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-medium);
}

.solution-image:hover img {
  transform: scale(1.03);
}

.solution-details h3 {
  margin-bottom: var(--space-md);
  font-size: 1.8rem;
  color: var(--primary-black);
  position: relative;
  padding-bottom: var(--space-sm);
}

.solution-details h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary-red);
}

.solution-details p {
  margin-bottom: var(--space-md);
  color: var(--dark-gray);
  line-height: 1.6;
}

.solution-features {
  list-style: none;
  margin-bottom: var(--space-lg);
}

.solution-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 15px;
  color: var(--dark-gray);
}

.solution-features i {
  color: var(--primary-red);
  font-size: 1rem;
  margin-top: 3px;
}

/* Product Inquiry Section */
.product-inquiry {
  background: var(--primary-black);
  color: var(--white);
  position: relative;
  overflow: hidden;
  padding: var(--space-xl) 0;
}

.product-inquiry::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../../images/pattern-bg.svg") repeat;
  opacity: 0.05;
  z-index: 1;
}

.inquiry-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.inquiry-content h2 {
  margin-bottom: var(--space-md);
  font-size: 2rem;
  color: var(--white);
}

.inquiry-content p {
  margin-bottom: var(--space-lg);
  font-size: 1.1rem;
  color: #ccc;
}

/* Quick View Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
  margin: auto;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.5rem;
  color: var(--dark-gray);
  cursor: pointer;
  transition: color var(--transition-fast);
  z-index: 10;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--light-gray);
}

.modal-close:hover {
  color: var(--primary-red);
}

.modal-body {
  padding: var(--space-lg);
}

.product-quick-view-content {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: var(--space-lg);
}

.product-quick-view-image {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.product-quick-view-image img {
  width: 100%;
  height: auto;
  display: block;
}

.product-quick-view-details h3 {
  margin-bottom: var(--space-md);
  font-size: 1.8rem;
  color: var(--primary-black);
}

.product-quick-view-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
}

.specs-group {
  flex: 1;
  min-width: 250px;
}

.specs-group .spec {
  margin-bottom: 10px;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
}

.specs-group .spec strong {
  color: var(--primary-black);
  margin-bottom: 3px;
}

.product-quick-view-actions {
  margin-top: var(--space-lg);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive Styles */
@media (max-width: 991px) {
  .featured-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .solution-content-grid {
    grid-template-columns: 1fr;
  }

  .product-quick-view-content {
    grid-template-columns: 1fr;
  }

  .product-quick-view-image {
    margin-bottom: var(--space-md);
  }
}

@media (max-width: 767px) {
  .category-tab {
    padding: 10px 15px;
    font-size: 0.9rem;
  }

  .product-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-select {
    width: 100%;
  }

  .product-controls {
    flex-direction: column;
  }

  .product-search {
    max-width: 100%;
  }

  .products-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .tab-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .featured-product {
    max-width: 100%;
  }

  .products-container {
    grid-template-columns: 1fr;
  }

  .product-card-specs {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .product-name {
    font-size: 1.2rem;
  }

  .product-quick-view-details h3 {
    font-size: 1.4rem;
  }
}

/* Product Card Model Number */
.product-card-model {
  font-size: 0.85rem;
  color: var(--secondary-color);
  margin-bottom: 8px;
  font-style: italic;
}

/* New Product Badge */
.new-badge {
  background-color: #28a745;
  color: white;
}

/* No Products Message */
.no-products-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-lg);
  background-color: var(--light-gray);
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--dark-gray);
  margin: var(--space-md) 0;
}

/* Fix for battery product grid */
#battery-products {
  min-height: 400px;
}

/* Loading message */
.loading-message {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  min-height: 200px !important;
  color: #555 !important;
  font-size: 1.1rem !important;
  text-align: center !important;
  background-color: rgba(240, 240, 240, 0.5) !important;
  border-radius: 8px !important;
  padding: 20px !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05) !important;
}

.loading-message::before {
  content: "" !important;
  display: inline-block !important;
  width: 20px !important;
  height: 20px !important;
  margin-right: 10px !important;
  border: 2px solid #ddd !important;
  border-top: 2px solid #00539c !important;
  border-radius: 50% !important;
  animation: spin 1s linear infinite !important;
}

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

/* No products message */
.no-products-message {
  display: block;
  width: 100%;
  min-height: 100px;
  color: #666;
  font-size: 1.1rem;
  text-align: center;
  padding: 30px;
  background-color: #f8f8f8;
  border-radius: 8px;
  margin: 20px 0;
}

/* Emergency fix styles update */
.product-card {
  display: flex !important;
  flex-direction: column !important;
  min-height: 450px !important;
}

.product-card-header {
  height: 250px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  background-color: #f8f8f8 !important;
}

.product-thumbnail {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: auto !important;
}
