/**
 * Pros Facet UI — MOBILE (presentation).
 * Skroutz-like bottom-sheet: 90vh, rounded top corners, soft overlay, flat facet rows, elegant caret chevrons.
 * Only applied when body has .pros-mode-mobile.
 */
body.pros-mode-mobile .pros-sidebar {
  display: none !important;
}

/* Κρύψιμο Ταξινόμησης/Προβολής από κύρια οθόνη στο mobile — πηγαίνουν μέσα στο drawer */
body.pros-mode-mobile .pros-toolbar {
  display: none !important;
}

/* Κουμπί Φίλτρα: σταθερό στο κέντρο, λίγο πιο κάτω, χωρίς κίνηση */
body.pros-mode-mobile .pros-filter-trigger {
  position: fixed;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  bottom: calc(var(--pros-bottom-nav) + 6px);
  z-index: 200;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: #111111de;
  color: #fff;
  font-weight: 300;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  transition: box-shadow .15s ease;
}
body.pros-mode-mobile .pros-filter-trigger:hover,
body.pros-mode-mobile .pros-filter-trigger:active {
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
}
body.pros-mode-mobile .pros-filter-trigger__icon {
  font-size: 16px;
  line-height: 1;
}

/* =========================
   MOBILE DRAWER — Bottom sheet (Skroutz-like)
   90vh, anchored bottom, rounded top corners 20–24px, soft overlay + blur
   ========================= */
body.pros-mode-mobile .pros-drawer--mobile {
  position: fixed;
  inset: 0;
  z-index: 999999 !important;
  pointer-events: none;
  opacity: 0;
  transition: opacity .22s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
}
body.pros-mode-mobile .pros-drawer--mobile.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Overlay: soft dark + light blur (Skroutz-like) */
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Panel: bottom sheet, 90vh, rounded top only, shadow */
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__panel {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 90vh;
  max-height: 90vh;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,.12), 0 0 1px rgba(0,0,0,.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* Swipe handle: above Φίλτρα — user can swipe down to close */
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__handle {
  flex-shrink: 0;
  padding: 10px 0 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__handle::before {
  content: '';
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,.14);
}
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__handle:active {
  cursor: grabbing;
}

/* Sticky header: title centered; swipe area extends here */
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px 14px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  min-height: 44px;
  box-sizing: border-box;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__header:active {
  cursor: grabbing;
}
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__title {
  flex: 1;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  margin: 0;
}
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__close {
  display: none !important;
}

/* Body: scrollable, padding so content doesn’t hide under footer */
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 16px;
  -webkit-overflow-scrolling: touch;
}

/* Footer: fixed at bottom so it never scrolls with the drawer content */
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(0,0,0,.08);
  background: #fff;
  z-index: 2;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__footer .pros-apply {
  width: 100%;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 800;
  border-radius: 14px;
  background: var(--pros-btn-bg);
  color: #fff;
  border: 0;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
  transition: transform .15s ease, box-shadow .15s ease;
}
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__footer .pros-apply:active {
  transform: scale(0.98);
  box-shadow: 0 1px 6px rgba(0,0,0,.15);
}

/* =========================
   FLAT UI — All facet blocks + Ταξινόμηση: same flat row style, separators (no pill cards)
   ========================= */
/* Mobile toolbar: Ταξινόμηση, Προβολή, Επαναφορά — flat rows with separators */
body.pros-mode-mobile .pros-drawer__mobile-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0 0 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-facet-block {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-facet-block:last-child {
  border-bottom: none;
}
body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-facet-block__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px 0;
  padding: 14px 32px 0 0;
  position: relative;
}
/* Caret on toolbar blocks (Προβολή etc.); Ταξινόμηση has no chevron — removed below */
body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-facet-block__title::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
  opacity: .6;
  box-sizing: border-box;
  pointer-events: none;
}
/* Ταξινόμηση: no chevron on title row; keep chevrons only for collapsible facet blocks */
body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-facet-block:first-child .pros-facet-block__title::after {
  display: none !important;
}

/* Hide “×” / show-more / show-less inside facet rows in mobile drawer only */
body.pros-mode-mobile .pros-drawer--mobile .pros-facet-block .facetwp-toggle,
body.pros-mode-mobile .pros-drawer--mobile .pros-facet-block .facetwp-show-more,
body.pros-mode-mobile .pros-drawer--mobile .pros-facet-block .facetwp-show-less,
body.pros-mode-mobile .pros-drawer--mobile .pros-facet-block [class*="facetwp-toggle"],
body.pros-mode-mobile .pros-drawer--mobile .pros-facet-block [class*="show-more"],
body.pros-mode-mobile .pros-drawer--mobile .pros-facet-block [class*="show-less"] {
  display: none !important;
}

