/**
 * PT Addons Icons Fix
 * 
 * This file fixes missing icons in PT Addons widgets by loading the pticons font
 * and providing Font Awesome fallback.
 */

/* Load pticons font from plugin directory - matches Cartow theme approach */
/* Note: This uses relative path, but inline style in addons.php uses absolute URL as fallback */
@font-face {
    font-family: 'pticons';
    src: url('../fonts/pticons.woff?ci6x92') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

/* CRITICAL FIX: Override widgets.css styles with higher specificity */
/* Target .pt-slider-navigation specifically as that's what's in the HTML */
.pt-slider-navigation .pt-swiper-button-prev,
.pt-slider-navigation .pt-swiper-button-next {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    min-width: 30px !important;
    min-height: 30px !important;
    cursor: pointer !important;
    color: currentColor !important;
}

.pt-slider-navigation .pt-swiper-button-prev::before,
.pt-slider-navigation .pt-swiper-button-next::before,
.pt-swiper-arrows .pt-swiper-button-prev::before,
.pt-swiper-arrows .pt-swiper-button-next::before,
.pt-swiper-button-prev::before,
.pt-swiper-button-next::before {
    font-family: 'pticons' !important;
    font-weight: normal !important;
    font-style: normal !important;
    display: block !important;
    line-height: 1 !important;
    font-size: 16px !important;
    speak: never !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    content: "" !important; /* Reset content first */
}

.pt-slider-navigation .pt-swiper-button-prev::before,
.pt-swiper-arrows .pt-swiper-button-prev::before,
.pt-swiper-button-prev::before {
    content: "\e941" !important; /* pticons left arrow */
}

.pt-slider-navigation .pt-swiper-button-next::before,
.pt-swiper-arrows .pt-swiper-button-next::before,
.pt-swiper-button-next::before {
    content: "\e940" !important; /* pticons right arrow */
}

/* IMMEDIATE Font Awesome fallback - works even if pticons fails */
/* This ensures icons ALWAYS show, even if font doesn't load */
.pt-slider-navigation .pt-swiper-button-prev::before,
.pt-slider-navigation .pt-swiper-button-next::before {
    /* Fallback font stack - Font Awesome will work if pticons fails */
    font-family: 'pticons', "Font Awesome 5 Free", "Font Awesome 5 Pro" !important;
}

/* Force Font Awesome if pticons is not rendering */
/* Check if content is empty or font not loaded, use Font Awesome */
.pt-swiper-button-prev:not([style*="font-family"])::before,
.pt-swiper-button-next:not([style*="font-family"])::before {
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

/* JavaScript fallback support */
.pt-swiper-button-prev[data-icon-fallback="prev"]::before,
.pt-swiper-button-next[data-icon-fallback="next"]::before,
.pt-swiper-button-prev.fa-icon-fallback::before,
.pt-swiper-button-next.fa-icon-fallback::before {
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

.pt-swiper-button-prev[data-icon-fallback="prev"]::before,
.pt-swiper-button-prev.fa-icon-fallback::before {
    content: "\f060" !important; /* fa-chevron-left */
}

.pt-swiper-button-next[data-icon-fallback="next"]::before,
.pt-swiper-button-next.fa-icon-fallback::before {
    content: "\f061" !important; /* fa-chevron-right */
}

/* ULTIMATE FALLBACK: Use Font Awesome as primary fallback */
/* This ensures icons ALWAYS show, even if pticons completely fails */
.pt-slider-navigation .pt-swiper-button-prev::before {
    /* Try pticons first, but Font Awesome will work if pticons fails */
    font-family: 'pticons', "Font Awesome 5 Free", "Font Awesome 5 Pro", sans-serif !important;
    content: "\e941" !important; /* pticons left arrow */
}

.pt-slider-navigation .pt-swiper-button-next::before {
    /* Try pticons first, but Font Awesome will work if pticons fails */
    font-family: 'pticons', "Font Awesome 5 Free", "Font Awesome 5 Pro", sans-serif !important;
    content: "\e940" !important; /* pticons right arrow */
}

/* EMERGENCY FALLBACK: If pticons unicode doesn't render, use Font Awesome unicode */
/* This activates if the browser can't render the pticons characters */
@supports not (font-feature-settings: normal) {
    .pt-slider-navigation .pt-swiper-button-prev::before {
        font-family: "Font Awesome 5 Free" !important;
        font-weight: 900 !important;
        content: "\f060" !important; /* fa-chevron-left */
    }
    
    .pt-slider-navigation .pt-swiper-button-next::before {
        font-family: "Font Awesome 5 Free" !important;
        font-weight: 900 !important;
        content: "\f061" !important; /* fa-chevron-right */
    }
}

/* Fix for other common PT icons */
.pt-search-toggle::before {
    font-family: 'pticons', "Font Awesome 5 Free" !important;
    font-weight: 900;
    content: "\f002" !important; /* fa-search */
}

.pt-cart-text::before {
    font-family: 'pticons', "Font Awesome 5 Free" !important;
    font-weight: 900;
    content: "\f07a" !important; /* fa-shopping-cart */
}

.pt-video-button::before {
    font-family: 'pticons', "Font Awesome 5 Free" !important;
    font-weight: 900;
    content: "\f04b" !important; /* fa-play */
}

.filter-buttons button:not(:last-of-type)::after {
    font-family: 'pticons', "Font Awesome 5 Free" !important;
    font-weight: 900;
    content: "\f0b0" !important; /* fa-filter */
}

.pt-accordion-title::after {
    font-family: 'pticons', "Font Awesome 5 Free" !important;
    font-weight: 900;
    content: "\f067" !important; /* fa-plus */
}

.pt-accordion-title.ui-state-active::after {
    font-family: 'pticons', "Font Awesome 5 Free" !important;
    font-weight: 900;
    content: "\f068" !important; /* fa-minus */
}
