/* Products Page Styles */
html {
  scroll-behavior: smooth;
}
:root {
  --primary-color-rgb: 0, 123, 255; /* RGB value of #007BFF */
}

.products-page {
  padding: 120px 0 60px;
  background: #f8f9fa;
  min-height: 100vh;
}

/* Page Header */
.products-header {
  margin-bottom: 2rem;
}

.products-header h1 {
  font-size: 2.5rem;
  color: #333;
  margin-bottom: 2rem;
  font-weight: 600;
}

/* Search Container */
.search-container {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: white;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-bar {
  flex: 1;
  position: relative;
}

/* Search Autocomplete Dropdown */
.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 5px;
  display: none;
}

.search-autocomplete.active {
  display: block;
}

.autocomplete-item {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: #f8f9fa;
}

.autocomplete-item .product-name {
  font-weight: 500;
  color: #333;
  margin-bottom: 3px;
}

.autocomplete-item .product-category {
  font-size: 0.85rem;
  color: #666;
}

.autocomplete-item .highlight {
  background-color: rgba(0, 123, 255, 0.1);
  color: var(--primary-color);
  font-weight: 600;
}

.no-autocomplete-results {
  padding: 15px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}

.search-bar input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.sort-options select {
  min-width: 180px;
  padding: 0.875rem 2.5rem 0.875rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #333;
  background: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  transition: all 0.2s ease;
}

.sort-options select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Products Layout */
.products-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Filters Sidebar */
.filters-sidebar {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.filters-header h2 {
  font-size: 1.25rem;
  color: #333;
  font-weight: 600;
}

.filter-toggle-icon-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-chevron {
  display: none;
  font-size: 1rem;
  color: #333;
  transition: transform 0.3s ease;
}

.desktop-reset-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: none;
  background: none;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.desktop-reset-filters:hover {
  background: #f5f5f5;
  color: var(--primary-color);
}

.mobile-reset-filters {
  display: none;
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
}

.mobile-reset-filters:hover {
  background-color: var(--primary-dark);
}

.collapsible-filter-content {
  padding-top: 1.5rem;
}

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

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group h3 {
  font-size: 1rem;
  color: #333;
  margin-bottom: 1rem;
  font-weight: 600;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Custom Radio and Checkbox Styles */
.filter-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.filter-option:hover {
  background: #f8f9fa;
}

.radio-custom,
.checkbox-custom {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.checkbox-custom {
  border-radius: 4px;
}

.filter-option input {
  display: none;
}

.filter-option input:checked + .radio-custom {
  border-color: var(--primary-color);
  background: var(--primary-color);
}

.filter-option input:checked + .radio-custom::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.filter-option input:checked + .checkbox-custom {
  border-color: var(--primary-color);
  background: var(--primary-color);
}

.filter-option input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  top: 45%;
  left: 50%;
  transform: translate(-75%, -50%) rotate(45deg);
}

.label-text {
  color: #555;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.filter-option:hover .label-text {
  color: var(--primary-color);
}

/* Price Range Styles */
.price-range {
  margin-top: 1rem;
}

.price-range-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #666;
}

.price-slider-container {
  position: relative;
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  margin: 1.5rem 0;
}

.slider-progress {
  position: absolute;
  height: 100%;
  background: var(--primary-color);
  border-radius: 3px;
  left: 0%;
  right: 0%;
  z-index: 1;
}

.min-price-tooltip,
.max-price-tooltip {
  position: absolute;
  top: -30px;
  background: var(--primary-color);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  transform: translateX(-50%);
  z-index: 2;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.min-price-tooltip:after,
.max-price-tooltip:after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--primary-color) transparent transparent transparent;
}

.price-slider:hover ~ .min-price-tooltip,
.price-slider:hover ~ .max-price-tooltip,
.price-slider:active ~ .min-price-tooltip,
.price-slider:active ~ .max-price-tooltip {
  opacity: 1;
}

.price-slider {
  position: absolute;
  width: 100%;
  height: 6px;
  background: transparent;
  outline: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  top: 0;
  margin: 0;
  z-index: 2;
}

.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--primary-color);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.price-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--primary-color);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.price-slider:active::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 0 5px rgba(0, 123, 255, 0.2);
}

.price-slider:active::-moz-range-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 0 5px rgba(0, 123, 255, 0.2);
}

