/* Custom Category Page Layout */
.custom-category-page {
  width: 100%;
}


/* ACF Fields Section */
.custom-category-page .category-lead-fields {
    margin-bottom: 40px;
    display: flex;
    flex-wrap: wrap;
}

.custom-category-page .category-lead-field {
  flex: 0 0 50%;
} 

.custom-category-page .category-lead-field.lead-text {
}

.custom-category-page .category-lead-field.lead-text .lead-text-inner {
  width: 100%;
  max-width: 800px;
  float: right;
  padding: 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.custom-category-page .category-lead-field.lead-image {
  min-height: 480px;
  width: 50%;
}

.custom-category-page .category-lead-field.lead-image.empty {
  min-height: 0;
}

.custom-category-page .category-lead-field.lead-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  display: block;
}

.custom-category-page .category-title {
  flex: 0 0 auto;
}

.custom-category-page .category-description {
    margin: 0;
    font-size: 20px;
    line-height: 1.6;
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    flex-direction: column;
}

.custom-category-page .category-description p:last-child {
  /*margin-bottom: 0;*/
}

/* Subcategories Grid */
.custom-category-page .subcategories-section {
    margin: 50px 0;
}

.custom-category-page .section-title {
    font-size: 24px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.custom-category-page .fourreasons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 60px;
}

/* Carousel Container */
.subcategories-carousel-wrapper {
    margin: 0 auto;
    padding: 0;
    position: relative;
}

/* Splide Customization */
#subcategory-carousel {
    padding: 0;
}

#subcategory-carousel .splide__slide {
    padding: 10px;
    height: auto;
}

/* Subcategory Cards */
.subcategory-card {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 80px 20px;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Overlay for text readability */
.subcategory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.0);
    transition: background 0.3s ease;
}

.subcategory-card:hover::before {
    background: rgba(0, 0, 0, 0.3);
}

.subcategory-card .subcategory-text {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    width: 100%;
}

.subcategory-card .subcategory-name {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    padding: 12px 24px;
    border-radius: 8px;
    display: inline-block;
    transition: all 0.3s ease;
}

.subcategory-card:hover .subcategory-name {
    transform: scale(1.2);
}

/* Card hover effect */
.subcategory-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    z-index: 10;
}

/* Splide Arrows */
#subcategory-carousel .splide__arrow {
    background: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    opacity: 1;
    transition: all 0.3s ease;
}

#subcategory-carousel .splide__arrow:hover {
    background: #667eea;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

#subcategory-carousel .splide__arrow:hover svg {
    fill: white;
}

#subcategory-carousel .splide__arrow svg {
    fill: #333;
    transition: fill 0.3s ease;
}

#subcategory-carousel .splide__arrow--prev {
    left: -20px;
}

#subcategory-carousel .splide__arrow--next {
    right: -20px;
}

/* Splide Pagination */
#subcategory-carousel .splide__pagination {
    bottom: -30px;
}

#subcategory-carousel .splide__pagination__page {
    background: #ccc;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
    transition: all 0.3s ease;
}

#subcategory-carousel .splide__pagination__page.is-active {
    background: #667eea;
    transform: scale(1.3);
}

.subcategory-carousel.one-slide .splide__list {
  justify-content: center;
}

.subcategory-carousel.two-slides .splide__list {
  justify-content: center;
}

.subcategory-carousel.one-slide .splide__arrows,
.subcategory-carousel.two-slides .splide__arrows {
  display: none;
}


/* Responsive */
@media (max-width: 1440px) {
  .custom-category-page .products-section {
      padding: 0 10px;
  }
}

@media (max-width: 1024px) {
    .subcategories-carousel-wrapper {
        padding: 20px 40px;
    }
    
    .subcategory-card {
        min-height: 240px;
        padding: 60px 15px;
    }
    
    .subcategory-card .subcategory-name {
        font-size: 20px;
        padding: 10px 20px;
    }
    
    #subcategory-carousel .splide__arrow {
        width: 40px;
        height: 40px;
    }
    
    #subcategory-carousel .splide__arrow--prev {
        left: -15px;
    }
    
    #subcategory-carousel .splide__arrow--next {
        right: -15px;
    }
}

@media (max-width: 768px) {
    .subcategories-carousel-wrapper {
        padding: 10px 30px;
    }
    
    .subcategory-card {
        min-height: 200px;
        padding: 40px 15px;
    }
    
    .subcategory-card .subcategory-name {
        font-size: 18px;
        padding: 8px 16px;
    }
    
    #subcategory-carousel .splide__arrow {
        width: 35px;
        height: 35px;
    }
    
    #subcategory-carousel .splide__arrow--prev {
        left: -10px;
    }
    
    #subcategory-carousel .splide__arrow--next {
        right: -10px;
    }
    
    #subcategory-carousel .splide__pagination {
        bottom: -25px;
    }
    .subcategory-carousel.two-slides .splide__list {
      justify-content: start;
    }
}

