.inaris-quick-order-container {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: #0A472E;
}

.qo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#inaris_qo_search {
  flex: 1;
  max-width: 280px;
  padding: 8px 12px;
  border: 1px solid #645C45;
  border-radius: 4px;
  font-size: 14px;
}

#inaris_qo_cart_total {
  padding: 8px 12px;
  background: #8C9A44;
  color: #fff;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 12px;
  font-size: 14px;
}

.quick-order-table {
  width: 100%;
}

.quick-order-row {
  display: grid;
  grid-template-columns:
    80px   /* image */
    100px  /* référence */
    1fr    /* produit */
    80px   /* prix */
    80px   /* qté */
    100px  /* total */
    160px; /* action */
  grid-gap: 12px;
  align-items: center;
  justify-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #E0E0E0;
}

.quick-order-row.header {
  background: #0A472E;
  color: #fff;
  font-weight: 600;
  border-bottom: 2px solid #8C9A44;
  text-transform: uppercase;
  align-items: center;
  justify-items: center;
}

.qo-image {
  position: relative;
  overflow: visible;
}

.qo-image img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  cursor: zoom-in;
}

.qo-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  height: 300px;
  background-image: var(--zoom-url);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: none;
  pointer-events: none;
  z-index: 9999;
  border: 1px solid #000; /* bordure noire */
}


.qo-image:hover::after {
  display: block;
}


.qo-ref,
.qo-name,
.qo-price {
  cursor: pointer;
}

.qo-price {
  font-weight: bold;
}

.qo-qty input {
  width: 80px;
  padding: 6px;
  border: 1px solid #645C45;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
}

.qo-total {
  font-size: 14px;
  font-weight: 600;
}

.qo-add button {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  background: #8C9A44;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
}

.qo-add button:hover {
  background: #707d36;
}

.empty {
  visibility: hidden;
}

.qo-pagination {
  text-align: center;
  margin-top: 12px;
}

.qo-pagination a {
  margin: 0 4px;
  padding: 6px 10px;
  border: 1px solid #8C9A44;
  border-radius: 4px;
  color: #0A472E;
  font-size: 14px;
  text-decoration: none;
}

.qo-pagination a.active,
.qo-pagination a:hover {
  background: #8C9A44;
  color: #fff;
}

/* Mobile compact */
@media (max-width: 600px) {
  .quick-order-row {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(7, auto);
    grid-template-areas:
      "qo-image"
      "qo-ref"
      "qo-name"
      "qo-price"
      "qo-qty"
      "qo-total"
      "qo-add";
    row-gap: 8px;
  }
  .qo-image { grid-area: qo-image; }
  .qo-ref   { grid-area: qo-ref; }
  .qo-name  { grid-area: qo-name; }
  .qo-price { grid-area: qo-price; }
  .qo-qty   { grid-area: qo-qty; }
  .qo-total { grid-area: qo-total; }
  .qo-add   { grid-area: qo-add; }
}
/* Masquer le tableau en portrait mobile et afficher le warning */
.qo-mobile-warning {
  display: none;
  text-align: center;
  padding: 16px;
  background: #FDECEA;
  border: 1px solid #F5C6CB;
  border-radius: 4px;
  color: #721C24;
  font-size: 14px;
  margin-bottom: 12px;
}

@media only screen and (max-width: 768px) and (orientation: portrait) {
  /* On cache l’input et le total aussi */
  .inaris-quick-order-container .qo-header,
  .inaris-quick-order-container .quick-order-table {
    display: none;
  }
  .inaris-quick-order-container .qo-mobile-warning {
    display: block;
  }
}
/* header layout */
.qo-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.qo-search-filter {
  display: flex;
  flex: 1;
  gap: 12px;
}
#inaris_qo_search,
.qo-cat-filter {
  flex: 1;
}

/* filtre catégories */
.qo-cat-filter {
  position: relative;
}
.qo-cat-filter input {
  width: 100%;
  padding-left: 100px;
}
.qo-cat-tags {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  pointer-events: none;
  z-index: 2;
}
.qo-cat-tag {
  background: #8C9A44;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* suggestions */
.qo-cat-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}
.qo-cat-filter input:focus ~ .qo-cat-suggestions {
  display: block;
}
.qo-cat-suggestion {
  padding: 6px;
  cursor: pointer;
  font-size: 14px;
}
.qo-cat-suggestion:hover {
  background: #f0f0f0;
}
