/* ===================================
   CATEGORIES SECTION - 100% RESPONSIVE
   ================================= */

/* ==== BASE STYLES ==== */
.hdt-categories-section .hdt-categories_image,
.hdt-categories-section .hdt-shop-all {
  width: 180px;
  height: 180px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  will-change: transform;
  box-shadow: none;
}

.hdt-categories-section .hdt-categories_image:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: none;
  border-color: rgba(0, 0, 0, 0.12);
}

.hdt-categories-section .hdt-categories_image img,
.hdt-categories-section .hdt-categories_image picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hdt-categories-section .hdt-categories_image:hover img {
  transform: scale(1.08);
}

.hdt-categories-section .hdt-btn-link {
  padding: 0;
  margin-top: 1.7rem;
}

.hdt-categories-section .hdt-btn-link:after {
  display: none;
}

.hdt-categories-section .hdt-shop-all {
  padding: 0;
  border-radius: var(--rounded-full);
}

.hdt-categories-section .hdt-collection_label {
  background: var(--label-color-bg);
  color: var(--label-color);
  padding: 0 5px;
  line-height: 19px;
  height: auto;
  width: fit-content;
  display: inline-flex;
  --label-color-bg: rgb(var(--color-button));
  --label-color: rgb(var(--color-button-text));
}

.hdt-categories-section .hdt-slider {
  position: relative;
}

.hdt-categories-section .hdt-wrapper {
  position: relative;
}

/* ==== MOBILE STYLES (< 768px) ==== */
@media (max-width: 767px) {
  .hdt-categories-section .hdt-wrapper {
    overflow: hidden;
  }

  .hdt-categories-section .hdt-wrap {
    position: relative;
    padding: 0 8px;
    margin: 0 -8px;
  }

  .hdt-categories-section .hdt-slider__viewport {
    overflow: visible;
  }

  .hdt-categories-section .hdt-slider__container {
    display: flex !important;
    gap: var(--mobile-gap, 12px);
    scroll-padding: 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    touch-action: pan-x;
    flex-wrap: nowrap;
  }

  .hdt-categories-section .hdt-slider__container::-webkit-scrollbar {
    display: none;
  }

  .hdt-categories-section .hdt-slider__slide:not(.hdt-shopall) {
    min-width: calc((100% - var(--mobile-gap, 12px)) / 2);
    flex: 0 0 calc((100% - var(--mobile-gap, 12px)) / 2);
    max-width: calc((100% - var(--mobile-gap, 12px)) / 2);
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .hdt-categories-section .hdt-slider__slide:nth-child(2n+1) {
    scroll-snap-align: start;
  }

  .hdt-categories-section .hdt-slider__slide:nth-child(2n) {
    scroll-snap-align: none;
  }

  .hdt-categories-section .hdt-categories_item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
  }

  .hdt-categories-section .hdt-categories_image,
  .hdt-categories-section .hdt-shop-all {
    width: var(--mobile-image-size, 110px);
    height: var(--mobile-image-size, 110px);
    box-shadow: var(--circle-shadow, none);
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin: 0 auto;
  }

  .hdt-categories-section .hdt-btn-link {
    margin-top: var(--mobile-text-spacing, 8px);
    font-size: var(--text-xs);
    text-align: center;
  }

  /* Hide View All on mobile */
  .hdt-categories-section .hdt-shopall {
    display: none !important;
  }
}

