/* ==========================================================================
   AVL Category Template & Custom Elementor Widgets Stylesheet
   Version: 1.5.0
   ========================================================================== */

:root {
  --avl-cat-primary: #ffd100;
  --avl-cat-dark: #09090b;
  --avl-cat-gray: #6b7280;
  --avl-cat-light-gray: #f4f4f5;
  --avl-cat-border: #e4e4e7;
  --avl-cat-radius: 16px;
  --avl-cat-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --avl-cat-sticky-offset: 24px;
}

/* --------------------------------------------------------------------------
   WIDGET 1: Hero Banner & Interactive Header
   -------------------------------------------------------------------------- */
.avl-cat-hero {
  position: relative;
  width: 100%;
  padding: 40px 0 20px;
  background-size: cover;
  background-position: center;
}

.avl-cat-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.avl-cat-breadcrumbs {
  font-size: 13px;
  color: var(--avl-cat-gray);
  margin-bottom: 12px;
}

.avl-cat-breadcrumbs a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.avl-cat-breadcrumbs a:hover {
  color: var(--avl-cat-dark);
}

.avl-cat-breadcrumbs .crumb-sep {
  margin: 0 6px;
  opacity: 0.6;
}

.avl-cat-title {
  font-size: 38px;
  font-weight: 700;
  color: var(--avl-cat-dark);
  margin: 0 0 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.avl-cat-hero--without-card .avl-cat-title {
  margin-bottom: 0;
}

/* Hero Promo & Video Box */
.avl-cat-hero-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #ffffff;
  border: 1px solid var(--avl-cat-border);
  border-radius: var(--avl-cat-radius);
  box-shadow: var(--avl-cat-shadow);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}

.avl-cat-video-thumb {
  position: relative;
  width: 220px;
  height: 124px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}

.avl-cat-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.avl-cat-video-thumb:hover img {
  transform: scale(1.06);
}

.avl-cat-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: background 0.25s ease, transform 0.25s ease;
}

.avl-cat-video-thumb:hover .avl-cat-play-btn {
  background: var(--avl-cat-primary);
  color: var(--avl-cat-dark);
  transform: translate(-50%, -50%) scale(1.1);
}

.avl-cat-hero-content {
  flex: 1 1 auto;
}

.avl-cat-tagline-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.avl-cat-tagline {
  font-size: 18px;
  font-weight: 600;
  color: var(--avl-cat-dark);
  margin: 0;
  line-height: 1.4;
}

.avl-cat-tagline span.highlight {
  color: #10b981;
}

.avl-cat-badge {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Contact CTA Bar */
.avl-cat-cta-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 12px;
  border-top: 1px dashed var(--avl-cat-border);
  font-size: 14px;
  font-weight: 500;
  color: var(--avl-cat-gray);
  flex-wrap: wrap;
}

.avl-cat-cta-bar a {
  color: #0284c7;
  text-decoration: none;
  transition: color 0.2s ease;
}

.avl-cat-cta-bar a:hover {
  text-decoration: underline;
}

.avl-cat-cta-bar .cta-sep {
  color: var(--avl-cat-border);
}

/* Video Modal Lightbox */
.avl-cat-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.avl-cat-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.avl-cat-modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  aspect-ratio: 16/9;
  background: #000000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.avl-cat-modal-content iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.avl-cat-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   WIDGET 2: Subcategory Matrix & Multi-Source Sidebar
   -------------------------------------------------------------------------- */
.avl-product-categories-carousel,
.avl-brands-carousel,
.avl-cat-matrix-section {
  box-sizing: border-box;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.avl-product-categories-carousel,
.avl-brands-carousel {
  margin-top: 32px;
  margin-bottom: 0;
}

.avl-cat-matrix-section {
  margin-top: 32px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 32px;
}

.avl-cat-matrix-section--no-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

.avl-cat-matrix-section--sidebar-only {
  grid-template-columns: minmax(0, 380px);
  justify-content: end;
}

/* Left: Subcategory Matrix Groups */
.avl-subcat-group {
  background: #ffffff;
  border: 1px solid var(--avl-cat-border);
  border-radius: var(--avl-cat-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.avl-subcat-group-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #71717a;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--avl-cat-border);
}

.avl-subcat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.avl-subcat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--avl-cat-dark);
  padding: 16px;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.avl-subcat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--avl-cat-shadow);
  background: #ffffff;
  border-color: var(--avl-cat-border);
}

