/**
 * Plugin Name: PixelcraftDev Elementor Addon
 * Author: Supapong Sakulkoo (K.Auu)
 * Author URI: https://supapongai.com
 * License: Commercial - Proprietary
 * Copyright: (c) 2026 PixelcraftDev. All rights reserved.
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 */

/**
 * Elementor Extensions Styling
 */

/* Helper for Horizontal Scroll Logic */
.pcd-horizontal-scroll-logic {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 15px !important;
    gap: 0 !important;
}

.pcd-horizontal-scroll-logic > .e-con-inner > *, 
.pcd-horizontal-scroll-logic.e-con > *,
.pcd-horizontal-scroll-logic > .elementor-container > .elementor-row > *,
.pcd-horizontal-scroll-logic > .elementor-container > .elementor-column,
.pcd-horizontal-scroll-logic > .elementor-container > * {
    flex: 0 0 var(--pcd-item-width, 80%) !important;
    scroll-snap-align: start;
    margin-right: 15px !important;
    max-width: var(--pcd-item-width, 80%) !important;
}

.pcd-horizontal-scroll-logic > .e-con-inner > *:last-child, 
.pcd-horizontal-scroll-logic.e-con > *:last-child,
.pcd-horizontal-scroll-logic > .elementor-container > .elementor-column:last-child {
    margin-right: 0 !important;
}

/* Scrollbar Visibility Logic */
.pcd-horizontal-scroll-logic:not(.pcd-show-scrollbar-yes)::-webkit-scrollbar,
.pcd-horizontal-scroll-logic:not(.pcd-show-scrollbar-yes) > .e-con-inner::-webkit-scrollbar,
.pcd-horizontal-scroll-logic:not(.pcd-show-scrollbar-yes) > .elementor-container::-webkit-scrollbar {
    display: none !important;
}

/* Custom Scrollbar Styling */
.pcd-show-scrollbar-yes::-webkit-scrollbar,
.pcd-show-scrollbar-yes > .e-con-inner::-webkit-scrollbar,
.pcd-show-scrollbar-yes > .elementor-container::-webkit-scrollbar {
    height: var(--pcd-scrollbar-height, 4px) !important;
    display: block !important;
}

.pcd-show-scrollbar-yes::-webkit-scrollbar-track,
.pcd-show-scrollbar-yes > .e-con-inner::-webkit-scrollbar-track,
.pcd-show-scrollbar-yes > .elementor-container::-webkit-scrollbar-track {
    background: var(--pcd-scrollbar-track-color, #eeeeee) !important;
}

.pcd-show-scrollbar-yes::-webkit-scrollbar-thumb,
.pcd-show-scrollbar-yes > .e-con-inner::-webkit-scrollbar-thumb,
.pcd-show-scrollbar-yes > .elementor-container::-webkit-scrollbar-thumb {
    background: var(--pcd-scrollbar-thumb-color, #8a2be2) !important;
    border-radius: var(--pcd-scrollbar-thumb-radius, 10px) !important;
}

/* Desktop Breakpoint */
@media (min-width: 1025px) {
    .pcd-scroll-d-yes > .e-con-inner, 
    .pcd-scroll-d-yes.e-con,
    .pcd-scroll-d-yes > .elementor-container,
    .pcd-scroll-d-yes.elementor-section {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 15px !important;
        gap: 0 !important;
    }
    
    .pcd-scroll-d-yes > .e-con-inner > *, 
    .pcd-scroll-d-yes.e-con > *,
    .pcd-scroll-d-yes > .elementor-container > .elementor-row > *,
    .pcd-scroll-d-yes > .elementor-container > .elementor-column,
    .pcd-scroll-d-yes > .elementor-container > * {
        flex: 0 0 var(--pcd-item-width, 25%) !important;
        scroll-snap-align: start;
        margin-right: 15px !important;
        max-width: var(--pcd-item-width, 25%) !important;
    }
}

/* Tablet Breakpoint */
@media (max-width: 1024px) and (min-width: 768px) {
    .pcd-scroll-t-yes > .e-con-inner, 
    .pcd-scroll-t-yes.e-con,
    .pcd-scroll-t-yes > .elementor-container,
    .pcd-scroll-t-yes.elementor-section {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 15px !important;
        gap: 0 !important;
    }
    
    .pcd-scroll-t-yes > .e-con-inner > *, 
    .pcd-scroll-t-yes.e-con > *,
    .pcd-scroll-t-yes > .elementor-container > .elementor-row > *,
    .pcd-scroll-t-yes > .elementor-container > .elementor-column,
    .pcd-scroll-t-yes > .elementor-container > * {
        flex: 0 0 var(--pcd-item-width, 50%) !important;
        scroll-snap-align: start;
        margin-right: 15px !important;
        max-width: var(--pcd-item-width, 50%) !important;
    }
}

/* Mobile Breakpoint */
@media (max-width: 767px) {
    .pcd-scroll-m-yes > .e-con-inner, 
    .pcd-scroll-m-yes.e-con,
    .pcd-scroll-m-yes > .elementor-container,
    .pcd-scroll-m-yes.elementor-section {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 15px !important;
        gap: 0 !important;
    }
    
    .pcd-scroll-m-yes > .e-con-inner > *, 
    .pcd-scroll-m-yes.e-con > *,
    .pcd-scroll-m-yes > .elementor-container > .elementor-row > *,
    .pcd-scroll-m-yes > .elementor-container > .elementor-column,
    .pcd-scroll-m-yes > .elementor-container > * {
        flex: 0 0 var(--pcd-item-width, 80%) !important;
        scroll-snap-align: start;
        margin-right: 15px !important;
        max-width: var(--pcd-item-width, 80%) !important;
    }
}

/* Global Clean up for last items across all breakpoints */
.pcd-scroll-d-yes > .e-con-inner > *:last-child, 
.pcd-scroll-d-yes.e-con > *:last-child,
.pcd-scroll-d-yes > .elementor-container > .elementor-column:last-child,
.pcd-scroll-t-yes > .e-con-inner > *:last-child, 
.pcd-scroll-t-yes.e-con > *:last-child,
.pcd-scroll-t-yes > .elementor-container > .elementor-column:last-child,
.pcd-scroll-m-yes > .e-con-inner > *:last-child, 
.pcd-scroll-m-yes.e-con > *:last-child,
.pcd-scroll-m-yes > .elementor-container > .elementor-column:last-child {
    margin-right: 0 !important;
}

/* Global Scrollbar Hiding when disabled */
[class*="pcd-scroll-"]:not(.pcd-show-scrollbar-yes)::-webkit-scrollbar,
[class*="pcd-scroll-"]:not(.pcd-show-scrollbar-yes) > .e-con-inner::-webkit-scrollbar,
[class*="pcd-scroll-"]:not(.pcd-show-scrollbar-yes) > .elementor-container::-webkit-scrollbar {
    display: none !important;
}
