/* =============================================
   ALMA SWIMWEARS — Sidebar Product Filters
   Replaces YITH WooCommerce Ajax Product Filter
   ============================================= */

/* ── Shop layout: sidebar + products ── */
.alma-shop-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3rem;
}

/* ── Reset: kill inherited theme/Elementor button styles ── */
.alma-sidebar button,
.alma-shop-layout .alma-sidebar button,
.alma-shop-layout .alma-sidebar .alma-filter-group button,
.alma-shop-layout .alma-sidebar .alma-filter-list button,
body .alma-sidebar button,
body .alma-shop-layout button.alma-filter-option,
body .alma-shop-layout button.alma-size-btn {
  color: #8a8a8a !important;
  background: none !important;
  background-color: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* ── Sidebar ── */
.alma-sidebar {
  position: sticky;
  top: 120px;
  align-self: start;
  padding: 0 0 2rem 0;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: none;
}

.alma-sidebar::-webkit-scrollbar {
  display: none;
}

.alma-sidebar-header {
  display: none;
}

/* ── Mobile toggle ── */
.alma-sidebar-toggle {
  display: none;
}

/* ── Filter group ── */
.alma-filter-group {
  border-bottom: 1px solid #f0f0f0;
  padding: 0 0 16px 0;
  margin: 0 0 16px 0;
}

.alma-filter-group:last-of-type {
  border-bottom: none;
}

/* ── Filter heading (accordion) ── */
.alma-filter-heading,
.alma-sidebar .alma-filter-heading,
.alma-sidebar button.alma-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1c1c1c !important;
  background: none !important;
  border: none;
  padding: 0 0 12px 0;
  cursor: pointer;
  min-height: 32px;
}

.alma-filter-heading svg {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.alma-filter-heading[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}

/* ── Filter list ── */
.alma-filter-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.alma-filter-heading[aria-expanded="false"] + .alma-filter-list {
  display: none;
}

/* ── Filter option ── */
.alma-filter-option,
.alma-sidebar .alma-filter-option,
.alma-sidebar button.alma-filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1c1c1c !important;
  background: none !important;
  border: none;
  padding: 5px 0;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1.4;
}

.alma-filter-option:hover,
.alma-sidebar .alma-filter-option:hover,
body .alma-shop-layout button.alma-filter-option:hover {
  color: #1c1c1c !important;
}

.alma-filter-option.active,
.alma-sidebar .alma-filter-option.active,
body .alma-shop-layout button.alma-filter-option.active,
body .alma-sidebar button.alma-filter-option.active {
  color: #1c1c1c !important;
  font-weight: 500;
}

body .alma-shop-layout button.alma-filter-heading,
body .alma-sidebar button.alma-filter-heading {
  color: #1c1c1c !important;
}

.alma-filter-count {
  font-size: 10px;
  color: #b0b0b0;
  font-weight: 400;
}

/* ── Sizes — inline row ── */
.alma-filter-list--sizes {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.alma-size-btn,
.alma-sidebar .alma-size-btn,
.alma-sidebar button.alma-size-btn {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1c1c1c !important;
  background: none !important;
  border: 1px solid #e0e0e0 !important;
  padding: 6px 10px;
  min-width: 36px;
  text-align: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.alma-size-btn:hover,
.alma-sidebar .alma-size-btn:hover {
  border-color: #1c1c1c !important;
  color: #1c1c1c !important;
}

.alma-size-btn.active,
.alma-sidebar .alma-size-btn.active {
  border-color: #1c1c1c !important;
  color: #1c1c1c !important;
  font-weight: 500;
}

/* ── Colors ── */
.alma-filter-list--colors {
  gap: 2px;
}

.alma-color-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  padding: 4px 0;
}

.alma-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  flex-shrink: 0;
  transition: box-shadow 0.2s ease;
}

.alma-color-btn.active .alma-color-swatch {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px #1c1c1c;
}