.avl-subcat-img-wrap {
  width: 100px;
  height: 100px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avl-subcat-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.avl-subcat-card:hover .avl-subcat-img-wrap img {
  transform: scale(1.08);
}

.avl-subcat-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

/* Products shown when the current category has no child categories. */
.avl-cat-leaf-products {
  box-sizing: border-box;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--avl-cat-border);
  border-radius: var(--avl-cat-radius);
  background: #ffffff;
}

.avl-cat-leaf-products .avl-subcat-group-title {
  margin-bottom: 24px;
}

.avl-cat-leaf-product-wrap,
.avl-cat-leaf-product-grid {
  min-width: 0;
  max-width: 100%;
}

.avl-cat-leaf-product-grid {
  transition: opacity 0.18s ease;
}

.avl-cat-leaf-products.is-loading .avl-cat-leaf-product-grid {
  opacity: 0.45;
  pointer-events: none;
}

.avl-cat-leaf-status:not(.is-error) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.avl-cat-leaf-status.is-error {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.5;
}

.avl-cat-leaf-product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(16px, 2vw, 24px);
}

.avl-cat-leaf-product-grid > .AP_Shop_Card {
  min-width: 0;
}

.avl-cat-leaf-empty {
  grid-column: 1 / -1;
  padding: clamp(28px, 5vw, 56px) 20px;
  border: 1px dashed var(--avl-cat-border);
  border-radius: 14px;
  color: var(--avl-cat-gray);
  text-align: center;
}

.avl-cat-leaf-empty h4,
.avl-cat-leaf-empty p {
  margin: 0;
}

.avl-cat-leaf-empty h4 {
  color: var(--avl-cat-dark);
  font-size: 18px;
}

.avl-cat-leaf-empty p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.avl-cat-leaf-pagination {
  margin-top: 32px;
}

.avl-cat-leaf-pagination ul.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.avl-cat-leaf-pagination a.page-numbers,
.avl-cat-leaf-pagination span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 42px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #d4d4d8;
  border-radius: 999px;
  background: #ffffff;
  color: #27272a;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.05);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.avl-cat-leaf-pagination a.page-numbers:hover,
.avl-cat-leaf-pagination a.page-numbers:focus-visible {
  border-color: #09090b;
  background: #f4f4f5;
  color: #09090b;
  box-shadow: 0 5px 14px rgba(9, 9, 11, 0.1);
  transform: translateY(-1px);
}

.avl-cat-leaf-pagination span.page-numbers.current {
  border-color: #09090b;
  background: #09090b;
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(9, 9, 11, 0.16);
}

.avl-cat-leaf-pagination a.page-numbers:focus-visible {
  outline: 2px solid var(--avl-cat-dark);
  outline-offset: 3px;
}

.avl-cat-leaf-pagination a.page-numbers.prev,
.avl-cat-leaf-pagination a.page-numbers.next {
  width: auto;
  gap: 7px;
  padding-left: 16px;
  padding-right: 16px;
}

.avl-cat-leaf-pagination span.page-numbers.dots {
  min-width: 22px;
  padding-left: 2px;
  padding-right: 2px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #71717a;
}

.avl-pagination-icon {
  font-size: 17px;
  line-height: 1;
}

.avl-cat-leaf-pagination a.page-numbers.is-loading {
  position: relative;
  color: transparent !important;
  cursor: wait;
  pointer-events: none;
}

.avl-cat-leaf-pagination a.page-numbers.is-loading::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #d4d4d8;
  border-top-color: #09090b;
  border-radius: 50%;
  animation: avl-leaf-pagination-spin 0.7s linear infinite;
}

@keyframes avl-leaf-pagination-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Right: Multi-source Sidebar */
.avl-sidebar-column {
  min-width: 0;
}

.avl-sidebar-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  isolation: isolate;
}