.range-inputs {
  margin-bottom: 1rem;
}

.price-input-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.price-input {
  flex: 1;
  position: relative;
}

.price-input input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.price-input input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.price-input span {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 0.85rem;
  pointer-events: none;
}

.price-request-container {
  display: flex;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
}

.price-request-label {
  font-size: 0.9rem;
  color: #555;
  margin-right: 0.5rem;
  cursor: pointer;
  flex: 1;
}

#includeRequestPrice {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* Products Content */
.products-content {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  width: 100%;
}

/* Active Filters */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  align-items: center;
  justify-content: space-between;
}

.product-count-container {
  margin-left: auto;
  font-size: 0.9rem;
  color: #666;
  background: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#productCount {
  font-weight: 600;
  color: var(--primary-color);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f0f4f8;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #333;
  transition: all 0.2s ease;
}

.filter-tag:hover {
  background: #e2e8f0;
}

.filter-tag button {
  border: none;
  background: none;
  color: #666;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
}

.filter-tag button:hover {
  color: #dc3545;
}

.product-card-link {
  text-decoration: none !important;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

@media (min-width: 769px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* Product Card Styles */
.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  border: none;
  position: relative;
  height: 100%;
}

.product-card.new-product::after {
  content: 'Nouveau';
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary-color);
  color: white;
  padding: 0.3rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  letter-spacing: 0.5px;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.3);
}

.product-card.featured-product::after {
  content: 'Vedette';
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #ff9800;
  color: white;
  padding: 0.3rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  letter-spacing: 0.5px;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.product-card.highlight-card {
  box-shadow: 0 0 0 3px var(--primary-color), 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-5px);
  animation: pulse 1s ease-in-out;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

.product-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(0, 0, 0, 0.02)
  );
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.product-image {
  position: relative;
  padding-top: 70%;
  background: #f9fafb;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.product-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0) 60%,
    rgba(0, 0, 0, 0.03) 100%
  );
  pointer-events: none;
}

.product-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  position: relative;
  z-index: 2;
}

.product-category {
  font-size: 0.7rem;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  opacity: 0.9;
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background-color: rgba(var(--primary-color-rgb, 0, 123, 255), 0.08);
  border-radius: 4px;
  margin-bottom: 0.25rem;
}

.product-info h4 {
  font-size: 1.1rem;
  color: #1a202c;
  font-weight: 600;
  margin: 0.25rem 0 0.5rem 0;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.product-card:hover .product-info h4 {
  color: var(--primary-color);
}

.product-info p {
  color: #7f8c8d;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0 0 0.75rem 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-name {
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.06);
  align-self: stretch;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
}

.product-price span.currency {
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
  margin-left: 0.25rem;
}

.product-price span.htva {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  margin-left: 0.5rem;
  background-color: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

/* No Results Message */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
  font-size: 1.1rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #e0e0e0;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn:not(:disabled):hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.page-numbers {
  font-size: 0.95rem;
  color: #666;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .products-layout {
    grid-template-columns: 250px 1fr;
  }
}