/* ── Active bar (chips + reset on one line) ── */
.alma-active-bar {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 0 0 14px 0;
  border-bottom: 1px solid #f0f0f0;
  margin: 0 0 16px 0;
  flex-wrap: nowrap;
}


/* ── Active filters ── */
.alma-active-filters {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.alma-active-filters::-webkit-scrollbar {
  display: none;
}

.alma-active-filters:empty {
  display: none !important;
}

.alma-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1c1c1c !important;
  background: #f0f0f0 !important;
  border: none;
  padding: 4px 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  line-height: 1;
  white-space: nowrap;
}

.alma-chip:hover {
  background: #e0e0e0 !important;
}

/* ── Reset all ── */
.alma-reset-all {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a8a8a !important;
  background: none !important;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.alma-reset-all:hover {
  color: #1c1c1c !important;
}

/* ── Products wrapper ── */
.alma-products-wrapper {
  position: relative;
  min-height: 200px;
  transition: opacity 0.3s ease;
}

.alma-products-wrapper.is-loading {
  opacity: 0.3;
  pointer-events: none;
}

/* ── Loader ── */
.alma-loader {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border: 1px solid #e0e0e0;
  border-top-color: #1c1c1c;
  border-radius: 50%;
  animation: alma-spin 0.6s linear infinite;
  z-index: 10;
}

@keyframes alma-spin {
  to { transform: translateX(-50%) rotate(360deg); }
}

/* ── No results ── */
.alma-no-results {
  text-align: center;
  padding: 4rem 2rem;
}

.alma-no-results p {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #8a8a8a;
}

/* ── Product count ── */
.alma-product-count {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a8a8a;
  padding: 0 0 14px 0;
}

/* ── Load more ── */
.alma-load-more {
  display: block;
  margin: 2.5rem auto 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1c1c1c;
  background: none;
  border: 1px solid #1c1c1c;
  padding: 14px 40px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 44px;
}

.alma-load-more:hover {
  background: #1c1c1c;
  color: #ffffff;
}


/* =============================================
   SHOP PAGE — Product Grid & Cards
   ============================================= */

/* ── Page title ── */
.woocommerce-products-header {
  padding: 0 0 1.5rem 0;
}

.woocommerce-products-header__title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1c1c1c;
  margin: 0;
}

/* ── Product grid ── */
.alma-shop-main ul.products,
.alma-shop-layout ul.products,
.alma-products-wrapper ul.products,
ul.products.columns-3,
ul.products.columns-4 {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 1.5rem 1rem !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Product card ── */
.alma-shop-main ul.products li.product {
  position: relative;
  margin: 0 0 1rem 0;
  padding: 0;
  text-align: left;
  list-style: none;
}

.alma-shop-main ul.products li.product a.woocommerce-LoopProduct-link {
  text-decoration: none;
  color: inherit;
}

/* ── Product image ── */
.alma-shop-main ul.products li.product img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #f0f0f0;
  transition: opacity 0.3s ease;
}

.alma-shop-main ul.products li.product:hover img {
  opacity: 0.92;
}

/* ── Product title ── */
.alma-shop-main ul.products li.product .woocommerce-loop-product__title,
.alma-shop-main ul.products li.product h2 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1c1c1c;
  margin: 10px 0 2px 0;
  padding: 0;
  line-height: 1.4;
}

/* ── Product price ── */
.alma-shop-main ul.products li.product .price {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #1c1c1c;
  margin: 0;
}

.alma-shop-main ul.products li.product .price del {
  color: #b0b0b0;
  font-weight: 400;
  margin-right: 6px;
}

.alma-shop-main ul.products li.product .price ins {
  text-decoration: none;
  color: #b5332e;
  font-weight: 400;
}

