/* TRE P | Catalogo Atelier mobile filter (touch-first). No changes to desktop. */
@media (max-width: 900px) {
  html.trep-mobile-filter-open, html.trep-mobile-filter-open body {overflow: hidden !important;}
  .trep-catalog-shell .trep-catalog-sidebar {
    position: relative !important; display: block !important;
    width: 100% !important; height: auto !important;
    min-width: 0 !important; min-height: 0 !important;
    max-height: none !important; overflow: visible !important;
    margin: 0 0 20px !important; padding: 0 !important;
    top: auto !important; left: auto !important;
  }
  .trep-catalog-shell .trep-catalog-sidebar .trep-filtro-wrap {width: 100% !important; height: auto !important; margin: 0 !important; padding: 0 !important;}
  /* A static filter toolbar replaces the old floating bottom button. */
  .trep-catalog-shell .trep-catalog-sidebar button.trep-filtro-apri {
    position: relative !important; inset: auto !important;
    top: auto !important; right: auto !important; left: auto !important; bottom: auto !important;
    display: flex !important; align-items: center !important;
    justify-content: space-between !important; width: 100% !important;
    max-width: none !important; min-width: 0 !important;
    transform: none !important; border: 1px solid #4b4947 !important;
    border-radius: 2px !important; background: #262626 !important;
    color: #f6f4f1 !important; -webkit-text-fill-color: #f6f4f1 !important;
    box-shadow: none !important; padding: 14px 16px !important;
    margin: 0 !important; z-index: 5 !important;
    font: 600 12px/1.3 Arial,Helvetica,sans-serif !important;
    text-transform: uppercase !important; letter-spacing: .15em !important;
    cursor: pointer !important; gap: 10px !important;
  }
  .trep-catalog-shell .trep-catalog-sidebar button.trep-filtro-apri::before {
    content: '' !important; display: inline-block !important; flex: 0 0 18px !important;
    width: 18px !important; height: 14px !important; opacity: 1 !important;
    border: 0 !important; border-top: 2px solid #e0dcd7 !important;
    border-bottom: 2px solid #e0dcd7 !important; margin: 0 !important;
    background: linear-gradient(#e0dcd7, #e0dcd7) center/100% 2px no-repeat !important;
  }
  .trep-catalog-shell .trep-mobile-trigger-label {flex: 1; text-align: left;}
  .trep-catalog-shell .trep-mobile-trigger-count {
    flex: 0 0 auto; color: #fff; background: #c8102e;
    font: 700 11px/1 Arial,sans-serif; padding: 6px 8px; min-width: 23px;
    text-align: center; border-radius: 2px; -webkit-text-fill-color: #fff;
  }
  /* The drawer occupies the full phone, not a narrow sliding sidebar. */
  .trep-catalog-shell .trep-catalog-sidebar aside.trep-filtro {
    position: fixed !important; inset: 0 !important;
    top: 0 !important; bottom: 0 !important;
    left: 0 !important; right: 0 !important;
    width: 100vw !important; max-width: 100vw !important;
    height: 100dvh !important; max-height: 100dvh !important;
    display: block !important; z-index: 99999 !important;
    background: #1c1c1c !important; color: #f7f5f2 !important;
    border: 0 !important; border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 20px calc(104px + env(safe-area-inset-bottom)) !important;
    overflow: auto !important; overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
    transform: translateX(103%) !important;
    visibility: hidden !important;
    transition: transform .25s cubic-bezier(.2,.7,.2,1), visibility .25s !important;
  }
  .trep-catalog-shell .trep-catalog-sidebar aside.trep-filtro.is-aperto {
    transform: translateX(0) !important; visibility: visible !important;
  }
  /* Modal chrome */
  .trep-catalog-shell .trep-mobile-filter-header {
    position: sticky; top: 0; margin: 0 -20px 19px !important;
    padding: calc(20px + env(safe-area-inset-top)) 20px 15px;
    background: #1c1c1c; z-index: 20; border-bottom: 1px solid #45423f;
    display: flex; gap: 16px; align-items: center; justify-content: space-between;
  }
  .trep-catalog-shell .trep-mobile-filter-header__eyebrow {
    display: block; color: #db3650; font: 700 10px/1.5 Arial,sans-serif;
    text-transform: uppercase; letter-spacing: .18em; margin-bottom: 5px;
  }
  .trep-catalog-shell .trep-mobile-filter-header__title {
    color: #f9f6f0 !important; font: 400 clamp(25px,6vw,34px)/1.12 Georgia,serif !important;
    letter-spacing: -.02em; margin: 0 !important;
  }
  .trep-catalog-shell button.trep-mobile-filter-close {
    flex: 0 0 42px; display: flex; justify-content: center; align-items: center;
    width: 42px; height: 42px; padding: 0; border: 1px solid #5b5752;
    border-radius: 50%; background: transparent; color: #f7f4f0;
    font: 300 27px/1 Arial,sans-serif; cursor: pointer;
  }
  .trep-catalog-shell .trep-filtro__testa {
    display: block !important; border: 0 !important; padding: 0 !important;
    margin: 0 0 10px !important; min-height: 0 !important;
  }
  .trep-catalog-shell .trep-filtro__testa::before {content: none !important;}
  .trep-catalog-shell .trep-filtro__testa p {color: #b8b3ae !important; font: 400 13px/1.4 Arial,sans-serif !important;}
  .trep-catalog-shell .trep-filtro__testa .trep-filtro-chiudi {display: none !important;}
  .trep-catalog-shell .trep-mobile-filter-search {display: block; margin: 0 0 20px;}
  .trep-catalog-shell .trep-mobile-filter-search label {
    display: block; font: 700 10px/1.5 Arial,sans-serif; letter-spacing: .13em;
    text-transform: uppercase; color: #bbb5af; margin: 0 0 8px;
  }
  .trep-catalog-shell input.trep-mobile-filter-search__input {
    box-sizing: border-box; width: 100% !important; height: 46px !important;
    display: block !important; border: 1px solid #59544e !important;
    background: #292929 !important; border-radius: 2px !important;
    color: #f6f3ee !important; -webkit-text-fill-color: #f6f3ee !important;
    font: 400 14px/1.4 Arial,sans-serif !important;
    padding: 12px 14px !important; outline-offset: 3px;
  }
  .trep-catalog-shell input.trep-mobile-filter-search__input::placeholder {color: #a9a39c !important; -webkit-text-fill-color: #a9a39c !important;}
  .trep-catalog-shell .trep-mobile-filter-sort {display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 18px;}
  .trep-catalog-shell .trep-mobile-filter-sort label {font: 700 11px/1.4 Arial,sans-serif; color: #ddd8d2; letter-spacing: .12em; text-transform: uppercase;}
  .trep-catalog-shell .trep-mobile-filter-sort select {font: 400 13px/1.2 Arial,sans-serif !important; color: #fff !important; border: 1px solid #5b5650 !important; background: #2b2b2b !important; padding: 9px 12px !important; max-width: 65%;}
  .trep-catalog-shell .trep-filtro__sez {margin: 0 !important; border-bottom: 1px solid #41403e !important; padding: 0 !important;}
  .trep-catalog-shell .trep-filtro__sez > summary {
    display: flex !important; align-items: center !important; justify-content: space-between !important;
    width: 100% !important; min-height: 56px !important; cursor: pointer !important;
    color: #f3f0ec !important; font: 700 12px/1.4 Arial,sans-serif !important;
    letter-spacing: .13em !important; text-transform: uppercase !important;
    border: 0 !important; padding: 17px 1px !important; margin: 0 !important;
  }
  .trep-catalog-shell .trep-filtro__sez > summary::after {border-color: #f2ede7 !important;}
  .trep-catalog-shell .trep-filtro__sez > ul {margin: 0 0 15px !important;}
  .trep-catalog-shell .trep-filter-department__row {min-height: 42px !important;}
  .trep-catalog-shell .trep-filter-choice__name {font-size: 13px !important;}
  .trep-catalog-shell .trep-filtro__voci a {font-size: 13px !important; padding: 11px 0 !important;}
  .trep-catalog-shell .trep-filtro__scelti {margin: 8px 0 19px !important;}
  .trep-catalog-shell [data-trep-mobile-search-hide="1"] {display: none !important;}
  .trep-catalog-shell .trep-mobile-filter-empty {font: 400 13px/1.5 Arial,sans-serif; color: #b9b3ac; padding: 12px 0 22px;}
  /* Only the primary action/clear remain in the sticky bottom bar */
  .trep-catalog-shell .trep-mobile-filter-actions {
    position: fixed !important; left: 0 !important; right: 0 !important;
    bottom: 0 !important; z-index: 25 !important;
    padding: 12px 20px calc(13px + env(safe-area-inset-bottom)) !important;
    display: flex !important; flex-direction: row !important;
    gap: 10px !important; align-items: stretch !important;
    background: #202020 !important; border-top: 1px solid #494541 !important;
    margin: 0 !important;
  }
  .trep-catalog-shell .trep-mobile-filter-actions a.trep-mobile-filter-reset {
    display: flex !important; width: 35% !important; flex: 0 0 35% !important;
    align-items: center; justify-content: center;
    background: transparent !important; border: 1px solid #67605a !important;
    padding: 13px 10px !important; color: #f1ede8 !important;
    font: 700 11px/1.3 Arial,sans-serif !important;
    letter-spacing: .07em !important; text-transform: uppercase !important;
    text-decoration: none !important; border-radius: 2px !important;
  }
  .trep-catalog-shell .trep-mobile-filter-actions a.trep-mobile-filter-reset[aria-disabled="true"] {opacity: .45; pointer-events: none;}
  .trep-catalog-shell .trep-mobile-filter-actions button.trep-mobile-filter-apply {
    flex: 1 !important; width: auto !important; display: block !important;
    position: static !important; inset: auto !important;
    margin: 0 !important; padding: 14px 9px !important;
    color: white !important; background: #c8102e !important;
    border: 1px solid #c8102e !important; border-radius: 2px !important;
    text-transform: uppercase !important;
    font: 700 12px/1.3 Arial,sans-serif !important; letter-spacing: .03em !important;
    cursor: pointer !important;
  }
  /* Supersede the legacy in-drawer sticky button, without removing its JS functionality. */
  .trep-catalog-shell aside.trep-filtro > .trep-catalog-apply {display: none !important;}
  .trep-catalog-shell .trep-catalog-main {min-width: 0 !important;}
  .trep-catalog-shell .trep-catalog-toolbar {margin-top: 0 !important;}
  /* Avoid oversized empty spacing after cards */
  .trep-catalog-shell {padding-bottom: 42px !important;}
  .trep-catalog-shell .trep-card-cta {color:#f5f2ed!important; -webkit-text-fill-color:#f5f2ed!important; opacity:1!important}
  .trep-catalog-shell .trep-card-cta__arrow {font-size:0!important;line-height:0!important;overflow:hidden!important}
}
@media (max-width: 600px) {
  .trep-catalog-shell {padding-top: 17px !important;}
  .trep-catalog-shell .trep-catalog-main ul.products,
  .trep-catalog-shell .trep-catalog-main ul.products.elementor-grid {grid-template-columns: repeat(2,minmax(0,1fr))!important;}
}
@media (max-width: 380px) {
  .trep-catalog-shell .trep-catalog-main ul.products,
  .trep-catalog-shell .trep-catalog-main ul.products.elementor-grid {grid-template-columns: 1fr!important;}
}
@media (prefers-reduced-motion: reduce) {
  .trep-catalog-shell .trep-catalog-sidebar aside.trep-filtro {transition:none!important;}
}
