/* Brand Carousel Component Styles */
/* Section Layout */
.brand-carousel-section {
  /* padding: 56px 0; */
  min-height: 591px;
  background: #fff;
}

.brand-carousel-section h2 {
  color: var(--text-default-primary, #050505);
  /* headline/h2-large */
  font-family: var(--font-family-title);
  font-size: var(--font-size-4x-large, 54px);
  font-style: normal;
  font-weight: 550;
  line-height: var(--font-lin-height-4x-large, 56px);
  letter-spacing: -1.08px;
  margin: 0;
}

/* Section Header - Heading and Button on same line */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.section-header .btn {
  flex-shrink: 0;
}

/* Actions Top - Legacy, can be removed if not used elsewhere */
.actions-top {
  display: flex;
  justify-content: flex-end;
  margin-top: -40px;
  margin-bottom: 8px;
}

.actions-top .btn {
  padding: 10px 14px;
}

/* Category Tabs */
.tabs {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-large, 20px);
  font-family: 550;
}

.tab {
  color: var(--text-default-secondary);
  font-family: var(--font-family-title);
  font-size: 16px;
  text-transform: uppercase;
  cursor: pointer;
  line-height: 24px;
  padding-bottom: 3px;
  font-weight: 550;
}

.tab:hover {}

.tab.active {
  border-bottom: var(--border-default-brand);
  background: transparent;
}

/* Secondary Tab Style (Underline) */
.tabs-secondary {
  gap: 24px;
  margin-bottom: 60px !important;
  justify-content: center;
}

.tabs-secondary .tab {
  padding-bottom: 3px;
  background: transparent;
  border-radius: 0;
  font-size: 16px;
  font-weight: 550;
  text-transform: uppercase;
  color: var(--text-default-secondary);
  letter-spacing: 0.05em;
  color: #666;
  position: relative;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  line-height: 24px;
}

.tabs-secondary .tab:hover {
  background: transparent;
  color: #333;
}

.tabs-secondary .tab.active {
  color: #111;
  background: transparent;
  border-bottom: var(--border-default-brand);
}

/* Service Content Layout */
.service-content {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 3.5fr;
  gap: 40px;
  margin-top: 48px;
  align-items: start;
}

.service-info {
  width: 281px;
}

.service-name {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  color: #333;
}

[class*="service-name"] .gold-text {
  color: var(--text-default-gold-headings);
}

.service-title {
  font-size: 54px;
  font-family: var(--font-family-title);
  font-weight: 550;
  line-height: 1.2;
  margin: 0;
}

[class*="service-title"] .gold-text {
  color: var(--text-default-gold-headings);
}

.service-title-mobile {
  font-size: 32px;
  font-weight: 550;
  line-height: 40px;
  font-family: var(--font-family-title);
  margin: 0 0 20px 0;
}

.service-description-mobile {
  line-height: 18px !important;
}

.service-description {
  color: var(--text-default-primary);
  font-family: var(--font-family-body);
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px
}

/* Mobile service info */
.service-info-mobile {
  text-align: left;
  display: none;
  /* Hidden on desktop */
}

.service-name-mobile {
  font-size: 30px;
  font-weight: 550;
  line-height: 36px;
  margin-bottom: 20px;
  font-family: var(--font-family-title);
}

.service-description-mobile {
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
}

/* Mobile/Desktop visibility helpers */
.tablet-only {
  display: none;
  /* Hide by default, show on tablet */
}

/* Service info outside carousel - for mobile only */
.service-info-outside {
  display: none;
  /* Hidden on tablet, shown on mobile */
}

/* Service slide inside Swiper - for tablet only */
.service-slide {
  display: none;
  justify-content: center;
}

.swiper-slide.tablet-only {
  width: 246px;
  align-items: flex-start;
  padding-right: 24px;
}

/* Brand Cards */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
  transition: transform 0.2s ease;
}

.card-link:hover {
  transform: translateY(-4px);
}

.card {
  background: white;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  width: 313px;
}

.card .media {
  height: 313px;
  width: 313px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card .media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card .media span {
  font-size: 18px;
  font-weight: 600;
  color: #666;
  text-align: center;
}

.brand-card-badge {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: var(--background-default-primary);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 4px;
  z-index: 10;
}

.card .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 24px;
}

.card h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-family: var(--font-family-title);
  font-weight: 550;
}

.card p {
  margin: 0 0 auto;
  font-size: 16px;
  line-height: 24px;
  flex: 1;
}