.avl-sidebar-primary {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.avl-mobile-shop-tools-trigger,
.avl-mobile-shop-tools-backdrop,
.avl-mobile-shop-tools-header,
.avl-mobile-shop-tools-tabs {
  display: none;
}

.avl-cat-sidebar-title {
  margin: 0;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--avl-cat-border);
  color: var(--avl-cat-dark);
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.avl-sidebar-card {
  background: #ffffff;
  border: 1px solid var(--avl-cat-border);
  border-radius: var(--avl-cat-radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.avl-sidebar-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--avl-cat-shadow);
}

.avl-sidebar-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.avl-sidebar-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.avl-sidebar-card-body {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fdfdfd;
}

.avl-sidebar-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--avl-cat-dark);
  margin: 0;
}

.avl-sidebar-arrow {
  color: var(--avl-cat-dark);
  font-size: 14px;
  transition: transform 0.2s ease;
}

.avl-sidebar-card:hover .avl-sidebar-arrow {
  transform: translateX(4px);
}

/* Compact Product Item in Sidebar */
.avl-sidebar-product-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--avl-cat-border);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}

.avl-sidebar-product-item:last-child {
  border-bottom: 0;
}

.avl-sidebar-product-item:hover {
  background: #f9f9fb;
}

.avl-sidebar-product-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.avl-sidebar-product-info {
  flex: 1 1 auto;
}

.avl-sidebar-product-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--avl-cat-dark);
  margin: 0 0 4px;
  line-height: 1.3;
}

.avl-sidebar-product-price {
  font-size: 13px;
  font-weight: 700;
  color: #09090b;
}

.avl-sidebar-empty {
  padding: 20px;
  border: 1px dashed var(--avl-cat-border);
  border-radius: 12px;
  color: var(--avl-cat-gray);
  background: #fafafa;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

/* Compact category explorer above the adaptive sidebar content. */
.avl-sidebar-category-nav {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.avl-sidebar-category-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--avl-cat-border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 36px rgba(9, 9, 11, 0.05);
}

.avl-sidebar-category-location {
  display: grid;
  gap: 6px;
  padding: 15px 16px;
  background: #fafafa;
}

.avl-sidebar-category-location-label {
  color: #71717a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.avl-sidebar-category-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  color: #27272a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.avl-sidebar-category-path a {
  color: #52525b;
  text-decoration: none;
}

.avl-sidebar-category-path a:hover,
.avl-sidebar-category-path a:focus-visible {
  color: #09090b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.avl-sidebar-category-path strong {
  color: #09090b;
  font-weight: 700;
}

.avl-sidebar-category-explorer {
  border-top: 1px solid var(--avl-cat-border);
}

.avl-sidebar-category-explorer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 11px 16px;
  color: #18181b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.avl-sidebar-category-explorer > summary::-webkit-details-marker {
  display: none;
}

.avl-sidebar-category-explorer > summary:hover,
.avl-sidebar-category-explorer > summary:focus-visible {
  background: #f4f4f5;
  outline: none;
}

.avl-sidebar-category-summary-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  background: #18181b;
}

.avl-sidebar-category-summary-icon::before,
.avl-sidebar-category-summary-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 1px;
  background: #ffffff;
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease;
}

.avl-sidebar-category-summary-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.avl-sidebar-category-explorer[open] .avl-sidebar-category-summary-icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.avl-sidebar-category-browser {
  display: grid;
  gap: 12px;
  padding: 0 12px 14px;
  border-top: 1px solid #f4f4f5;
}

.avl-sidebar-category-search {
  position: relative;
  display: block;
  margin-top: 12px;
}

.avl-sidebar-category-search::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 12px;
  width: 12px;
  height: 12px;
  border: 1.5px solid #71717a;
  border-radius: 50%;
  transform: translateY(-58%);
  pointer-events: none;
}

.avl-sidebar-category-search::after {
  content: "";
  position: absolute;
  top: calc(50% + 5px);
  left: 22px;
  width: 5px;
  height: 1.5px;
  border-radius: 2px;
  background: #71717a;
  transform: rotate(45deg);
  pointer-events: none;
}

.avl-sidebar-category-search input[type="search"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 8px 12px 8px 34px;
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  background: #ffffff;
  color: #18181b;
  font: 500 12px/1.4 "Lexend Deca", system-ui, sans-serif;
}

.avl-sidebar-category-search input[type="search"]:focus {
  border-color: #09090b;
  box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.08);
  outline: none;
}

