/* ===========================================================
   DKT Reseller Portal - Page produit B2B
   =========================================================== */

/* --- Layout général --- */

.product-reseller-wrapper {
  margin-top: 2rem;
}

.product-info-reseller .product-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.product-manufacturer {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--dkt-primary, #3643ba);
  text-decoration: none;
  font-weight: 500;
}

.product-description-short {
  margin-bottom: 1.5rem;
  color: #555;
  line-height: 1.5;
}

.reseller-matrix-wrapper {
  margin: 1.5rem 0;
}


/* --- Sélecteur couleur --- */

.reseller-color-selector {
  border: none;
  padding: 0;
  margin-bottom: 1rem;
}

.reseller-color-selector__legend {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.reseller-color-selector__name {
  font-weight: 400;
  color: #666;
  margin-left: 0.25rem;
}

.reseller-color-selector__swatches {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.reseller-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  border: 2px solid #ddd;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.reseller-color-swatch:hover {
  transform: scale(1.05);
  border-color: #999;
}

.reseller-color-swatch.active {
  border-color: #3643ba;
  box-shadow: 0 0 0 1px white, 0 0 0 3px #3643ba;
}


/* --- Loading --- */

.reseller-matrix-loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.reseller-matrix-loading p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}


/* --- Tableau matrice --- */

.reseller-matrix-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.reseller-matrix-table thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #999;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 0.5rem 0.75rem;
  border: none;
  text-align: left;
  background: transparent;
}

/* Colonne prix alignée à droite (cohérent avec les valeurs de prix dans le tbody) */
.reseller-matrix-table thead th.col-price {
  text-align: right;
}

.reseller-matrix-table tbody tr {
  background-color: #fff;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s ease;
}

.reseller-matrix-table tbody tr:hover {
  background-color: #fafafa;
}

.reseller-matrix-table tbody td {
  padding: 0.2rem 0.75rem;
  vertical-align: middle;
  border: none;
}

/* Colonnes - largeurs */
.reseller-matrix-table .col-size {
  width: 12%;
  font-size: 0.95rem;
  font-weight: 600;
}

.reseller-matrix-table .col-ref {
  width: 22%;
  color: #666;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85rem;
}

.reseller-matrix-table .col-qty {
  width: 36%;
}

.reseller-matrix-table .col-price {
  width: 30%;
  text-align: right;
  white-space: nowrap;
}

.reseller-matrix-table .col-price .price-amount {
  font-weight: 600;
  font-size: 0.95rem;
  color: #111;
}

.reseller-matrix-table .col-price .price-tax {
  color: #999;
  font-size: 0.75rem;
  margin-left: 0.25rem;
  font-weight: 400;
}

/* Ligne masquée (filtrage par couleur) */
.matrix-row.hidden {
  display: none;
}


/* --- Stepper quantité +/- --- */

.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  height: 32px;
  width: auto;
  min-width: 110px;
  max-width: 200px;
}