/* ==== TABLET STYLES (768px - 991px) ==== */
@media (min-width: 768px) and (max-width: 991px) {
  .hdt-categories-section .hdt-slider__container {
    display: flex !important;
    gap: var(--tablet-gap, 16px);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .hdt-categories-section .hdt-slider__container::-webkit-scrollbar {
    display: none;
  }

  .hdt-categories-section .hdt-slider__slide:not(.hdt-shopall) {
    min-width: calc((100% - (var(--tablet-gap, 16px) * (var(--tablet-slides, 4) - 1))) / var(--tablet-slides, 4));
    flex: 0 0 calc((100% - (var(--tablet-gap, 16px) * (var(--tablet-slides, 4) - 1))) / var(--tablet-slides, 4));
    max-width: calc((100% - (var(--tablet-gap, 16px) * (var(--tablet-slides, 4) - 1))) / var(--tablet-slides, 4));
    padding: 0;
    margin: 0;
    box-sizing: border-box;
  }

  .hdt-categories-section .hdt-categories_image,
  .hdt-categories-section .hdt-shop-all {
    width: var(--tablet-image-size, 140px);
    height: var(--tablet-image-size, 140px);
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  .hdt-categories-section .hdt-shopall {
    display: none !important;
  }
}

/* ==== DESKTOP SMALL (992px - 1199px) ==== */
@media (min-width: 992px) and (max-width: 1199px) {
  .hdt-categories-section .hdt-slider__container {
    display: flex !important;
    gap: var(--desktop-gap, 20px);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .hdt-categories-section .hdt-slider__container::-webkit-scrollbar {
    display: none;
  }

  .hdt-categories-section .hdt-slider__slide:not(.hdt-shopall) {
    min-width: calc((100% - (var(--desktop-gap, 20px) * (var(--desktop-slides, 5) - 1))) / var(--desktop-slides, 5));
    flex: 0 0 calc((100% - (var(--desktop-gap, 20px) * (var(--desktop-slides, 5) - 1))) / var(--desktop-slides, 5));
    max-width: calc((100% - (var(--desktop-gap, 20px) * (var(--desktop-slides, 5) - 1))) / var(--desktop-slides, 5));
    padding: 0;
    margin: 0;
    box-sizing: border-box;
  }

  .hdt-categories-section .hdt-categories_image,
  .hdt-categories-section .hdt-shop-all {
    width: var(--desktop-image-size, 180px);
    height: var(--desktop-image-size, 180px);
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  .hdt-categories-section .hdt-shopall {
    display: none !important;
  }
}

/* ==== DESKTOP MEDIUM (1200px - 1399px) ==== */
@media (min-width: 1200px) and (max-width: 1399px) {
  .hdt-categories-section .hdt-slider__container {
    display: flex !important;
    gap: var(--desktop-gap, 20px);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .hdt-categories-section .hdt-slider__container::-webkit-scrollbar {
    display: none;
  }

  .hdt-categories-section .hdt-slider__slide:not(.hdt-shopall) {
    min-width: calc((100% - (var(--desktop-gap, 20px) * 5)) / 6);
    flex: 0 0 calc((100% - (var(--desktop-gap, 20px) * 5)) / 6);
    max-width: calc((100% - (var(--desktop-gap, 20px) * 5)) / 6);
    padding: 0;
    margin: 0;
    box-sizing: border-box;
  }

  .hdt-categories-section .hdt-categories_image,
  .hdt-categories-section .hdt-shop-all {
    width: var(--desktop-image-size, 180px);
    height: var(--desktop-image-size, 180px);
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  .hdt-categories-section .hdt-shopall {
    display: none !important;
  }
}

/* ==== DESKTOP LARGE (≥ 1400px) ==== */
@media (min-width: 1400px) {
  .hdt-categories-section .hdt-slider__container {
    display: flex !important;
    gap: var(--desktop-lg-gap, 24px);
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .hdt-categories-section .hdt-slider__container::-webkit-scrollbar {
    display: none;
  }

  .hdt-categories-section .hdt-slider__slide:not(.hdt-shopall) {
    min-width: calc((100% - (var(--desktop-lg-gap, 24px) * (var(--desktop-lg-slides, 7) - 1))) / var(--desktop-lg-slides, 7));
    flex: 0 0 calc((100% - (var(--desktop-lg-gap, 24px) * (var(--desktop-lg-slides, 7) - 1))) / var(--desktop-lg-slides, 7));
    max-width: calc((100% - (var(--desktop-lg-gap, 24px) * (var(--desktop-lg-slides, 7) - 1))) / var(--desktop-lg-slides, 7));
    padding: 0;
    margin: 0;
    box-sizing: border-box;
  }

  .hdt-categories-section .hdt-categories_image,
  .hdt-categories-section .hdt-shop-all {
    width: var(--desktop-lg-image-size, 200px);
    height: var(--desktop-lg-image-size, 200px);
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  .hdt-categories-section .hdt-shopall {
    display: none !important;
  }
}

/* ==== NAVIGATION ARROWS ==== */
.hdt-categories-section .hdt-slider-button-prev,
.hdt-categories-section .hdt-slider-button-next {
  position: absolute;
  top: var(--arrow-position, 40%);
  transform: translateY(-50%);
  z-index: 50;
  width: var(--arrow-size, 40px);
  height: var(--arrow-size, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--arrow-color, #FBB033);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 2px 8px rgba(251, 176, 51, 0.3),
    0 4px 16px rgba(251, 176, 51, 0.2),
    0 0 0 0 rgba(251, 176, 51, 0.4);
  will-change: transform, box-shadow, z-index;
}

.hdt-categories-section .hdt-slider-button-prev:hover,
.hdt-categories-section .hdt-slider-button-next:hover {
  background: var(--arrow-color, #FBB033);
  filter: brightness(1.1);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 
    0 4px 12px rgba(251, 176, 51, 0.4),
    0 8px 24px rgba(251, 176, 51, 0.3),
    0 0 0 4px rgba(251, 176, 51, 0.1);
  z-index: 200;
}

.hdt-categories-section .hdt-slider-button-prev:active,
.hdt-categories-section .hdt-slider-button-next:active {
  background: var(--arrow-color, #FBB033);
  filter: brightness(0.9);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 
    0 2px 6px rgba(251, 176, 51, 0.4),
    0 4px 12px rgba(251, 176, 51, 0.3);
  z-index: 200;
}

.hdt-categories-section .hdt-slider-button-prev {
  left: 2px;
}

.hdt-categories-section .hdt-slider-button-next {
  right: 2px;
}

.hdt-categories-section .hdt-slider-button-prev svg,
.hdt-categories-section .hdt-slider-button-next svg {
  width: calc(var(--arrow-size, 40px) * 0.5);
  height: calc(var(--arrow-size, 40px) * 0.5);
  color: #ffffff;
  stroke-width: 2.5;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hdt-categories-section .hdt-slider-button-prev:hover svg,
.hdt-categories-section .hdt-slider-button-next:hover svg {
  transform: scale(1.1);
}

.hdt-categories-section .hdt-slider-button-prev.swiper-button-disabled,
.hdt-categories-section .hdt-slider-button-next.swiper-button-disabled {
  background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: 
    0 1px 4px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-50%) scale(0.95);
}

.hdt-categories-section .hdt-slider-button-prev.swiper-button-disabled svg,
.hdt-categories-section .hdt-slider-button-next.swiper-button-disabled svg {
  color: #999999;
  filter: none;
}

/* ==== ANIMATIONS ==== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 767px) {
  .hdt-categories-section .hdt-slider__slide {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  .hdt-categories-section .hdt-slider__slide:nth-child(1) { animation-delay: 0.1s; }
  .hdt-categories-section .hdt-slider__slide:nth-child(2) { animation-delay: 0.15s; }
  .hdt-categories-section .hdt-slider__slide:nth-child(3) { animation-delay: 0.2s; }
  .hdt-categories-section .hdt-slider__slide:nth-child(4) { animation-delay: 0.25s; }
  .hdt-categories-section .hdt-slider__slide:nth-child(5) { animation-delay: 0.3s; }
  .hdt-categories-section .hdt-slider__slide:nth-child(6) { animation-delay: 0.35s; }
  .hdt-categories-section .hdt-slider__slide:nth-child(7) { animation-delay: 0.4s; }
}

/* ==== HOVER EFFECTS (Desktop only) ==== */
@media (min-width: 992px) {
  .hdt-categories-section .hdt-categories_item {
    cursor: pointer;
  }

  .hdt-categories-section .hdt-categories_image:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: none !important;
    border-color: rgba(0, 0, 0, 0.12);
  }

  .hdt-categories-section .hdt-categories_image:hover img {
    transform: scale(1.08);
  }

  .hdt-categories-section .hdt-btn-link {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .hdt-categories-section .hdt-btn-link:hover {
    color: #FBB033;
    transform: translateY(-2px);
  }

  .hdt-categories-section .hdt-btn-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FBB033, transparent);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .hdt-categories-section .hdt-btn-link:hover::after {
    transform: translateX(-50%) scaleX(1);
  }
}

/* ==== VERY SMALL SCREENS ==== */
@media (max-width: 390px) {
  .hdt-categories-section .hdt-categories_image,
  .hdt-categories-section .hdt-shop-all {
    width: calc(var(--mobile-image-size, 110px) * 0.91);
    height: calc(var(--mobile-image-size, 110px) * 0.91);
  }
}

@media (max-width: 375px) {
  .hdt-categories-section .hdt-categories_image,
  .hdt-categories-section .hdt-shop-all {
    width: calc(var(--mobile-image-size, 110px) * 0.86);
    height: calc(var(--mobile-image-size, 110px) * 0.86);
  }
}

@media (max-width: 345px) {
  .hdt-categories-section .hdt-categories_image,
  .hdt-categories-section .hdt-shop-all {
    width: calc(var(--mobile-image-size, 110px) * 0.82);
    height: calc(var(--mobile-image-size, 110px) * 0.82);
  }
}

/* ==== IMAGE CENTERING (All Screens) ==== */
.hdt-categories-section .hdt-categories_image img,
.hdt-categories-section .hdt-categories_image picture,
.hdt-categories-section .hdt-categories_image svg {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center center;
  display: block;
  margin: 0 auto;
}

/* ==== ACCESSIBILITY ==== */
.hdt-categories-section .hdt-slider-button-prev:focus,
.hdt-categories-section .hdt-slider-button-next:focus {
  outline: 3px solid rgba(251, 176, 51, 0.5);
  outline-offset: 2px;
}

/* ==== RTL SUPPORT ==== */
[dir="rtl"] .hdt-categories-section .hdt-slider-button-prev {
  left: auto;
  right: 2px;
}

[dir="rtl"] .hdt-categories-section .hdt-slider-button-next {
  right: auto;
  left: 2px;
}
