/* PemCatalogue — ajustements LTR + utilitaires catalogue */

html[dir="ltr"] body {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .ml-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
html[dir="ltr"] .mr-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
html[dir="ltr"] .ml-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }

.pem-logo-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: #2e7d32;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.pem-logo-text:hover {
  color: #1b5e20;
  text-decoration: none;
}

.pem-flash {
  margin: 1rem 0;
}

.pem-price {
  white-space: nowrap;
  font-weight: 600;
}

.pem-price-unit::after {
  content: " Ar";
  font-weight: 500;
  font-size: 0.85em;
  opacity: 0.85;
}

.pem-badge-promo {
  background: #e53935;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

.pem-badge-stock {
  font-size: 0.8rem;
}

.pem-badge-stock.in {
  color: #2e7d32;
}

.pem-badge-stock.out {
  color: #c62828;
}

.pem-product-card .product-thumb img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f8f9fa;
}

.pem-category-card,
.pem-brand-card {
  display: block;
  padding: 1.25rem 1rem;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  text-align: center;
  background: #fff;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.pem-category-card:hover,
.pem-brand-card:hover {
  border-color: #2e7d32;
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.12);
  text-decoration: none;
  color: #2e7d32;
}

.pem-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.pem-filter-sidebar .widget {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.pem-filter-sidebar label {
  font-weight: 500;
  margin-bottom: 0.35rem;
  display: block;
}

.pem-filter-sidebar .form-control,
.pem-filter-sidebar select {
  width: 100%;
  margin-bottom: 0.75rem;
}

/* Catalogue filtres AJAX */
.pem-catalogue-page #catalogueResults.pem-is-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.pem-filtre-form .widget {
  margin-bottom: 1rem;
}

.pem-catalogue-loading {
  font-size: 0.9rem;
  color: #2e7d32;
}

/* Uniformiser hauteur Précédent / numéros / Suivant (le thème force 35x35 sur les a) */
.pem-pagination {
  align-items: center;
  gap: 0.35rem;
}

.pem-pagination .page-item {
  margin-right: 0;
  display: flex;
}

.pem-pagination .page-link,
.pem-pagination li a.page-link,
.pem-pagination li:first-child a.page-link,
.pem-pagination li:last-child a.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 42px;
  height: 42px;
  width: auto;
  padding: 0 1rem;
  line-height: 1;
  border-radius: 4px;
  border: 1px solid #dee2e6;
  background-color: #f3f3f3;
  color: #2e7d32;
  font-size: 14px;
  overflow: visible;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pem-pagination .page-item:not(.active):not(.disabled) .page-link:hover {
  background-color: #59b828;
  border-color: #59b828;
  color: #fff;
}

.pem-pagination .page-item.active .page-link {
  background-color: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

.pem-pagination .page-item.disabled .page-link {
  opacity: 0.55;
  pointer-events: none;
}

.pem-cart-table img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #f8f9fa;
  border-radius: 4px;
}

.pem-cart-summary {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
}

.pem-client-results {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.pem-client-results.show {
  display: block;
}

.pem-client-results li {
  padding: 0.65rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.pem-client-results li:last-child {
  border-bottom: none;
}

.pem-client-results li:hover,
.pem-client-results li.active {
  background: #e8f5e9;
}

.pem-confirm-box {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1rem;
}

.pem-confirm-box .check-icon {
  font-size: 3.5rem;
  color: #2e7d32;
  margin-bottom: 1rem;
}

.pem-detail-image {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
}

.pem-paliers-table th,
.pem-paliers-table td {
  vertical-align: middle;
}

.pem-header-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: #e53935;
  color: #fff;
  border-radius: 999px;
  margin-left: 0.25rem;
}

.pem-mobile-footer a {
  color: inherit;
  text-decoration: none;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.pem-empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: #6c757d;
}

.site-action .pem-cart-link {
  position: relative;
  font-weight: 600;
}

@media (max-width: 767px) {
  .pem-product-card .product-thumb img {
    height: 140px;
  }
}
