/* POEMI — Mobile filter pills + bottom sheets (IKEA-style)
   Active only <=767px. Desktop/sidebar untouched. */

/* Hidden by default so desktop is never affected. */
.poemi-fp { display: none; }

@media (max-width: 767px) {

  /* Hide the original sidebar; its widgets are surfaced via pills */
  .content-container .primary-sidebar { display: none !important; }

  .poemi-fp {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 25px;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 0;
  }

  /* Full-bleed + divider once the bar sticks to the top on scroll */
  .poemi-fp.is-stuck {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: 10px;
    padding-right: 10px;
    background: #fff;
    border-bottom: 1px solid #ccc;
  }
  .poemi-fp::-webkit-scrollbar { display: none; }

  .poemi-fp__pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #423431;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid #423431;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .poemi-fp__pill:active { background: #2f2422; }
  .poemi-fp__pill.is-active {
    background: #2b211f;
    border-color: #2b211f;
  }
  .poemi-fp__pill::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -3px;
    opacity: .7;
  }
}

/* Sheet + backdrop: kept out of media query so JS state is consistent,
   but they are only ever opened by the pills which are mobile-only. */
.poemi-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 99998;
}
.poemi-backdrop.is-open { opacity: 1; visibility: visible; }

.poemi-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
  transform: translateY(101%);
  transition: transform .28s cubic-bezier(.22, .61, .36, 1);
  z-index: 99999;
}
.poemi-sheet.is-open { transform: translateY(0); }

.poemi-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #ececec;
}
.poemi-sheet__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #2b211f;
}
.poemi-sheet__close {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  padding: 0 4px;
  color: #2b211f;
  cursor: pointer;
}

.poemi-sheet__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 18px 18px;
}
/* Widget header is redundant inside the sheet (sheet has its own title) */
.poemi-sheet__body .widget-title { display: none; }
.poemi-sheet__body .widget { margin: 0 !important; padding: 0 !important; border: 0 !important; }
.poemi-sheet__body ul.product-categories,
.poemi-sheet__body .menu { list-style: none; margin: 0; padding: 0; }
.poemi-sheet__body ul.product-categories li,
.poemi-sheet__body .menu li { padding: 2px 0; }
.poemi-sheet__body ul.product-categories a,
.poemi-sheet__body .menu a {
  display: block;
  padding: 7px 4px 11px 0;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid #f1efed;
}
.poemi-sheet__body .woocommerce.widget_product_categories > ul li a {
  line-height: 1.4em !important;
}

.poemi-sheet__foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #ececec;
}
.poemi-sheet__apply {
  appearance: none;
  border: 0;
  background: #2b211f;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 15px;
  border-radius: 999px;
  cursor: pointer;
}
.poemi-sheet__reset {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6b6b6b;
  font-size: 14px;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
}

.poemi-noscroll { overflow: hidden !important; }

/* Logat: coboara bara sticky sub admin bar-ul WP (46px pe mobil). top are efect doar cand .poemi-fp e position:sticky (<=767px). */
body.admin-bar .poemi-fp { top: 46px; }
