/* ============================================
   SHOP PAGE LAYOUT
   Inspired by Vibratex just-theme.com/shop/
   ============================================ */

.hds-shop-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ============================================
   PRODUCT GRID
   ============================================ */

.hds-shop-products {
  flex: 1 1 auto;
  min-width: 0;
}

.hds-shop-products .woocommerce-result-count,
.hds-shop-products .woocommerce-ordering {
  margin-bottom: 20px;
}

.hds-shop-products ul.products {
  display: grid;
  gap: 24px;
  padding: 0;
  list-style: none;
  width: 100%;
  margin: 0;
}

.hds-shop-products ul.products li.product {
  min-width: 0;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--hds-color-border);
  border-radius: 16px;
  background: var(--hds-color-surface);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
}

.hds-shop-products ul.products li.product:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.10);
  transform: translateY(-3px);
  border-color: transparent;
}

/* ============================================
   PRODUCT CARD INNER
   ============================================ */

.hds-shop-products ul.products li.product a img,
.hds-shop-products ul.products li.product .wp-post-image {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
  margin: 0;
  display: block;
  transition: transform 0.5s ease;
}

.hds-shop-products ul.products li.product:hover a img,
.hds-shop-products ul.products li.product:hover .wp-post-image {
  transform: scale(1.05);
}

.hds-shop-products ul.products li.product .woocommerce-loop-product__title {
  margin: 14px 16px 6px;
  font-family: "Lilita One", "Open Sans", sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--hds-color-text);
  text-transform: uppercase;
  text-align: center;
  min-height: 2.4em;
}

.hds-shop-products ul.products li.product .woocommerce-loop-product__title a {
  color: inherit;
  text-decoration: none;
}

.hds-shop-products ul.products li.product .woocommerce-loop-product__title a:hover {
  color: var(--hds-color-primary);
}

.hds-shop-products ul.products li.product .price {
  display: block;
  margin: 4px 16px 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--hds-color-primary);
  text-align: center;
}

.hds-shop-products ul.products li.product .price del {
  color: var(--hds-color-muted);
  font-size: 15px;
  font-weight: 500;
  margin-right: 6px;
  opacity: 0.7;
}

.hds-shop-products ul.products li.product .price ins {
  background: none;
  font-weight: 700;
  color: var(--hds-color-primary);
}

/* Hide star rating on shop page product cards */
.hds-shop-products ul.products li.product .star-rating {
  display: none;
}

/* Filter widget container */
.hds-shop-filters .hds-filter-widget {
  margin-bottom: 0;
}

/* Add to cart button */
.hds-shop-products ul.products li.product .button {
  display: block;
  width: calc(100% - 32px);
  margin: 10px 16px 18px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--hds-color-primary);
  color: var(--hds-color-frame-contrast);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.hds-shop-products ul.products li.product .button:hover {
  color: var(--hds-color-frame-contrast);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.hds-shop-products ul.products li.product .button:hover::before {
  transform: scaleX(1);
}

/* Only show + icon on shop page product add-to-cart buttons */
.hds-shop-products ul.products li.product .button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hds-color-frame);
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s ease;
}

.hds-shop-products ul.products li.product .button::after {
  content: '+';
  margin-left: 6px;
  font-size: 15px;
  font-weight: 700;
}

/* Wishlist button */
.hds-shop-products ul.products li.product .yith-wcwl-add-to-wishlist {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  margin: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hds-shop-products ul.products li.product:hover .yith-wcwl-add-to-wishlist {
  opacity: 1;
  transform: translateY(0);
}

.hds-shop-products ul.products li.product .yith-wcwl-add-to-wishlist .add_to_wishlist {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hds-color-bg) 92%, transparent);
  color: var(--hds-color-primary);
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.hds-shop-products ul.products li.product .yith-wcwl-add-to-wishlist .add_to_wishlist:hover {
  background: var(--hds-color-primary);
  color: var(--hds-color-frame-contrast);
  transform: scale(1.1);
}

