/**
 * DES Product Accessories - Front-office styles
 * Compatible with PrestaShop 8.1.x and 9.0.x
 * Compatible with STSiteBuilder themes
 */

/* =========================================================
   Wrapper
   ========================================================= */
.desproductaccesories-wrapper {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background-color: #fafafa;
}

.desproductaccesories-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.desproductaccesories-subtitle {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0 16px;
}

/* =========================================================
   Accessory list
   ========================================================= */
.desproductaccesories-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.desproductaccesories-item {
  display: block;
}

/* =========================================================
   Label (click area)
   ========================================================= */
.desproductaccesories-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  background-color: #fff;
  transition:
    border-color 0.2s,
    background-color 0.2s;
  width: 100%;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

.desproductaccesories-label:hover {
  border-color: #ccc;
  background-color: #f5f5f5;
}

/* Highlight label when checkbox is checked */
.desproductaccesories-checkbox:checked ~ .desproductaccesories-label,
.desproductaccesories-checkbox:checked + label,
.desproductaccesories-item:has(.desproductaccesories-checkbox:checked)
  .desproductaccesories-label {
  border-color: #333;
  background-color: #f0f0f0;
}

/* =========================================================
   Custom checkbox
   ========================================================= */
.desproductaccesories-checkbox-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.desproductaccesories-checkbox {
  /* Hide native checkbox but keep it accessible */
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.desproductaccesories-checkmark {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid #aaa;
  border-radius: 3px;
  background-color: #fff;
  transition:
    background-color 0.15s,
    border-color 0.15s;
  position: relative;
}

.desproductaccesories-checkbox:checked + .desproductaccesories-checkmark {
  background-color: #333;
  border-color: #333;
}

/* Checkmark tick */
.desproductaccesories-checkbox:checked
  + .desproductaccesories-checkmark::after {
  content: "";
  display: block;
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* =========================================================
   Product image
   ========================================================= */
.desproductaccesories-img-wrapper {
  flex-shrink: 0;
}

.desproductaccesories-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #e5e5e5;
  display: block;
}

/* =========================================================
   Product info (name + price)
   Price is always anchored to the right so all cards are uniform.
   ========================================================= */
.desproductaccesories-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  gap: 10px;
}

.desproductaccesories-name {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  text-decoration: none;
  /* Allow wrapping so long names don't hide the price */
  white-space: normal;
  line-height: 1.35;
}

.desproductaccesories-name:hover {
  text-decoration: underline;
  color: #000;
}

.desproductaccesories-price {
  flex-shrink: 0;
  font-size: 0.9rem;
  color: #333;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

/* Out-of-stock products are filtered server-side and never rendered. */

/* =========================================================
   Responsive tweaks
   ========================================================= */
@media (max-width: 480px) {
  .desproductaccesories-wrapper {
    padding: 14px;
  }

  .desproductaccesories-img {
    width: 40px;
    height: 40px;
  }

  .desproductaccesories-name {
    font-size: 0.85rem;
  }
}
