/* SoldDolls 10.7.12 — finition visuelle mobile du trio Tri / Filtres / Vue.
   UI uniquement : aucun changement de comportement JavaScript. */
@media only screen and (max-width: 900px) {
  html body.woocommerce.archive .sd-archive-toolbar,
  html body.woocommerce.tax-product_cat .sd-archive-toolbar,
  html body.woocommerce.post-type-archive-product .sd-archive-toolbar {
    border-top: 0 !important;
    border-bottom: 0 !important;
    padding: 8px 0 14px !important;
    margin: 0 0 8px !important;
    background: transparent !important;
  }

  html body.woocommerce.archive .sd-archive-actions,
  html body.woocommerce.tax-product_cat .sd-archive-actions,
  html body.woocommerce.post-type-archive-product .sd-archive-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr) 48px !important;
    align-items: center !important;
    gap: 9px !important;
    width: 100% !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body.woocommerce.archive .sd-sort-control,
  html body.woocommerce.tax-product_cat .sd-sort-control,
  html body.woocommerce.post-type-archive-product .sd-sort-control,
  html body.woocommerce.archive .sd-filter-toggle,
  html body.woocommerce.tax-product_cat .sd-filter-toggle,
  html body.woocommerce.post-type-archive-product .sd-filter-toggle {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 38px 0 14px !important;
    overflow: hidden !important;
    background: #111216 !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 2px 8px rgba(0,0,0,.12) !important;
    color: #f7f7f8 !important;
    font-family: var(--sd-font-body, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    text-transform: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  html body.woocommerce.archive .sd-sort-label,
  html body.woocommerce.tax-product_cat .sd-sort-label,
  html body.woocommerce.post-type-archive-product .sd-sort-label {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    color: #f7f7f8 !important;
    font: inherit !important;
    line-height: 1.2 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body.woocommerce.archive .sd-filter-toggle span,
  html body.woocommerce.tax-product_cat .sd-filter-toggle span,
  html body.woocommerce.post-type-archive-product .sd-filter-toggle span {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: #f7f7f8 !important;
    background: transparent !important;
    border: 0 !important;
    font: inherit !important;
    line-height: 1.2 !important;
    text-align: left !important;
    text-indent: 0 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body.woocommerce.archive .sd-filter-toggle span::before,
  html body.woocommerce.tax-product_cat .sd-filter-toggle span::before,
  html body.woocommerce.post-type-archive-product .sd-filter-toggle span::before,
  html body.woocommerce.archive .sd-filter-toggle::before,
  html body.woocommerce.tax-product_cat .sd-filter-toggle::before,
  html body.woocommerce.post-type-archive-product .sd-filter-toggle::before {
    content: none !important;
    display: none !important;
  }

  /* Chevron fin identique sur Tri et Filtres. */
  html body.woocommerce.archive .sd-sort-control::after,
  html body.woocommerce.tax-product_cat .sd-sort-control::after,
  html body.woocommerce.post-type-archive-product .sd-sort-control::after,
  html body.woocommerce.archive .sd-filter-toggle::after,
  html body.woocommerce.tax-product_cat .sd-filter-toggle::after,
  html body.woocommerce.post-type-archive-product .sd-filter-toggle::after {
    content: "" !important;
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    display: block !important;
    width: 7px !important;
    height: 7px !important;
    margin: -5px 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-right: 1.5px solid rgba(255,255,255,.72) !important;
    border-bottom: 1.5px solid rgba(255,255,255,.72) !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    transform: rotate(45deg) !important;
    pointer-events: none !important;
  }

  /* Le select WooCommerce reste exactement le même mécanisme, simplement invisible au-dessus du libellé. */
  html body.woocommerce.archive .sd-sort-control form,
  html body.woocommerce.tax-product_cat .sd-sort-control form,
  html body.woocommerce.post-type-archive-product .sd-sort-control form,
  html body.woocommerce.archive .sd-sort-control .woocommerce-ordering,
  html body.woocommerce.tax-product_cat .sd-sort-control .woocommerce-ordering,
  html body.woocommerce.post-type-archive-product .sd-sort-control .woocommerce-ordering,
  html body.woocommerce.archive .sd-sort-control select,
  html body.woocommerce.tax-product_cat .sd-sort-control select,
  html body.woocommerce.post-type-archive-product .sd-sort-control select {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    border: 0 !important;
    cursor: pointer !important;
  }

  html body.woocommerce.archive .sd-view-toggle,
  html body.woocommerce.tax-product_cat .sd-view-toggle,
  html body.woocommerce.post-type-archive-product .sd-view-toggle {
    order: 3 !important;
    position: relative !important;
    display: block !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #111216 !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 2px 8px rgba(0,0,0,.12) !important;
    color: #f7f7f8 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  /* Icône grille propre : 4 carrés, sans glyphe dépendant de la police. */
  html body.woocommerce.archive .sd-view-toggle::before,
  html body.woocommerce.tax-product_cat .sd-view-toggle::before,
  html body.woocommerce.post-type-archive-product .sd-view-toggle::before {
    content: "" !important;
    position: absolute !important;
    left: 16px !important;
    top: 14px !important;
    display: block !important;
    width: 6px !important;
    height: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #f7f7f8 !important;
    border: 0 !important;
    border-radius: 1.5px !important;
    box-shadow: 10px 0 0 #f7f7f8, 0 10px 0 #f7f7f8, 10px 10px 0 #f7f7f8 !important;
    transform: none !important;
    pointer-events: none !important;
  }

  /* En mode carte, l'icône devient deux lignes : le comportement reste géré par le JS existant. */
  html body.woocommerce.archive .sd-view-toggle.is-card-mode::before,
  html body.woocommerce.tax-product_cat .sd-view-toggle.is-card-mode::before,
  html body.woocommerce.post-type-archive-product .sd-view-toggle.is-card-mode::before {
    left: 14px !important;
    top: 14px !important;
    width: 20px !important;
    height: 7px !important;
    border-radius: 2px !important;
    box-shadow: 0 10px 0 #f7f7f8 !important;
  }

  html body.woocommerce.archive .sd-view-toggle > button[data-sd-view],
  html body.woocommerce.tax-product_cat .sd-view-toggle > button[data-sd-view],
  html body.woocommerce.post-type-archive-product .sd-view-toggle > button[data-sd-view] {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 0 !important;
  }

  html body.woocommerce.archive .sd-view-toggle > button[data-sd-view].is-active,
  html body.woocommerce.tax-product_cat .sd-view-toggle > button[data-sd-view].is-active,
  html body.woocommerce.post-type-archive-product .sd-view-toggle > button[data-sd-view].is-active {
    pointer-events: auto !important;
  }

  html body.woocommerce.archive .sd-view-toggle > button[data-sd-view]::before,
  html body.woocommerce.tax-product_cat .sd-view-toggle > button[data-sd-view]::before,
  html body.woocommerce.post-type-archive-product .sd-view-toggle > button[data-sd-view]::before,
  html body.woocommerce.archive .sd-view-toggle > button[data-sd-view]::after,
  html body.woocommerce.tax-product_cat .sd-view-toggle > button[data-sd-view]::after,
  html body.woocommerce.post-type-archive-product .sd-view-toggle > button[data-sd-view]::after {
    content: none !important;
    display: none !important;
  }

  html body.woocommerce.archive .sd-sort-control:active,
  html body.woocommerce.tax-product_cat .sd-sort-control:active,
  html body.woocommerce.post-type-archive-product .sd-sort-control:active,
  html body.woocommerce.archive .sd-filter-toggle:active,
  html body.woocommerce.tax-product_cat .sd-filter-toggle:active,
  html body.woocommerce.post-type-archive-product .sd-filter-toggle:active,
  html body.woocommerce.archive .sd-view-toggle:active,
  html body.woocommerce.tax-product_cat .sd-view-toggle:active,
  html body.woocommerce.post-type-archive-product .sd-view-toggle:active {
    background: #17181d !important;
    border-color: rgba(255,255,255,.22) !important;
  }

  html body.woocommerce.archive .sd-sort-control:focus-within,
  html body.woocommerce.tax-product_cat .sd-sort-control:focus-within,
  html body.woocommerce.post-type-archive-product .sd-sort-control:focus-within,
  html body.woocommerce.archive .sd-filter-toggle:focus-visible,
  html body.woocommerce.tax-product_cat .sd-filter-toggle:focus-visible,
  html body.woocommerce.post-type-archive-product .sd-filter-toggle:focus-visible,
  html body.woocommerce.archive .sd-view-toggle:focus-visible,
  html body.woocommerce.tax-product_cat .sd-view-toggle:focus-visible,
  html body.woocommerce.post-type-archive-product .sd-view-toggle:focus-visible {
    outline: 2px solid rgba(255,255,255,.68) !important;
    outline-offset: 2px !important;
  }
}

@media only screen and (max-width: 360px) {
  html body.woocommerce.archive .sd-archive-actions,
  html body.woocommerce.tax-product_cat .sd-archive-actions,
  html body.woocommerce.post-type-archive-product .sd-archive-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, .88fr) 44px !important;
    gap: 7px !important;
  }

  html body.woocommerce.archive .sd-view-toggle,
  html body.woocommerce.tax-product_cat .sd-view-toggle,
  html body.woocommerce.post-type-archive-product .sd-view-toggle {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
  }

  html body.woocommerce.archive .sd-view-toggle::before,
  html body.woocommerce.tax-product_cat .sd-view-toggle::before,
  html body.woocommerce.post-type-archive-product .sd-view-toggle::before {
    left: 14px !important;
  }
}