.avl-sidebar-category-tree {
  max-height: min(42vh, 360px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #d4d4d8 transparent;
  scrollbar-width: thin;
}

.avl-sidebar-category-level {
  margin: 0;
  padding: 0;
  list-style: none;
}

.avl-sidebar-category-children > .avl-sidebar-category-level {
  position: relative;
  margin-left: 14px;
  padding-left: 12px;
}

.avl-sidebar-category-children > .avl-sidebar-category-level::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 8px;
  left: 0;
  width: 1px;
  background: #e4e4e7;
}

.avl-sidebar-category-node[hidden],
.avl-sidebar-category-empty[hidden],
.avl-sidebar-category-children[hidden] {
  display: none !important;
}

.avl-sidebar-category-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-height: 40px;
  margin: 2px 0;
  border-radius: 9px;
}

.avl-sidebar-category-row:hover,
.avl-sidebar-category-node.is-current > .avl-sidebar-category-row {
  background: #f4f4f5;
}

.avl-sidebar-category-toggle,
.avl-sidebar-category-toggle-placeholder {
  width: 28px;
  height: 36px;
}

.avl-sidebar-category-nav button.avl-sidebar-category-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 28px;
  min-height: 36px;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  color: #52525b !important;
  box-shadow: none !important;
  font: inherit;
  text-shadow: none;
  appearance: none;
  cursor: pointer;
  transform: none !important;
}

.avl-sidebar-category-nav button.avl-sidebar-category-toggle:hover,
.avl-sidebar-category-nav button.avl-sidebar-category-toggle:focus,
.avl-sidebar-category-nav button.avl-sidebar-category-toggle:focus-visible,
.avl-sidebar-category-nav button.avl-sidebar-category-toggle:active {
  border: 0 !important;
  background: #e4e4e7 !important;
  color: #09090b !important;
  box-shadow: none !important;
  outline: none;
  transform: none !important;
}

.avl-sidebar-category-nav button.avl-sidebar-category-toggle span {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.avl-sidebar-category-nav button.avl-sidebar-category-toggle[aria-expanded="true"] span {
  transform: rotate(45deg) translate(-1px, -1px);
}

.avl-sidebar-category-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px 8px 2px;
  color: #3f3f46;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.avl-sidebar-category-link > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.avl-sidebar-category-link:hover,
.avl-sidebar-category-link:focus-visible,
.avl-sidebar-category-node.is-in-path > .avl-sidebar-category-row .avl-sidebar-category-link {
  color: #09090b;
}

.avl-sidebar-category-link:focus-visible {
  border-radius: 7px;
  outline: 2px solid #09090b;
  outline-offset: -2px;
}

.avl-sidebar-category-current {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: #18181b;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.avl-sidebar-category-empty {
  margin: 8px 0 0;
  padding: 14px 10px;
  border: 1px dashed #d4d4d8;
  border-radius: 9px;
  color: #71717a;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

/* Adaptive sidebar filters shown only when the matrix reaches products. */
.avl-leaf-filter-panel {
  overflow: hidden;
  border: 1px solid var(--avl-cat-border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 36px rgba(9, 9, 11, 0.05);
}

.avl-leaf-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--avl-cat-border);
  background: #fafafa;
  color: #52525b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.avl-leaf-filter-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #09090b;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.2;
}

.avl-leaf-filter-count[hidden] {
  display: none !important;
}

.avl-leaf-filter-form {
  display: grid;
  gap: 18px;
  padding: 18px 16px;
}

.avl-leaf-filter-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.avl-leaf-filter-group label,
.avl-leaf-filter-group legend {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  color: #27272a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.avl-leaf-filter-group input[type="search"],
.avl-leaf-filter-group input[type="number"],
.avl-leaf-filter-group select {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  background: #ffffff;
  color: #18181b;
  font: 500 13px/1.4 "Lexend Deca", system-ui, sans-serif;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.avl-leaf-filter-group input:focus,
.avl-leaf-filter-group select:focus {
  border-color: #09090b;
  box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.08);
  outline: none;
}

.avl-leaf-filter-price-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.avl-leaf-filter-hint {
  margin: 7px 0 0;
  color: #71717a;
  font-size: 11px;
  line-height: 1.45;
}

.avl-leaf-filter-stock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fafafa;
  color: #27272a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.avl-leaf-filter-stock input {
  order: 2;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #e43118;
}

.avl-leaf-filter-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  padding-top: 2px;
}