/* Empty state message (JS toggles visibility) */
body.pros-mode-mobile .pros-facet-block .pros-facet-empty {
  padding: 8px 0;
  color: #666;
  font-size: 14px;
}

/* Facets mount: same flat row style */
body.pros-mode-mobile .pros-drawer__facets-mount .pros-facet-block {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
body.pros-mode-mobile .pros-drawer__facets-mount .pros-facet-block:last-child {
  border-bottom: none;
}

/* =========================
   ACCORDION — Elegant caret (stroke V), same icon closed/open, rotate only
   Closed: points down (0deg), Open: points up (180deg). Thin, symmetrical.
   ========================= */
body.pros-mode-mobile .pros-drawer__facets-mount .pros-facet-block .pros-facet-block__title[data-pros-accordion-toggle] {
  cursor: pointer;
  user-select: none;
  padding: 14px 32px 14px 0;
  position: relative;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
/* Elegant stroke caret (V): two borders, not filled triangle */
body.pros-mode-mobile .pros-drawer__facets-mount .pros-facet-block .pros-facet-block__title[data-pros-accordion-toggle]::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
  transition: transform .22s ease;
  opacity: .65;
  box-sizing: border-box;
}
/* Closed: caret points down (45deg = down V) */
body.pros-mode-mobile .pros-drawer__facets-mount .pros-facet-block .pros-facet-block__title[data-pros-accordion-toggle]::after {
  transform: translateY(-50%) rotate(45deg);
}
/* Open: caret points up (45deg + 180deg) */
body.pros-mode-mobile .pros-drawer__facets-mount .pros-facet-block--open .pros-facet-block__title[data-pros-accordion-toggle]::after {
  transform: translateY(-50%) rotate(225deg);
}
body.pros-mode-mobile .pros-drawer__facets-mount .pros-facet-block .pros-facet-block__collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
}
body.pros-mode-mobile .pros-drawer__facets-mount .pros-facet-block--open .pros-facet-block__collapse {
  max-height: 85vh;
}
body.pros-mode-mobile .pros-drawer__facets-mount .pros-facet-block--open .pros-facet-list {
  max-height: 55vh !important;
}
body.pros-mode-mobile .pros-drawer__facets-mount .pros-facet-block .pros-facet-block__search {
  margin-bottom: 10px;
}

/* Μικρότερο κενό μεταξύ toolbar και πρώτου φίλτρου */
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__facets-mount {
  margin-top: 0;
  padding-top: 0;
}
body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__facets-mount > .pros-facet-block:first-child {
  margin-top: 0;
}

@media (max-width: 768px) {
  body.pros-mode-mobile .pros-results__list .facetwp-template ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-drawer-toolbar__per-page {
    display: none !important;
  }
  body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-drawer-toolbar__reset {
    display: none !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 0 6px !important;
    box-shadow: none !important;
    justify-content: center;
    align-items: center;
  }
  body.pros-mode-mobile.pros-has-active-facet .pros-drawer__mobile-toolbar .pros-drawer-toolbar__reset {
    display: flex !important;
  }
  /* Επαναφορά: λεπτό outline κουμπί (όχι χοντρό μαύρο block) */
  body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-drawer-toolbar__reset .facetwp-facet-reset .facetwp-reset,
  body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-drawer-toolbar__reset .facetwp-facet-reset button,
  body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-drawer-toolbar__reset .facetwp-facet-reset a {
    width: auto;
    min-height: 36px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: transparent !important;
    color: #333;
    border: 1.5px solid rgba(0,0,0,.2);
    border-radius: 10px;
    box-shadow: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
  }
  body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-drawer-toolbar__reset .facetwp-facet-reset .facetwp-reset:hover,
  body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-drawer-toolbar__reset .facetwp-facet-reset button:hover,
  body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-drawer-toolbar__reset .facetwp-facet-reset a:hover {
    background: rgba(0,0,0,.06) !important;
    border-color: rgba(0,0,0,.3);
    transform: none;
    box-shadow: none;
  }
  body.pros-mode-mobile .pros-drawer__mobile-toolbar .pros-facet-block__title {
    margin-bottom: 6px;
  }
  body.pros-mode-mobile .pros-filter-trigger {
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--pros-bottom-nav) + 4px) !important;
  }
  /* Keep bottom sheet 90vh on small screens; full height only on very short viewports for usability */
  body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__panel {
    height: 90vh;
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
  }
}

/* Very small viewports: allow full height so content remains usable */
@media (max-width: 768px) and (max-height: 480px) {
  body.pros-mode-mobile .pros-drawer--mobile .pros-drawer__panel {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}
