/*
 * VictorStore Category Carousel
 * Mobile Layout - Clean Version 1.0
 * Joomla 6 / SP Page Builder
 */

@media (max-width: 767px) {

  /* Fix SP Page Builder parent width */
  .sppb-div-addon:has(
    > .sppb-addon-wrapper > .vs-category-carousel
  ) {
    flex-direction: column !important;
    align-items: stretch !important;
    min-width: 0 !important;
  }

  .sppb-div-addon:has(
    > .sppb-addon-wrapper > .vs-category-carousel
  ) > .sppb-addon-wrapper {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Main container */
  .vs-category-carousel {
    flex: 0 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;

    padding: 12px !important;

    border: none !important;
    border-top: 1px solid #dddddd !important;
    border-bottom: 1px solid #dddddd !important;
    border-radius: 0 !important;
  }

  .vs-category-carousel > .sppb-addon-wrapper {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Native horizontal scrolling */
  .vs-category-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: stretch !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;

    gap: 10px !important;
    padding-bottom: 12px !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    scroll-snap-type: x mandatory;
    scroll-behavior: auto;

    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;

    scrollbar-width: thin;
    scrollbar-color: #888888 #eeeeee;
  }

  /* Each slide */
  .vs-category-track > .sppb-addon-wrapper {
    flex: 0 0 75% !important;
    width: 75% !important;
    min-width: 0 !important;
    max-width: 75% !important;

    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;

    scroll-snap-align: start;
  }

  /* Category card */
  .vs-category-track
  > .sppb-addon-wrapper
  > .vs-category-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    margin: 0 !important;
    box-sizing: border-box !important;

    border: 1px solid #dddddd !important;
    border-radius: 15px !important;
    overflow: hidden;
  }

  /* Preserve native touch gestures */
  .vs-category-track .vs-card-link {
    touch-action: pan-x pan-y;
  }

  /* Prevent native image dragging */
  .vs-category-track img {
    -webkit-user-drag: none;
  }

  /* Visible scrollbar */
  .vs-category-track::-webkit-scrollbar {
    display: block;
    height: 6px;
  }

  .vs-category-track::-webkit-scrollbar-track {
    background: #eeeeee;
    border-radius: 10px;
  }

  .vs-category-track::-webkit-scrollbar-thumb {
    background: #888888;
    border-radius: 10px;
  }

}