.avl-leaf-filter-reset,
.avl-leaf-filter-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #18181b;
  border-radius: 10px;
  font: 600 12px/1.3 "Lexend Deca", system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.avl-leaf-filter-reset {
  background: #ffffff;
  color: #18181b;
}

.avl-leaf-filter-apply {
  background: #18181b;
  color: #ffffff;
}

.avl-leaf-filter-reset:hover,
.avl-leaf-filter-reset:focus-visible,
.avl-leaf-filter-apply:hover,
.avl-leaf-filter-apply:focus-visible {
  border-color: #09090b;
  background: #09090b;
  color: #ffffff;
  outline: none;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   WIDGET 3: SEO Text Expander & Browsing History
   -------------------------------------------------------------------------- */
.avl-cat-seo-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.avl-seo-box {
  background: #ffffff;
  border: 1px solid var(--avl-cat-border);
  border-radius: var(--avl-cat-radius);
  padding: 32px;
  position: relative;
}

.avl-seo-content {
  --avl-seo-collapsed-height: 180px;
  position: relative;
  max-height: none;
  overflow: visible;
  transition: max-height 0.4s ease;
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
}

.avl-seo-expander.is-collapsible .avl-seo-content {
  max-height: var(--avl-seo-collapsed-height);
  overflow: hidden;
}

.avl-seo-expander.is-collapsible .avl-seo-content.is-expanded {
  max-height: 4000px;
}

.avl-seo-expander.is-collapsible .avl-seo-content::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.avl-seo-expander.is-collapsible .avl-seo-content.is-expanded::after {
  opacity: 0;
}

.avl-seo-toggle-btn {
  margin-top: 16px;
  background: transparent;
  border: 0;
  color: #0284c7;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.avl-seo-toggle-btn:hover {
  text-decoration: underline;
}

.avl-seo-toggle-btn[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .avl-seo-content,
  .avl-seo-expander.is-collapsible .avl-seo-content::after {
    transition: none;
  }
}

/* Recently Viewed Products Strip */
.avl-cat-history-section {
  margin-top: 32px;
  background: #f4f4f5;
  border-radius: var(--avl-cat-radius);
  padding: 24px;
}

.avl-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.avl-history-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--avl-cat-dark);
  margin: 0;
}

.avl-history-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--avl-cat-gray);
  cursor: pointer;
}

.avl-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* --------------------------------------------------------------------------
   RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) {
  html.avl-cat-sticky-page:not(.avl-search-open),
  html.avl-cat-sticky-page:not(.avl-search-open) body {
    overflow-x: clip !important;
    overflow-y: visible !important;
  }

  .elementor-widget-avl_subcat_matrix_widget,
  .elementor-widget-avl_subcat_matrix_widget > .elementor-widget-container {
    overflow: visible;
  }

  .avl-cat-matrix-section > .avl-sidebar-column {
    align-self: stretch;
  }

  .avl-sidebar-column > .avl-sidebar-wrap {
    position: static;
    width: 100%;
    height: 100%;
    overflow: visible;
  }
}

@media (min-width: 1025px) {
  .avl-sidebar-column > .avl-sidebar-wrap > .avl-sidebar-primary.is-sticky-ready {
    position: sticky;
    top: var(--avl-cat-sticky-offset, 24px);
    height: max-content;
  }
}

