/* Barre de tri et présentation des produits de la boutique. */
.src-shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  margin: 0 0 24px;
  padding: 0 0 14px;
  border-bottom: 1px solid #d8d8d8;
}

.src-shop-toolbar .woocommerce-result-count {
  float: none !important;
  margin: 0 !important;
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}

.src-shop-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.src-shop-toolbar .woocommerce-ordering {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  float: none !important;
  margin: 0 !important;
}

.src-shop-sort-label {
  margin: 0;
  color: #777;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  white-space: nowrap;
}

.src-shop-toolbar .woocommerce-ordering select.orderby {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 220px;
  max-width: 100%;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 36px 0 13px !important;
  border: 1px solid #ccc !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #111;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: normal;
  cursor: pointer;
}

.src-shop-toolbar .woocommerce-ordering::after {
  position: absolute;
  right: 15px;
  top: 18px;
  width: 7px;
  height: 7px;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
  transform: rotate(45deg);
  pointer-events: none;
  content: "";
}

.src-shop-toolbar select:focus-visible,
.src-shop-view-button:focus-visible,
.src-shop-results li.product > .button:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

/* Les règles de grille sont limitées à la liste principale, hors produits similaires. */
body:not(.src-shop-list-view) .src-shop-results ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: stretch;
  gap: 24px 18px !important;
  clear: both;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body:not(.src-shop-list-view) .src-shop-results ul.products::before,
body:not(.src-shop-list-view) .src-shop-results ul.products::after {
  display: none !important;
}

body:not(.src-shop-list-view) .src-shop-results ul.products li.product {
  position: relative;
  display: flex !important;
  flex-direction: column;
  float: none !important;
  width: auto !important;
  min-width: 0;
  max-width: none !important;
  margin: 0 !important;
  padding: 14px 14px 18px !important;
  overflow: hidden;
  border: 1px solid #e1e1e1 !important;
  border-radius: 4px !important;
  background: #fff;
  box-shadow: none !important;
  text-align: center !important;
  transition: border-color .2s ease;
}

body:not(.src-shop-list-view) .src-shop-results ul.products li.product:hover {
  border-color: #aaa !important;
}

body:not(.src-shop-list-view) .src-shop-results li.product > a.woocommerce-LoopProduct-link {
  display: flex !important;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  color: #111;
  text-decoration: none;
}

body:not(.src-shop-list-view) .src-shop-results li.product > a.woocommerce-LoopProduct-link > img {
  display: block !important;
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  aspect-ratio: 1 / 1;
  object-fit: contain !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: #fff;
}

body:not(.src-shop-list-view) .src-shop-results .woocommerce-loop-product__title {
  flex: 1;
  margin: 0 0 12px !important;
  padding: 0 !important;
  color: #151515;
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1.45 !important;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-align: center !important;
}

body:not(.src-shop-list-view) .src-shop-results li.product .price {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 42px;
  margin: 0 0 16px !important;
  color: #111;
  font-size: 14px !important;
  font-weight: 750;
  line-height: 1.5;
  text-align: center;
}

body:not(.src-shop-list-view) .src-shop-results li.product .star-rating {
  align-self: center;
  margin: 0 auto 12px;
}

.src-shop-results li.product > .button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px !important;
  border: 1px solid #111 !important;
  border-radius: 0 !important;
  background: #111 !important;
  color: #fff !important;
  font-family: inherit;
  font-size: 12px !important;
  font-weight: 700;
  line-height: 1.4 !important;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}

.src-shop-results li.product > .button:hover {
  background: #fff !important;
  color: #111 !important;
}

body:not(.src-shop-list-view) .src-shop-results li.product > .button {
  align-self: stretch;
  width: 100% !important;
  margin: auto 0 0 !important;
  box-sizing: border-box;
}

body:not(.src-shop-list-view) .src-shop-results li.product > a.added_to_cart {
  margin: 10px 0 0;
  font-size: 12px;
}

/* Boutons grille/liste. */
.src-shop-view-toggle {
  display: inline-flex;
  float: right;
  gap: 0;
  margin: 0 12px 1em 0;
  padding: 0;
  background: #fff;
  border: 1px solid #d5d5d5;
  border-radius: 0;
}

.src-shop-view-button {
  display: inline-flex;
  width: 43px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #777;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.src-shop-view-button:hover,
.src-shop-view-button[aria-pressed="true"] {
  color: #fff;
  background: #111;
}

.src-shop-toolbar .src-shop-view-toggle {
  flex: 0 0 auto;
  float: none;
  margin: 0;
}

.src-shop-view-icon { display: grid; width: 17px; height: 17px; }
.src-shop-view-icon i { display: block; background: currentColor; }
.src-shop-view-icon--grid { grid-template-columns: repeat(2, 1fr); gap: 3px; }
.src-shop-view-icon--list { grid-template-rows: repeat(3, 1fr); gap: 3px; }

/* Ces informations existent toujours, mais ne prennent aucune place en grille. */
.src-loop-list-details { display: none; }

/* Affichage détaillé : une ligne par produit. */
body.src-shop-list-view ul.products {
  display: block !important;
  width: 100% !important;
}

body.src-shop-list-view ul.products::before,
body.src-shop-list-view ul.products::after {
  display: none !important;
}

body.src-shop-list-view ul.products li.product {
  float: none !important;
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr) minmax(140px, 175px) !important;
  grid-template-rows: auto auto 1fr !important;
  column-gap: 24px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 210px !important;
  margin: 0 !important;
  padding: 24px 0 !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid #dedede !important;
  border-radius: 0 !important;
  text-align: left !important;
}