/* ── Sale badge ── */
.alma-shop-main ul.products li.product .onsale {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: #1c1c1c;
  color: #ffffff;
  padding: 4px 10px;
  z-index: 2;
  border-radius: 0;
  line-height: 1.4;
  min-height: auto;
  min-width: auto;
  font-weight: 400;
}

/* ── Add to cart / Select options button ── */
.alma-shop-main ul.products li.product .button,
.alma-shop-main ul.products li.product a.add_to_cart_button,
.alma-shop-main ul.products li.product a.product_type_variable {
  display: none;
}

/* ── Star rating ── */
.alma-shop-main ul.products li.product .star-rating {
  display: none;
}

/* ── WooCommerce pagination ── */
.woocommerce-pagination {
  text-align: center;
  padding: 2rem 0;
}

.woocommerce-pagination ul.page-numbers {
  display: flex;
  justify-content: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.woocommerce-pagination ul.page-numbers li a,
.woocommerce-pagination ul.page-numbers li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #8a8a8a;
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.woocommerce-pagination ul.page-numbers li a:hover {
  color: #1c1c1c;
  border-color: #e0e0e0;
}

.woocommerce-pagination ul.page-numbers li span.current {
  color: #1c1c1c;
  border-color: #1c1c1c;
}


/* =============================================
   RESPONSIVE
   ============================================= */

/* ── Large screens (iMac, etc.) — 5 columns + more space ── */
@media (min-width: 1280px) {
  .alma-shop-layout {
    max-width: 1800px;
    gap: 3.5rem;
  }

  .alma-shop-layout .alma-shop-main ul.products,
  .alma-shop-layout .alma-products-wrapper ul.products,
  .alma-shop-layout ul.products.columns-4,
  .alma-shop-layout ul.products.columns-3,
  .alma-shop-main ul.products,
  .alma-shop-layout ul.products,
  .alma-products-wrapper ul.products,
  ul.products.columns-4 {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 2rem 1.25rem !important;
  }
}

@media (max-width: 1000px) {
  .alma-shop-layout {
    grid-template-columns: 190px 1fr;
    gap: 2rem;
    padding: 0 2rem;
  }
}

/* ── Tablet: 3 columns ── */
@media (max-width: 1000px) and (min-width: 769px) {
  .alma-shop-main ul.products,
  .alma-shop-layout ul.products,
  .alma-products-wrapper ul.products,
  ul.products.columns-3,
  ul.products.columns-4 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .alma-shop-layout {
    display: block;
    padding: 0 1.25rem;
  }

  /* Toggle button */
  .alma-sidebar-toggle,
  body .alma-sidebar-toggle,
  body button.alma-sidebar-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    color: #1c1c1c !important;
    background: none !important;
    background-color: transparent !important;
    border: 1px solid #e0e0e0 !important;
    padding: 12px 20px !important;
    cursor: pointer !important;
    margin-bottom: 1.5rem !important;
    min-height: 44px !important;
    transition: border-color 0.3s ease !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .alma-sidebar-toggle:hover,
  body .alma-sidebar-toggle:hover {
    border-color: #1c1c1c !important;
  }

  .alma-sidebar-toggle svg {
    color: #1c1c1c !important;
  }

  /* Mobile: 2 products per row */
  .alma-shop-main ul.products,
  .alma-shop-layout ul.products,
  .alma-products-wrapper ul.products,
  ul.products.columns-3,
  ul.products.columns-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem 0.75rem !important;
  }

  /* Sidebar = slide-in overlay */
  .alma-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    max-height: 100vh;
    background: #ffffff;
    z-index: 200;
    padding: 0 24px 24px 24px;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    box-shadow: none;
  }

  .alma-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
  }

  .alma-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 1;
  }

  .alma-sidebar-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #1c1c1c;
  }

  .alma-sidebar-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #1c1c1c;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Active bar wraps on mobile */
  .alma-active-bar {
    flex-wrap: wrap !important;
  }

  /* Overlay backdrop */
  .alma-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .alma-sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
  }
}
