/**
 * Brands Page - Grid Layout matching mockup
 * Large brand logos displayed in a clean grid
 */

/* Hide large brand images section */
#start_marken {
  display: none !important;
}

/* Hide brand logos section - using carousel instead */
#start_markenlogos {
  display: none !important;
}

/* ========================================
   HERO SLIDER - Full Width Rotating Banner
   ======================================== */

.hero-slider {
  position: relative;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto 10px;
  overflow: hidden;
  background: #f5f5f5;
}

.hero-slides {
  position: relative;
  width: 100%;
  /* Follow the teaser image ratio (1280x400 = 3.2:1) so the full image
     is always shown at every width and never cropped on the sides. */
  aspect-ratio: 16 / 5;
  height: auto;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  pointer-events: none;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.hero-slide a {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  /* contain = never crop; full banner always visible */
  object-fit: contain;
}

.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background-color: rgba(255,255,255,0.88);
  border: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 0;
  color: #333;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-nav::before {
  content: '';
  display: block;
  width: 12px;
  height: 12px;
  border-top: 2.5px solid #333;
  border-right: 2.5px solid #333;
}

.hero-prev {
  left: 24px;
}

.hero-prev::before {
  transform: rotate(-135deg);
  margin-left: 4px;
}

.hero-next {
  right: 24px;
}

.hero-next::before {
  transform: rotate(45deg);
  margin-right: 4px;
}

.hero-nav:hover {
  background-color: rgba(255,255,255,0.98);
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
  transform: translateY(-50%) scale(1.06);
}

.hero-nav:hover::before {
  border-color: #ccae6a;
}

/* Responsive hero slider */
@media screen and (max-width: 980px) {
  /* Height comes from aspect-ratio; do not force a fixed height here
     or the sides get cropped again. */
  .hero-nav {
    width: 42px;
    height: 42px;
    background-size: 18px 18px;
  }
  
  .hero-prev {
    left: 16px;
  }
  
  .hero-next {
    right: 16px;
  }
}

@media screen and (max-width: 670px) {
  /* Height comes from aspect-ratio; keep full image visible on mobile. */
  .hero-nav {
    width: 38px;
    height: 38px;
    background-size: 16px 16px;
  }
  
  .hero-prev {
    left: 12px;
  }
  
  .hero-next {
    right: 12px;
  }
}

/* Brands Grid Wrapper */
.brands-carousel-wrapper {
  position: relative;
  width: 100%;
  max-width: 1300px;
  margin: 30px auto;
  padding: 25px 0;
  border-bottom: 1px solid #ccae6a;
}

/* Hide navigation arrows for grid layout */
.brands-carousel-nav {
  display: none;
}

/* Carousel Container - now a grid */
.brands-carousel {
  width: 100%;
}

/* Brands Grid */
.brands-carousel-track {
  display: flex;
  flex-wrap: wrap;
  gap: 30px 50px;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

/* Brand Card */
.brand-card {
  flex: 0 0 auto;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.brand-card:hover {
  opacity: 0.7;
}

/* Brand Logo Container */
.brand-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  min-width: 120px;
}

.brand-card-logo img {
  max-width: 200px;
  max-height: 60px;
  height: auto;
  object-fit: contain;
}

/* Hide Brand Name */
.brand-card-name {
  display: none;
}

/* Responsive Adjustments */
@media screen and (max-width: 980px) {
  .brands-carousel-wrapper {
    padding: 20px 10px;
  }
  
  .brands-carousel-track {
    gap: 25px 40px;
  }
  
  .brand-card-logo {
    height: 55px;
    min-width: 100px;
  }
  
  .brand-card-logo img {
    max-width: 150px;
    max-height: 50px;
  }
}

@media screen and (max-width: 670px) {
  .brands-carousel-track {
    gap: 20px 30px;
  }
  
  .brand-card-logo {
    height: 45px;
    min-width: 80px;
  }
  
  .brand-card-logo img {
    max-width: 120px;
    max-height: 40px;
  }
}

/* Override old overview_brand styles */
.brands-carousel-wrapper + .overview_brand,
.brands-carousel-wrapper ~ .overview_brand {
  display: none !important;
}

/* ========================================
   HOMEPAGE BRAND CAROUSEL
   ======================================== */

.homepage-brands-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1300px;
  margin: 20px auto;
  padding: 20px 0;
  border-bottom: 1px solid #ccae6a;
}