/* Archive summary (short description) */
.hds-shop-products ul.products li.product .hds-archive-summary {
  margin: 0 16px 6px;
  color: var(--hds-color-muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Archive tags */
.hds-shop-products ul.products li.product .hds-archive-tags {
  display: none;
}

/* ============================================
   FILTER SIDEBAR
   ============================================ */

/* Shop search */
.hds-shop-search {
  display: flex;
  align-items: center;
  background: var(--hds-color-surface);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--hds-color-border);
}

.hds-shop-search input[type="search"] {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--hds-color-text);
  background: transparent;
}

.hds-shop-search input[type="search"]::placeholder {
  color: var(--hds-color-muted);
}

.hds-shop-search button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--hds-color-primary);
  color: var(--hds-color-frame-contrast);
  font-size: 16px;
  cursor: pointer;
  margin: 0 3px 0 0;
  transition: background 0.25s ease, transform 0.25s ease;
}

.hds-shop-search button:hover {
  background: var(--hds-color-primary-alt);
  transform: scale(1.08);
}

.hds-shop-filters {
  width: 360px;
  max-width: 360px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: var(--hds-color-surface-alt);
  padding: 24px 20px;
  border-radius: 20px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.hds-shop-filters__close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--hds-color-text);
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

.hds-shop-filters .widget {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

.hds-shop-filters .widget:not(:last-child) {
  margin-bottom: 0;
}

.hds-shop-filters .widget-title,
.hds-shop-filters .widget .widget-title,
.hds-shop-filters .widgettitle,
.hds-shop-filters .widget .widgettitle,
.hds-shop-filters h2.widget-title,
.hds-shop-filters h2.widgettitle {
  font-family: "Lilita One", "Open Sans", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--hds-color-text);
  margin: 0 0 16px;
  padding: 0 0 10px;
  border-bottom: 2px solid color-mix(in srgb, var(--hds-color-primary) 15%, transparent);
  letter-spacing: 0.02em;
  background: none;
  -webkit-text-fill-color: var(--hds-color-text);
}

/* ============================================
   PRICE FILTER
   ============================================ */

.hds-shop-filters .widget_price_filter .price_slider_wrapper .price_slider {
  margin-top: 8px;
}

.hds-shop-filters .widget_price_filter .ui-slider .ui-slider-handle {
  background: var(--hds-color-primary);
  border: 2px solid var(--hds-color-surface);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--hds-color-primary) 30%, transparent);
  width: 18px;
  height: 18px;
  top: -7px;
  border-radius: 50%;
}

.hds-shop-filters .widget_price_filter .ui-slider .ui-slider-range {
  background: var(--hds-color-primary);
}

.hds-shop-filters .widget_price_filter .price_slider_amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hds-shop-filters .widget_price_filter .price_slider_amount .price_label {
  font-size: 14px;
  font-weight: 600;
  color: var(--hds-color-text);
  order: 1;
}

.hds-shop-filters .widget_price_filter .price_slider_amount .button {
  order: 2;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--hds-color-primary);
  color: var(--hds-color-frame-contrast);
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.25s ease;
}

.hds-shop-filters .widget_price_filter .price_slider_amount .button:hover {
  background: var(--hds-color-primary-alt);
}

/* Price slider background */
.hds-shop-filters .price_slider.ui-slider {
  background: color-mix(in srgb, var(--hds-color-text) 10%, transparent);
  height: 4px;
  border-radius: 4px;
}

/* ============================================
   PRODUCT CATEGORIES WIDGET
   ============================================ */