.qty-btn {
  background: #fff;
  border: none;
  cursor: pointer;
  width: 28px;
  flex-shrink: 0;
  height: 100%;
  font-size: 1rem;
  line-height: 1;
  color: #555;
  transition: background-color 0.15s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.qty-btn:hover {
  background: #f5f5f5;
  color: #111;
}

.qty-btn:active {
  background: #ebebeb;
}

.qty-btn-minus {
  border-right: 1px solid #eee;
}

.qty-btn-plus {
  border-left: 1px solid #eee;
}

.qty-stepper__input {
  width: auto;
  min-width: 50px;
  flex: 1;
  border: none;
  text-align: center;
  font-size: 0.9rem;
  background: transparent;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
  font-weight: 500;
  color: #111;
  height: 100%;
  padding: 0 0.25rem;
}

.qty-stepper__input::-webkit-outer-spin-button,
.qty-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


/* --- Badge Rupture --- */

.badge-rupture {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background-color: #f5f5f5;
  color: #999;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
}


/* --- Ligne Total --- */

.reseller-matrix-total {
  background-color: #fafafa !important;
  border-top: 1px solid #e5e5e5 !important;
}

.reseller-matrix-total td {
  padding: 0.75rem !important;
  font-size: 0.9rem;
}

/* "Total" compact à gauche */
.reseller-matrix-total td:first-child {
  width: 1%;
  white-space: nowrap;
  padding-right: 0.25rem !important;
  font-weight: 700;
}

/* "X articles" collé au libellé Total */
.reseller-matrix-total td:nth-child(2) {
  text-align: left;
  padding-left: 0.25rem !important;
  color: #666;
  font-weight: 400;
}

/* Cellule vide (alignement) */
.reseller-matrix-total td:nth-child(3) {
  width: auto;
}

/* Total prix : aligné à droite, format identique aux lignes */
.reseller-matrix-total td:last-child {
  text-align: right;
  white-space: nowrap;
}

.reseller-matrix-total .js-matrix-total-price {
  color: #3643ba;
  font-size: 1rem;
  font-weight: 700;
}

.reseller-matrix-total td:last-child small {
  display: inline !important;
  font-size: 0.75rem;
  color: #999;
  font-weight: 400;
  margin-left: 0.25rem;
}


/* --- Bouton CTA "Ajouter au panier" --- */

.reseller-matrix-actions {
  margin-top: 1.5rem;
}

.js-add-all-to-cart {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #3643ba;
  border-color: #3643ba;
  border-radius: 4px;
}

.js-add-all-to-cart:disabled {
  background-color: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
}

.js-add-all-to-cart:not(:disabled):hover {
  background-color: #2a35a0;
  border-color: #2a35a0;
}


/* --- Feedback succès / erreur --- */

.reseller-matrix-feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.reseller-matrix-feedback.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.reseller-matrix-feedback.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}


/* --- Responsive mobile --- */

@media (max-width: 768px) {
  .reseller-matrix-table {
    font-size: 0.8rem;
  }
  .reseller-matrix-table tbody td {
    padding: 0.5rem 0.4rem;
  }
  .reseller-matrix-table .col-ref {
    font-size: 0.75rem;
  }
  .qty-stepper {
    height: 28px;
    min-width: 90px;
  }
  .qty-btn {
    width: 24px;
  }
  .qty-stepper__input {
    min-width: 36px;
  }
}

/* === Bouton panier toujours visible et cliquable, peu importe l'état === */

/* Force la couleur active du bouton panier dans tous les cas */
#_desktop_ps_shoppingcart .header-block__action-btn,
#_desktop_ps_shoppingcart .header-block__action-btn:link,
#_desktop_ps_shoppingcart .header-block__action-btn:visited {
  color: #3643ba !important;
  opacity: 1 !important;
  text-decoration: none;
  cursor: pointer;
}

#_desktop_ps_shoppingcart .header-block__icon {
  color: #3643ba !important;
}

#_desktop_ps_shoppingcart .header-block__title {
  color: #111 !important;
}

#_desktop_ps_shoppingcart .header-block__badge {
  color: #111 !important;
}

#_desktop_ps_shoppingcart .header-block__action-btn:hover,
#_desktop_ps_shoppingcart .header-block__action-btn:hover .header-block__icon {
  opacity: 0.7 !important;
}

/* Override de l'état "inactive" héritée de Hummingbird */
#_desktop_ps_shoppingcart .cart-preview.inactive,
#_desktop_ps_shoppingcart .blockcart.inactive,
#_desktop_ps_shoppingcart .header-block.inactive {
  opacity: 1;
  pointer-events: auto;
}

#_desktop_ps_shoppingcart .cart-preview.inactive .header-block__icon,
#_desktop_ps_shoppingcart .blockcart.inactive .header-block__icon {
  color: #3643ba !important;
}

/* === DKT Reseller Portal - Card produit épurée === */

/* Le HT à côté du prix sur les cards */
.product-miniature__price-tax {
  font-size: 0.7rem;
  color: #999;
  font-weight: 400;
  margin-left: 0.25rem;
}

/* Le bouton "Voir le produit" en pleine largeur */
.product-miniature__details.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* Image cliquable : pas de soulignement disgracieux */
.product-miniature__image-link {
  display: block;
  text-decoration: none;
}