.hp-brands-track {
  position: relative;
  flex: 1;
  height: 70px;
  overflow: hidden;
  /* fade out logos at the left/right edges for a clean continuous look */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

/* Continuous marquee row of logos */
.hp-brands-marquee {
  display: flex;
  align-items: center;
  gap: 50px;
  width: max-content;
  height: 100%;
  animation: hp-brands-scroll 40s linear infinite;
  will-change: transform;
}

/* Pause when the user hovers over the carousel */
.homepage-brands-carousel:hover .hp-brands-marquee {
  animation-play-state: paused;
}

@keyframes hp-brands-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hp-brand-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

.hp-brand-logo:hover {
  opacity: 0.7;
}

.hp-brand-logo img {
  height: 50px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

/* Manual navigation arrows for the brand logo carousel */
.hp-brands-nav {
  flex-shrink: 0;
  background-color: rgba(255,255,255,0.88);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  z-index: 5;
}

.hp-brands-nav::before {
  content: '';
  display: block;
  width: 11px;
  height: 11px;
  border-top: 2.5px solid #333;
  border-right: 2.5px solid #333;
}

.hp-brands-prev {
  margin-right: 10px;
}

.hp-brands-prev::before {
  transform: rotate(-135deg);
  margin-left: 4px;
}

.hp-brands-next {
  margin-left: 10px;
}

.hp-brands-next::before {
  transform: rotate(45deg);
  margin-right: 4px;
}

.hp-brands-nav:hover {
  background-color: rgba(255,255,255,0.98);
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
  transform: scale(1.06);
}

.hp-brands-nav:hover::before {
  border-color: #ccae6a;
}

/* ========================================
   HOMEPAGE TOPSELLER CAROUSEL
   ======================================== */

.homepage-topseller {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px 0;
  border-bottom: 1px dotted #ba9845;
}

.homepage-topseller h4 {
  font-size: 22px;
  font-weight: 400;
  color: #333;
  margin: 0 0 20px 0;
  padding-left: 10px;
}

.topseller-carousel-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

.topseller-nav {
  background-color: rgba(255,255,255,0.88);
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 0;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.topseller-nav::before {
  content: '';
  display: block;
  width: 12px;
  height: 12px;
  border-top: 2.5px solid #333;
  border-right: 2.5px solid #333;
}

.topseller-prev::before {
  transform: rotate(-135deg);
  margin-left: 4px;
}

.topseller-next::before {
  transform: rotate(45deg);
  margin-right: 4px;
}

.topseller-nav:hover {
  background-color: rgba(255,255,255,0.98);
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
  transform: scale(1.06);
}

.topseller-nav:hover::before {
  border-color: #ccae6a;
}

.topseller-carousel {
  flex: 1;
  overflow: hidden;
  margin: 0 10px;
}

.topseller-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px 5px;
}

.topseller-track::-webkit-scrollbar {
  display: none;
}

.topseller-track .gallery-item {
  flex: 0 0 220px;
  width: 220px;
  min-width: 220px;
  border-radius: 4px;
}

.topseller-track .gallery-item-image {
  height: 320px !important;
  background: #f9f9f9;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.topseller-track .gallery-item-image img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

/* Brand page topseller: overlay nav arrows inside the carousel box */
#teaser_text.homepage-topseller .topseller-carousel-wrapper {
  position: relative;
}

#teaser_text.homepage-topseller .topseller-carousel {
  margin: 0;
}

#teaser_text.homepage-topseller .topseller-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
}

#teaser_text.homepage-topseller .topseller-prev {
  left: 10px;
}

#teaser_text.homepage-topseller .topseller-next {
  right: 10px;
}

#teaser_text.homepage-topseller .topseller-nav:hover {
  transform: translateY(-50%) scale(1.06);
}

/* Responsive for homepage */
@media screen and (max-width: 980px) {
  .hp-brands-marquee {
    gap: 35px;
  }
  
  .hp-brand-logo img {
    height: 40px;
    max-width: 120px;
  }
  
  .topseller-nav {
    width: 40px;
    height: 40px;
  }
  
  .topseller-nav::before {
    width: 11px;
    height: 11px;
  }
  
  .topseller-track .gallery-item {
    flex: 0 0 180px;
    width: 180px;
    min-width: 180px;
  }
  
  .topseller-track .gallery-item-image {
    height: 230px;
  }
}

@media screen and (max-width: 670px) {
  .hp-brands-marquee {
    gap: 25px;
  }
  
  .hp-brand-logo img {
    height: 30px;
    max-width: 100px;
  }
  
  .topseller-nav {
    width: 36px;
    height: 36px;
  }
  
  .topseller-nav::before {
    width: 10px;
    height: 10px;
    border-width: 2px;
  }
  
  .topseller-track .gallery-item {
    flex: 0 0 160px;
    width: 160px;
    min-width: 160px;
  }
  
  .topseller-track .gallery-item-image {
    height: 200px;
  }
}