.hds-shop-filters .widget_product_categories ul.product-categories {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hds-all-products-filter {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--hds-color-border) 60%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--hds-color-surface) 92%, transparent);
  color: var(--hds-color-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hds-all-products-filter:hover {
  background: color-mix(in srgb, var(--hds-color-surface) 95%, transparent);
  border-color: color-mix(in srgb, var(--hds-color-primary) 20%, transparent);
  color: var(--hds-color-primary);
  transform: translateY(-1px);
}

.hds-all-products-filter .count {
  flex: 0 0 auto;
  min-width: 28px;
  margin-right: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hds-color-text) 6%, transparent);
  color: var(--hds-color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.hds-all-products-filter:hover .count {
  color: var(--hds-color-primary, #e3092f);
}

.hds-shop-filters .widget_product_categories .cat-item {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 1px solid var(--hds-color-border);
  border-radius: 15px;
  background: var(--hds-color-surface);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--hds-color-text) 4%, transparent);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  overflow: hidden;
}

.hds-shop-filters .widget_product_categories .cat-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 0;
  background: var(--hds-color-primary, #e3092f);
  border-radius: 0 4px 4px 0;
  transform: translateY(-50%);
  transition: height 0.2s ease;
}

.hds-shop-filters .widget_product_categories .cat-item.current-cat::before,
.hds-shop-filters .widget_product_categories .cat-item.current-cat-parent::before,
.hds-shop-filters .widget_product_categories .cat-item.current-cat-ancestor::before {
  height: 60%;
}

.hds-shop-filters .widget_product_categories .cat-item:hover {
  background: color-mix(in srgb, var(--hds-color-surface) 95%, transparent);
  border-color: color-mix(in srgb, var(--hds-color-primary) 20%, transparent);
  transform: translateY(-1px);
}

.hds-shop-filters .widget_product_categories .cat-item.current-cat,
.hds-shop-filters .widget_product_categories .cat-item.current-cat-parent,
.hds-shop-filters .widget_product_categories .cat-item.current-cat-ancestor {
  background: var(--hds-color-surface);
  border-color: color-mix(in srgb, var(--hds-color-primary) 8%, transparent);
  box-shadow: none;
}

