/* ============================================
   04 SHOP ARCHIVE & SIDEBAR
   ============================================ */

.woocommerce-shop .site-main,
.woocommerce-page.archive .site-main,
.tax-product_cat .site-main,
.tax-product_tag .site-main {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.woocommerce-products-header {
  display: none !important;
}

.mm-shop-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  padding: 28px 0 48px;
  align-items: start;
}

/* SIDEBAR Р¤РР›РўРЄР  */
.mm-shop-sidebar .mm-widget {
  background: #fff;
  border-radius: var(--mm-radius-md);
  padding: 20px;
  margin-bottom: 18px;
  border: 1px solid var(--mm-border);
  box-shadow: var(--mm-shadow-sm);
}

.mm-shop-sidebar .mm-widget h3,
.widget_price_filter .widgettitle,
.widget_layered_nav .widgettitle,
.woocommerce div.widget .widgettitle,
.woocommerce-widget-layered-nav .widget-title {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mm-black);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--mm-accent);
}

/* COLLAPSIBLE SIDEBAR TOGGLE */
.mm-filter-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--mm-accent);
  color: #fff;
  border: none;
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 12px;
  margin-bottom: 20px;
  cursor: pointer;
  box-shadow: var(--mm-shadow-md);
  transition: background 0.3s;
}

.mm-filter-toggle svg { stroke: #fff; }
.mm-filter-toggle:hover { background: var(--mm-black); }

/* Smooth hide/show for filter content */
#mm-shop-sidebar-inner {
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out;
  max-height: 5000px;
  opacity: 1;
  overflow: hidden;
}

#mm-shop-sidebar-inner.is-hidden {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

/* Price Filter Customization */
.widget_price_filter .ui-slider {
  background: #e8e8e8;
  border-radius: 999px;
  height: 5px;
  margin: 8px 6px 22px;
}
.widget_price_filter .ui-slider .ui-slider-range {
  background: var(--mm-accent);
}


/* =====================
   АКОРДЕОН ЗА ФИЛТРИ (Desktop & Mobile)
   ===================== */
.mm-shop-sidebar .mm-widget-title,
.mm-shop-sidebar .widgettitle,
.mm-shop-sidebar .widget-title {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    user-select: none;
}

.mm-shop-sidebar .mm-widget-title::after,
.mm-shop-sidebar .widgettitle::after,
.mm-shop-sidebar .widget-title::after {
    content: "▼";
    font-size: 9px;
    transition: transform 0.3s;
    color: var(--mm-accent);
}

.mm-widget--collapsed .mm-widget-title::after,
.mm-widget--collapsed .widgettitle::after,
.mm-widget--collapsed .widget-title::after {
    transform: rotate(-90deg);
}

.mm-widget-inner {
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s, margin 0.3s, padding 0.3s;
    opacity: 1;
    max-height: 800px;
}

.mm-widget--collapsed .mm-widget-inner {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    border: none;
}

/* =====================
   OFF-CANVAS БУТОН ЗА МОБИЛНО
   ===================== */
.mm-filter-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 20px;
    z-index: 9998;
    background: var(--mm-accent);
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(220, 38, 38, 0.5);
    gap: 8px;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =====================
   OVERLAY
   ===================== */
.mm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9997;
    backdrop-filter: blur(3px);
}
.mm-overlay.mm-open { display: block; }
.mm-locked { overflow: hidden; }

/* =====================
   ЗАТВОРИ БУТОН В SIDEBAR
   ===================== */
.mm-sidebar-close {
    display: none;
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: var(--mm-black);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}
.mm-sidebar-close:hover { background: #333; }

/* =====================
   МОБИЛНО
   ===================== */
@media (max-width: 991px) {
    .mm-shop-layout {
        display: block; /* Remove grid on mobile */
    }
    
    .mm-filter-btn { display: flex; }
    .mm-sidebar-close { display: block; }

    .mm-shop-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -110% !important;
        width: 85vw !important;
        max-width: 320px !important;
        height: 100dvh !important;
        background: #f8f8f8 !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        padding: 24px 20px !important;
        transition: left 0.35s cubic-bezier(0.4,0,0.2,1) !important;
        box-shadow: 6px 0 30px rgba(0,0,0,0.5) !important;
    }

    .mm-shop-sidebar.mm-open {
        left: 0 !important;
    }
}
.mm-shop-products { min-width: 0; }
.wc-block-grid__product { min-width: 0; min-height: 0; }