.card .link {
  display: block;
  font-weight: 550;
  font-family: var(--font-family-title);
  text-decoration: none;
  font-size: 16px;
  text-transform: uppercase;
  padding: 12px 0;
  margin-top: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card:hover .link {
  opacity: 1;
}

.card .link:hover {}

/* Loading and Error States */
.card.loading .content {
  position: relative;
  opacity: 0.7;
}

.card.loading .content::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #b8860b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Skeleton Loading States */
.skeleton-card {
  pointer-events: none;
  user-select: none;
}

.skeleton-media {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  min-height: 200px;
}

.skeleton-text {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
  height: 1em;
  margin-bottom: 12px;
  color: transparent !important;
  overflow: hidden;
}

.skeleton-text::before,
.skeleton-text::after {
  content: none !important;
}

.skeleton-title {
  width: 60%;
  height: 24px;
  margin-bottom: 16px;
}

.skeleton-description {
  width: 100%;
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-heading {
  width: 70%;
  height: 20px;
  margin-bottom: 12px;
}

.skeleton-paragraph {
  width: 100%;
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-paragraph.short {
  width: 80%;
}

.service-info-mobile.skeleton {
  pointer-events: none;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

#brands-container {}

/* Swiper Carousel Styles */
.swiper {
  position: relative;
  padding-bottom: 20px;
  width: 100%;
  overflow: hidden;
  height: 444px;
}

.swiper .loading-container {
  height: 460px;
}

.swiper-wrapper {
  display: flex;
}

.swiper-slide {
  height: auto;
  display: flex;
  width: auto;
  /* Allow auto width for slidesPerView: 'auto' */
}

.swiper-slide .card {
  width: 100%;
}

/* Custom Navigation Arrows - positioned relative to .service-content but aligned to carousel */
.carousel-arrow {
  position: absolute;
  top: 33%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #000;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease;
}

.carousel-arrow:hover {
  background: #333;
}

.carousel-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-arrow-prev {
  left: calc(25% - 5px);
  transform: translateY(-50%) translateX(-50%);
}

.carousel-arrow-next {
  right: 0;
  transform: translateY(-50%) translateX(46%);
}

.carousel-arrow-prev svg {
  margin-right: 2px;
}

.carousel-arrow-next svg {
  margin-left: 2px;
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
}

/* Hide default Swiper buttons */
.swiper-button-prev,
.swiper-button-next {
  display: none !important;
}

/* Swiper Pagination */
.swiper-pagination-bullet {
  background: #ccc;
  opacity: 1;
}

.swiper-pagination-bullet-active {
  background: #333;
}

section[data-taxonomy="brand_secondary_category"] [class*="service-description"] {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

section[data-taxonomy="brand_secondary_category"] .service-title {
  margin-bottom: 24px;
}

/* Desktop: Fixed slide width for auto mode */
@media (min-width: 1040px) {
  .swiper-slide {
    width: max(313px, calc((100% - 32px) / 3));
    min-width: 313px;
    flex-shrink: 0;
  }

  .swiper-slide .card {
    width: 100%;
  }

  /* Ensure mobile-only elements are hidden on desktop */
  .mobile-only {
    display: none !important;
  }

  .service-slide {
    display: none !important;
  }

  .service-content-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 70px;
  }
}

/* Responsive Design */
@media screen and (max-width: 1040px) {
  .service-content {
    display: block;
    /* Change from grid to block */
  }

  .card .content {
    margin-top: 20px;
  }

  .card .media {
    width: 246px;
    height: 246px;
  }

  .card .link {
    opacity: 1;
  }

  .service-info-mobile {
    display: block;
  }

  .swiper .loading-container {
    height: 300px;
  }

  /* On tablet: show service slide inside carousel, hide outside div */
  .service-slide.tablet-only {
    display: flex !important;
  }

  .service-info-outside {
    display: none !important;
  }

  .service-name {
    font-size: 24px;
  }

  .tab {
    white-space: nowrap;
  }

  /* Section header responsive */
  .section-header {
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
  }

  .section-header h2 {
    font-size: 34px;
  }

  .section-header .btn {
    align-self: flex-start;
  }

  .actions-top {
    margin-top: 0;
    margin-bottom: 16px;
    justify-content: center;
  }

  /* Enable free scrolling on Swiper */
  .swiper {
    overflow: hidden;
    padding: 0 40px !important;
    /* Changed from visible to hidden */
    min-height: 355px;
    height: unset;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow: scroll;
    margin: 0 -40px;
    padding: 0 40px;
    scroll-padding-left: 40px;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .swiper-wrapper {
    cursor: grab;
  }

  .brand-carousel-section {
    padding: 48px 0;
  }

  .swiper-wrapper:active {
    cursor: grabbing;
  }

  /* Control slide width for auto sizing */
  .swiper-slide {
    width: 246px !important;
  }

  /* Service slide takes more width on tablet */
  .service-slide.tablet-only {
    width: 90vw;
  }

  /* Hide navigation arrows on mobile */
  .carousel-arrow {
    display: none !important;
  }

  .card-link > span.link {
    display: none;
  }

  .tabs-secondary {
    margin-bottom: 40px !important;
  }

  .service-info-mobile h3 {
    font-size: 34px;
    line-height: 40px;
  }
}

@media (max-width: 640px) {
  .brand-carousel-section {
    padding: 36px 0;
  }

  .brand-carousel-section h2 {
    font-size: 34px;
    text-align: center;
  }

  /* On mobile: hide service slide, show outside div above carousel */
  .service-slide.tablet-only {
    display: none !important;
  }

  .service-info-outside {
    display: block !important;
  }

  .service-name-mobile {
    font-size: 28px;
    text-align: left;
    font-weight: 550;
  }

  [class*="service-name"] .gold-text {
    color: var(--text-brand-default);
  }

  .service-content {
    margin-top: 40px;
  }

  .service-name-mobile::after {
    display: none;
  }

  .service-description-mobile {
    text-align: left;
    font-size: 14px;
  }

  .section-header {
    margin-bottom: 24px;
  }

  .tabs {
    margin: 0 -20px;
    padding: 0 20px;
    gap: 16px;
    scroll-padding-left: 20px;
  }

  .tabs-secondary {
    margin: 0 -20px 36px -20px !important;
    padding: 0 20px;
    gap: 16px;
    justify-content: flex-start;
    scroll-padding-left: 20px;
  }

  .tab {
    text-align: center;
  }

  .swiper-button-prev,
  .swiper-button-next {
    display: none !important;
  }

  .section-header .btn {
    display: none;
  }

  .service-info-outside {
    margin: 0 20px
  }

  /* Swiper needs overflow hidden for scrolling */
  .swiper {
    overflow: hidden;
    padding: 0 20px 24px 20px !important;
    min-height: 377px;
  }

  /* Control slide width for mobile */
  .swiper-slide {
    width: 313px;
  }

  .btn.secondary.mobile-only {
    width: 100%;
    justify-content: center;
  }
}