@media (max-width: 768px) {
  .products-page {
    padding: 90px 0 30px;
  }

  .search-container {
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .sort-options {
    width: 100%;
  }

  .sort-options select {
    width: 100%;
  }

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

  .filters-sidebar {
    margin-bottom: 1.5rem;
    padding: 1rem;
  }

  .filters-header {
    cursor: pointer;
    margin-bottom: 0;
    padding-bottom: 1rem;
  }

  .filter-chevron {
    display: inline-block;
  }

  .filters-sidebar.filters-collapsed .filter-chevron {
    transform: rotate(-90deg);
  }

  .desktop-reset-filters {
    display: none;
  }

  .collapsible-filter-content {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    transition: max-height 0.35s ease-out, padding-top 0.35s ease-out;
  }

  .filters-sidebar.filters-expanded .collapsible-filter-content {
    max-height: 1500px;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    margin-top: 1rem;
  }

  .filters-sidebar.filters-expanded .mobile-reset-filters {
    display: block;
  }

  .filters-header h2 {
    font-size: 1.15rem;
  }

  .filter-group {
    margin-bottom: 1.25rem;
  }

  .filter-group h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }

  .product-info {
    padding: 1rem;
    gap: 0.5rem;
  }

  .product-info h4 {
    font-size: 1rem;
  }

  .product-info p {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .product-price {
    font-size: 1.15rem;
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  .products-page {
    padding: 80px 0 20px;
  }

  .products-header h1 {
    font-size: 1.7rem;
  }

  .price-input-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .price-input input {
    width: 100%;
  }

  .min-price-tooltip,
  .max-price-tooltip {
    top: -25px;
    font-size: 0.75rem;
    padding: 2px 6px;
  }

  .filter-group h3 {
    font-size: 0.9rem;
  }

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

@media (min-width: 769px) and (max-width: 1023px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* Add a media query for desktop to ensure it's hidden if any other style accidentally shows it */
@media (min-width: 769px) {
  .filter-chevron {
    display: none !important;
  }
  .filters-header {
    cursor: default !important;
  }
  .collapsible-filter-content {
    max-height: none !important;
    overflow: visible !important;
    padding-top: 1.5rem !important;
    border-top: none !important;
    margin-top: 0 !important;
  }
  .filters-sidebar.filters-collapsed .collapsible-filter-content,
  .filters-sidebar.filters-expanded .collapsible-filter-content {
    max-height: none !important;
    overflow: visible !important;
  }
  .mobile-reset-filters {
    display: none !important;
  }
  .desktop-reset-filters {
    display: flex !important;
  }
}
.footer-downloads {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-downloads h4 {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-downloads a {
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}

.footer-downloads a:hover {
  color: var(--primary-color);
}

/* Category Dropdown (compact filter) */
.category-dropdown {
  position: relative;
}

.category-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.category-dropdown-toggle:focus,
.category-dropdown-toggle:hover {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  background: #fafbff;
}

.category-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  z-index: 10;
  overflow: hidden;
}

.category-dropdown-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
}

.category-dropdown-search:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(0, 123, 255, 0.08);
}

.category-dropdown-list {
  max-height: 260px;
  overflow: auto;
  padding: 0.35rem;
}

.category-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-size: 0.94rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.category-item:hover,
.category-item:focus {
  background: #f5f7fb;
  color: var(--primary-color);
  outline: none;
}

.category-item[aria-current="true"] {
  background: rgba(0, 123, 255, 0.08);
  color: var(--primary-color);
  font-weight: 600;
}

/* Panel entrance animation */
.category-dropdown-panel[style*="block"] {
  animation: dropdownIn 120ms ease-out;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Ensure the dropdown looks good on small screens */
@media (max-width: 768px) {
  .category-dropdown-panel {
    position: static;
    margin-top: 0.5rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  }
}

/* Product Detail Page */
#product-detail-page .product-detail-container {
  padding: 130px 0 50px;
}

.product-detail-breadcrumb {
  margin-bottom: 1rem;
}

.back-to-products {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.product-detail {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  padding: 1.5rem;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.75rem;
  align-items: start;
}

.product-detail-image {
  background: #f9fafb;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 1rem;
}

.product-detail-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 560px;
}

.product-detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.product-detail-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.product-detail-category {
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(0,123,255,0.08);
}

.product-detail-ref {
  font-size: 0.8rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.product-detail-title {
  font-size: 1.75rem;
  line-height: 1.3;
  margin: 0.15rem 0 0.45rem 0;
}

.product-detail-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 0.35rem;
}

.product-detail-description {
  color: #475569;
  line-height: 1.7;
  white-space: pre-wrap;
  margin: 0.35rem 0 0 0;
}

/* Buy Now button */
.product-detail-actions {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.btn-buy-now {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-color);
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 18px rgba(0,123,255,0.2);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-buy-now:hover {
  background: rgba(0,123,255,0.95);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0,123,255,0.25);
}

@media (max-width: 992px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
  }
  .product-detail-image img { max-height: 420px; }
}

/* Discount badge on product card (refined) */
.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary-color);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.25);
  z-index: 3;
  letter-spacing: 0.3px;
}

/* Inline discount label on detail page */
.discount-inline {
  display: inline-block;
  margin-left: 0.5rem;
  background: rgba(0, 123, 255, 0.12);
  color: var(--primary-color);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

/* Old/New price styles */
.old-price {
  color: #94a3b8;
  text-decoration: line-through;
  margin-right: 0.5rem;
  font-weight: 600;
}

.new-price {
  color: var(--primary-color);
  font-weight: 800;
}