@media (max-width: 480px) {
    .subcategories-carousel-wrapper {
        padding: 10px 20px;
    }
    
    .subcategory-card {
        min-height: 180px;
        padding: 30px 15px;
    }
    
    .subcategory-card .subcategory-name {
        font-size: 16px;
        padding: 6px 14px;
    }
    
    #subcategory-carousel .splide__arrow {
        width: 30px;
        height: 30px;
    }
    
    #subcategory-carousel .splide__arrow--prev {
        left: -5px;
    }
    
    #subcategory-carousel .splide__arrow--next {
        right: -5px;
    }
    .subcategory-carousel.two-slides .splide__arrows {
      display: block;
    }
}

.custom-category-page .subcategory-card {
    text-align: center;
    position: relative;
    width: 100%;
    background-size: cover;
    background-color: #eee;
    aspect-ratio: 5 / 4;
    background-position: center center;
}

.custom-category-page .subcategory-card > a {
  transition: transform 0.3s ease;
}

.custom-category-page .subcategory-card a:hover {
}

.custom-category-page .subcategory-card a {
  text-decoration: none;
  color: inherit;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.custom-category-page .subcategory-text {
  width: 100%;
  padding: 2%;
  align-self: end;
  margin: 0 auto;
  transition: background-color 0.3s ease;
}

.custom-category-page .subcategory-card:hover .subcategory-text {

}

.custom-category-page .subcategory-name {
  font-size: 24px;
  margin: 10px 0;
  color: white;
  font-family: 'scrawny-cat-hu';
  text-shadow: 0 0 10px black;
  font-weight: 700;
}

.custom-category-page .product-count {
  font-size: 14px;
  color: #444;
}

/* Products Section */
.custom-category-page .products-section {
    margin: 50px auto;
    max-width: 1440px;
}

.custom-category-page .products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Ensure YITH filter widgets display properly */
.custom-category-page  .yith-wcan-filters {
    margin-bottom: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-category-page  .subcategories-grid,
    .custom-category-page  .fourreasons {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .custom-category-page  .products-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .custom-category-page  .custom-category-page {
        padding: 15px;
    }
    .custom-category-page .category-lead-field {
      flex: 0 0 100%;
    } 
    .custom-category-page .category-lead-field.lead-text .lead-text-inner {
      float: none;
      margin: 0 auto;
    }
}

@media (max-width: 480px) {
  .custom-category-page  .subcategories-grid,
  .custom-category-page  .fourreasons {
      grid-template-columns: repeat(1, 1fr);
  }
  .custom-category-page .category-description {
    font-size: 18px;
  }
}

.custom-category-page .fourreasons {
  background: #111;
  color: white;
  padding: 1rem 0;
}

.custom-category-page .fourreasons .reason {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 10px;
} 

.custom-category-page .fourreasons .reasons-title {
  font-family: "scrawny-cat-hu", Sans-serif;
  font-weight: 600;
  grid-column: 1 / -1;
  color: white;
  text-align: center;
  font-size: 2.2rem;
  margin-top: 1rem;
}

.custom-category-page .fourreasons .reason-title {
  font-family: "4reason-bold", Sans-serif;
  font-size: 25px;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 0.5rem;
}

.custom-category-page .fourreasons .reason-text {
  font-family: "4reason-light", Sans-serif;
  font-weight: 600;
  color: #FFFFFF;
  font-size: 1.1rem;
}

.custom-category-page .category-title h1 {
  font-family: "Scrawny-cat-hu";
}

.custom-category-page ul.page-numbers {
  text-align: center;
}

.custom-category-page ul.page-numbers li {
  border-color: var(--fourreasons-primary) !important;
}

.custom-category-page ul.page-numbers li a {
  color: var(--fourreasons-primary) !important;
}

.custom-category-page ul.page-numbers li span.current,
.custom-category-page ul.page-numbers li a:hover,
.custom-category-page ul.page-numbers li a:focus {
  background-color: var(--fourreasons-primary) !important;
  color: white !important;
}

h2.subcategory-group-title {
  font-family: "scrawny-cat-hu";
  font-size: 2em;
  text-align: center;
  border-bottom: 1px solid #eee;
  margin: 1em 0 0;
} 

.splide__arrow:hover:not(:disabled) {
  background: var(--fourreasons-pink);
}