body.src-shop-list-view ul.products li.product > a.woocommerce-LoopProduct-link {
  display: contents !important;
  color: #111 !important;
  text-decoration: none !important;
}

body.src-shop-list-view ul.products li.product > a.woocommerce-LoopProduct-link > img {
  grid-column: 1 !important;
  grid-row: 1 / span 4 !important;
  display: block !important;
  width: 100% !important;
  height: 170px !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain !important;
  background: #fff !important;
  border-radius: 2px !important;
}

body.src-shop-list-view ul.products li.product .woocommerce-loop-product__title {
  grid-column: 2 !important;
  grid-row: 1 !important;
  margin: 2px 0 7px !important;
  padding: 0 !important;
  font-size: 18px !important;
  font-weight: 750 !important;
  line-height: 1.3 !important;
  text-align: left !important;
  overflow-wrap: anywhere;
}

body.src-shop-list-view .src-loop-list-details {
  grid-column: 2 !important;
  grid-row: 2 / span 3 !important;
  display: block !important;
  max-width: 760px;
  margin: 0;
}

.src-loop-list-reference {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin: 0 0 14px;
  color: #777;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.src-loop-list-description {
  margin: 0 0 13px;
  color: #595959;
  font-size: 13px;
  line-height: 1.55;
}

.src-loop-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: #777;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.src-loop-list-more {
  color: #a8242c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.src-loop-list-stock { position: relative; padding-left: 12px; }
.src-loop-list-stock::before {
  position: absolute;
  top: 5px;
  left: 0;
  width: 6px;
  height: 6px;
  background: #268341;
  border-radius: 50%;
  content: "";
}
.src-loop-list-stock.is-out-of-stock::before { background: #a8242c; }

body.src-shop-list-view ul.products li.product .price {
  grid-column: 3 !important;
  grid-row: 1 !important;
  display: block !important;
  margin: 3px 0 0 !important;
  color: #111 !important;
  font-size: 17px !important;
  font-weight: 800 !important;
}

body.src-shop-list-view ul.products li.product .star-rating {
  display: none !important;
}

body.src-shop-list-view ul.products li.product > .button,
body.src-shop-list-view ul.products li.product > a.added_to_cart {
  grid-column: 3 !important;
  grid-row: 2 !important;
  align-self: start !important;
  justify-self: start !important;
  display: inline-flex !important;
  width: auto !important;
  min-height: 42px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 20px 0 0 !important;
  padding: 0 20px !important;
}

@media (max-width: 1150px) {
  .src-shop-sort-label {
    display: none;
  }
}

@media (max-width: 1100px) {
  body:not(.src-shop-list-view) .src-shop-results ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.src-shop-list-view ul.products li.product {
    grid-template-columns: 118px minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto auto !important;
  }

  body.src-shop-list-view ul.products li.product .price {
    grid-column: 2 !important;
    grid-row: 3 !important;
    margin-top: 12px !important;
  }

  body.src-shop-list-view .src-loop-list-details {
    grid-row: 2 !important;
  }

  body.src-shop-list-view ul.products li.product > .button,
  body.src-shop-list-view ul.products li.product > a.added_to_cart {
    grid-column: 2 !important;
    grid-row: 4 !important;
  }
}

@media (max-width: 760px) {
  .src-shop-toolbar {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
  }

  .src-shop-toolbar__actions {
    justify-content: space-between;
    flex: 1 1 100%;
    gap: 10px;
  }

  .src-shop-toolbar .woocommerce-ordering {
    flex: 1;
    min-width: 0;
  }

  .src-shop-toolbar .woocommerce-ordering select.orderby {
    width: 100%;
    min-width: 0;
    font-size: 16px;
  }

  body:not(.src-shop-list-view) .src-shop-results ul.products {
    gap: 14px 10px !important;
  }

  body:not(.src-shop-list-view) .src-shop-results ul.products li.product {
    padding: 10px 10px 12px !important;
  }

  body:not(.src-shop-list-view) .src-shop-results .woocommerce-loop-product__title,
  body:not(.src-shop-list-view) .src-shop-results li.product .price {
    font-size: 13px !important;
  }

  .src-shop-view-toggle {
    float: none;
    margin: 0 0 18px;
  }

  body.src-shop-list-view ul.products li.product {
    grid-template-columns: 118px minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto auto !important;
    column-gap: 18px !important;
    min-height: 0 !important;
    padding: 18px 0 !important;
  }

  body.src-shop-list-view ul.products li.product > a.woocommerce-LoopProduct-link {
    display: contents !important;
  }

  body.src-shop-list-view ul.products li.product > a.woocommerce-LoopProduct-link > img {
    grid-column: 1 !important;
    grid-row: 1 / span 5 !important;
    width: 118px !important;
    height: 118px !important;
    margin: 0 !important;
  }

  body.src-shop-list-view ul.products li.product .woocommerce-loop-product__title {
    grid-column: 2 !important;
    grid-row: 1 !important;
    margin-top: 0 !important;
    font-size: 16px !important;
  }

  body.src-shop-list-view .src-loop-list-details {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  body.src-shop-list-view .src-loop-list-description {
    display: none;
  }

  body.src-shop-list-view ul.products li.product .price {
    grid-column: 2 !important;
    grid-row: 3 !important;
    margin-top: 12px !important;
  }

  body.src-shop-list-view ul.products li.product > .button,
  body.src-shop-list-view ul.products li.product > a.added_to_cart {
    grid-column: 2 !important;
    grid-row: 4 !important;
    min-height: 38px !important;
    margin: 13px 0 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .src-shop-results ul.products li.product {
    transition: none !important;
  }
}