.hds-shop-filters .widget_product_categories .cat-item > a {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 4px 12px 14px;
  color: var(--hds-color-text, #1a1a1a);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: color 0.15s ease;
}

.hds-shop-filters .widget_product_categories .cat-item > a:hover,
.hds-shop-filters .widget_product_categories .cat-item.current-cat > a,
.hds-shop-filters .widget_product_categories .cat-item.current-cat-parent > a,
.hds-shop-filters .widget_product_categories .cat-item.current-cat-ancestor > a {
  color: var(--hds-color-primary, #e3092f);
}

.hds-shop-filters .widget_product_categories .count {
  flex: 0 0 auto;
  min-width: 28px;
  margin-right: 12px;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hds-color-text) 6%, transparent);
  color: var(--hds-color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.hds-shop-filters .widget_product_categories .cat-item:hover .count,
.hds-shop-filters .widget_product_categories .cat-item.current-cat .count,
.hds-shop-filters .widget_product_categories .cat-item.current-cat-parent .count,
.hds-shop-filters .widget_product_categories .cat-item.current-cat-ancestor .count {
  color: var(--hds-color-primary, #e3092f);
}

/* Category children (subcategories) */
.hds-shop-filters .widget_product_categories .children {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: -2px 10px 10px 18px;
  padding: 0 0 0 12px;
  border-left: 1px solid color-mix(in srgb, var(--hds-color-primary) 16%, transparent);
  overflow: hidden;
}

.hds-shop-filters .widget_product_categories .children .cat-item {
  border-color: transparent;
  border-radius: 12px;
  background: var(--hds-color-surface);
  box-shadow: none;
  transition: background 0.15s ease;
  overflow: visible;
}

.hds-shop-filters .widget_product_categories .children .cat-item:hover {
  background: color-mix(in srgb, var(--hds-color-primary) 4%, transparent);
}

.hds-shop-filters .widget_product_categories .children .cat-item > a {
  padding: 8px 4px 8px 10px;
  color: var(--hds-color-muted);
  font-size: 13px;
  font-weight: 400;
}

.hds-shop-filters .widget_product_categories .children .count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  box-sizing: border-box;
  margin-right: 22px;
  padding: 2px 6px;
  border: 1px solid var(--hds-color-border);
  border-radius: 999px;
  background: var(--hds-color-surface);
  color: var(--hds-color-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.hds-shop-filters .widget_product_categories .children .cat-item > a:hover,
.hds-shop-filters .widget_product_categories .children .cat-item.current-cat > a {
  color: var(--hds-color-primary, #e3092f);
}

.hds-shop-filters .widget_product_categories .children .cat-item:hover .count,
.hds-shop-filters .widget_product_categories .children .cat-item.current-cat .count {
  color: var(--hds-color-primary, #e3092f);
}

/* Category toggle button — CSS chevron */
.hds-category-toggle {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  border: 1px solid var(--hds-color-border);
  border-radius: 999px;
  background: var(--hds-color-surface);
  color: var(--hds-color-muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.hds-category-toggle::before {
  content: "›";
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  display: inline-block;
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.hds-category-toggle[aria-expanded="true"]::before {
  transform: rotate(-90deg);
}

.hds-category-toggle:hover,
.hds-category-toggle:focus {
  background: var(--hds-color-surface);
  border-color: color-mix(in srgb, var(--hds-color-primary) 22%, transparent);
  color: var(--hds-color-primary);
  outline: none;
}

.hds-theme-ready .hds-shop-filters .cat-parent:not(.hds-category-open) > .children {
  display: none;
}

/* ============================================
   PRODUCT TAG CLOUD
   ============================================ */

.hds-shop-filters .widget_product_tag_cloud .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hds-shop-filters .widget_product_tag_cloud .tagcloud a {
  background: var(--hds-color-surface);
  color: var(--hds-color-text);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px !important;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid var(--hds-color-border);
}

.hds-shop-filters .widget_product_tag_cloud .tagcloud a:hover {
  background: var(--hds-color-primary);
  color: var(--hds-color-frame-contrast);
  border-color: var(--hds-color-primary);
}

/* ============================================
   RESPONSIVE: TABLET & MOBILE
   ============================================ */

@media (max-width: 991px) {
  .hds-shop-wrapper {
    flex-direction: column;
    padding: 0 16px 40px;
  }

  .hds-shop-products {
    width: 100%;
  }

  .hds-shop-products ul.products {
    gap: 16px;
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .hds-shop-filters {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding: 70px 20px 30px;
  }

  .hds-shop-filters.hds-filters-open {
    transform: translateX(0);
  }

  .hds-shop-filters__close {
    display: flex;
    top: 16px;
    right: 16px;
  }

  .hds-shop-filters-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .hds-shop-filters-overlay.hds-filters-open {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 576px) {
  .hds-shop-products ul.products {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .hds-shop-products ul.products li.product .woocommerce-loop-product__title {
    font-size: 16px;
    margin: 12px 12px 4px;
  }

  .hds-shop-products ul.products li.product .price {
    font-size: 16px;
    margin: 2px 12px 8px;
  }

  .hds-shop-products ul.products li.product .button {
    width: calc(100% - 24px);
    margin: 8px 12px 14px;
    padding: 10px 16px;
    font-size: 12px;
  }

  .hds-shop-products ul.products li.product .hds-archive-summary {
    margin: 0 12px 4px;
    font-size: 12px;
  }
}

/* ============================================
   FILTER TOGGLE BUTTON (for mobile)
   ============================================ */

.hds-archive-toolbar__filter {
  display: none;
}

@media (max-width: 991px) {
  .hds-archive-toolbar__filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 10px 20px;
    border: 1px solid var(--hds-color-border);
    border-radius: 999px;
    background: var(--hds-color-surface);
    color: var(--hds-color-text);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .hds-archive-toolbar__filter:hover {
    border-color: var(--hds-color-primary);
    color: var(--hds-color-primary);
  }
}