@media (max-width: 1024px) {
  .avl-cat-matrix-section {
    grid-template-columns: 1fr;
  }

  .avl-sidebar-column > .avl-sidebar-wrap {
    position: static;
    overflow: visible;
  }

  .avl-cat-matrix-section--leaf-filter > .avl-sidebar-column {
    order: -1;
  }

  .avl-cat-matrix-section--leaf-filter .avl-leaf-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .avl-cat-matrix-section--leaf-filter .avl-leaf-filter-group--search,
  .avl-cat-matrix-section--leaf-filter .avl-leaf-filter-actions {
    grid-column: 1 / -1;
  }

  html.avl-mobile-tools-ready .avl-mobile-shop-tools-trigger {
    position: fixed;
    z-index: 999998;
    right: calc(18px + env(safe-area-inset-right, 0px));
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    min-width: 126px;
    min-height: 50px;
    margin: 0;
    padding: 0 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 999px !important;
    background: #18181b !important;
    color: #ffffff !important;
    box-shadow: 0 14px 34px rgba(9, 9, 11, 0.28), 0 4px 12px rgba(9, 9, 11, 0.18) !important;
    font: 700 13px/1 "Lexend Deca", system-ui, sans-serif !important;
    text-decoration: none !important;
    appearance: none;
    cursor: pointer;
    transform: none !important;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  html.avl-mobile-tools-ready .avl-mobile-shop-tools-trigger:hover,
  html.avl-mobile-tools-ready .avl-mobile-shop-tools-trigger:focus,
  html.avl-mobile-tools-ready .avl-mobile-shop-tools-trigger:focus-visible,
  html.avl-mobile-tools-ready .avl-mobile-shop-tools-trigger:active {
    border-color: rgba(255, 255, 255, 0.24) !important;
    background: #09090b !important;
    color: #ffffff !important;
    box-shadow: 0 16px 38px rgba(9, 9, 11, 0.32), 0 4px 12px rgba(9, 9, 11, 0.2) !important;
    outline: none;
  }

  html.avl-floating-contact-open .avl-mobile-shop-tools-trigger {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .avl-mobile-shop-tools-trigger-icon {
    display: inline-flex;
    width: 19px;
    height: 19px;
  }

  .avl-mobile-shop-tools-trigger-icon svg {
    width: 100%;
    height: 100%;
  }

  html.avl-mobile-tools-ready .avl-mobile-shop-tools-backdrop {
    position: fixed;
    z-index: 1000000;
    inset: 0;
    display: block;
    background: rgba(9, 9, 11, 0.56);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }

  html.avl-mobile-tools-ready .avl-mobile-shop-tools-backdrop[hidden] {
    display: none !important;
  }

  html.avl-mobile-shop-tools-open .avl-mobile-shop-tools-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  html.avl-mobile-tools-ready .avl-sidebar-column--mobile-tools {
    position: fixed;
    z-index: 1000001;
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    width: min(480px, calc(100vw - 32px));
    max-width: none;
    max-height: min(820px, calc(100vh - 32px));
    max-height: min(820px, calc(100dvh - 32px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(9, 9, 11, 0.32);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(28px) scale(0.98);
    transform-origin: right bottom;
    transition: opacity 0.24s ease, transform 0.24s ease, visibility 0s linear 0.24s;
  }

  html.avl-mobile-tools-ready .avl-sidebar-column--mobile-tools.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
  }

  .avl-mobile-shop-tools-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px 12px;
  }

  .avl-mobile-shop-tools-header > div {
    min-width: 0;
  }

  .avl-mobile-shop-tools-header span {
    display: block;
    margin-bottom: 3px;
    color: #71717a;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .avl-mobile-shop-tools-header h2 {
    margin: 0;
    color: #09090b;
    font-size: 20px;
    font-weight: 750;
    line-height: 1.25;
  }

  .avl-mobile-shop-tools-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #f4f4f5 !important;
    color: #18181b !important;
    box-shadow: none !important;
    font: 400 28px/1 system-ui, sans-serif !important;
    appearance: none;
    cursor: pointer;
    transform: none !important;
  }

  .avl-mobile-shop-tools-close:hover,
  .avl-mobile-shop-tools-close:focus,
  .avl-mobile-shop-tools-close:focus-visible,
  .avl-mobile-shop-tools-close:active {
    background: #e4e4e7 !important;
    color: #09090b !important;
    outline: none;
  }

  .avl-mobile-shop-tools-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 4px;
    margin: 0 18px;
    padding: 4px;
    border-radius: 12px;
    background: #f4f4f5;
  }

  .avl-mobile-shop-tools-tabs button {
    min-height: 40px;
    margin: 0;
    padding: 8px 12px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #52525b !important;
    box-shadow: none !important;
    font: 700 12px/1.3 "Lexend Deca", system-ui, sans-serif !important;
    appearance: none;
    cursor: pointer;
    transform: none !important;
  }

  .avl-mobile-shop-tools-tabs button[aria-selected="true"],
  .avl-mobile-shop-tools-tabs button:hover,
  .avl-mobile-shop-tools-tabs button:focus-visible {
    background: #ffffff !important;
    color: #09090b !important;
    box-shadow: 0 3px 10px rgba(9, 9, 11, 0.08) !important;
    outline: none;
  }

  html.avl-mobile-tools-ready .avl-sidebar-column--mobile-tools > .avl-sidebar-wrap {
    flex: 1 1 auto;
    display: block;
    min-height: 0;
    padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .avl-sidebar-column--mobile-tools [data-avl-shop-tools-panel][hidden] {
    display: none !important;
  }

  .avl-sidebar-column--mobile-tools .avl-sidebar-category-nav,
  .avl-sidebar-column--mobile-tools .avl-sidebar-primary {
    gap: 14px;
  }

  html.avl-mobile-shop-tools-open,
  html.avl-mobile-shop-tools-open body {
    overflow: hidden !important;
  }

  html.avl-mobile-shop-tools-open .avl-floating-contact {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (max-width: 767px) {
  .avl-cat-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .avl-cat-video-thumb {
    width: 100%;
    height: 180px;
  }
  .avl-subcat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .avl-cat-leaf-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .avl-cat-leaf-products {
    padding: 16px;
  }

  .avl-cat-matrix-section--leaf-filter .avl-leaf-filter-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .avl-cat-matrix-section--leaf-filter .avl-leaf-filter-group--search,
  .avl-cat-matrix-section--leaf-filter .avl-leaf-filter-actions {
    grid-column: auto;
  }
  .avl-sidebar-category-tree {
    max-height: min(48vh, 420px);
  }

  html.avl-mobile-tools-ready .avl-mobile-shop-tools-trigger {
    right: calc(13px + env(safe-area-inset-right, 0px));
    bottom: calc(81px + env(safe-area-inset-bottom, 0px));
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    padding: 0 !important;
    border-radius: 50% !important;
  }

  .avl-mobile-shop-tools-trigger-label {
    display: none;
  }

  .avl-mobile-shop-tools-trigger-icon {
    width: 22px;
    height: 22px;
  }

  html.avl-mobile-tools-ready .avl-sidebar-column--mobile-tools {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(88vh, 780px);
    max-height: min(88dvh, 780px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }

  html.avl-mobile-tools-ready .avl-sidebar-column--mobile-tools.is-open {
    transform: translateY(0);
  }

  .avl-mobile-shop-tools-header {
    padding: 14px 16px 10px;
  }

  .avl-mobile-shop-tools-tabs {
    margin-right: 16px;
    margin-left: 16px;
  }

  html.avl-mobile-tools-ready .avl-sidebar-column--mobile-tools > .avl-sidebar-wrap {
    padding-right: 16px;
    padding-left: 16px;
  }
  .avl-seo-box {
    padding: 20px;
  }
}

@media (max-width: 479px) {
  .avl-cat-leaf-product-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .avl-cat-leaf-pagination ul.page-numbers {
    gap: 6px;
  }

  .avl-cat-leaf-pagination a.page-numbers,
  .avl-cat-leaf-pagination span.page-numbers {
    min-width: 36px;
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .avl-cat-leaf-pagination a.page-numbers.prev,
  .avl-cat-leaf-pagination a.page-numbers.next {
    width: 36px;
    padding-left: 0;
    padding-right: 0;
  }

  .avl-cat-leaf-pagination .avl-pagination-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .avl-cat-leaf-product-grid {
    transition: none;
  }

  .avl-cat-leaf-pagination a.page-numbers {
    transition: none;
  }

  .avl-cat-leaf-pagination a.page-numbers:hover,
  .avl-cat-leaf-pagination a.page-numbers:focus-visible {
    transform: none;
  }

  .avl-cat-leaf-pagination a.page-numbers.is-loading::after {
    animation: none;
  }

  .avl-leaf-filter-reset,
  .avl-leaf-filter-apply,
  .avl-sidebar-category-explorer > summary,
  .avl-sidebar-category-summary-icon::after,
  .avl-sidebar-category-toggle span,
  .avl-mobile-shop-tools-trigger,
  .avl-mobile-shop-tools-backdrop,
  .avl-sidebar-column--mobile-tools {
    transition: none;
  }

  .avl-leaf-filter-reset:hover,
  .avl-leaf-filter-reset:focus-visible,
  .avl-leaf-filter-apply:hover,
  .avl-leaf-filter-apply:focus-visible {
    transform: none;
  }
}
