/* ========================================
   JETENGINE SLIDER - UNIFIED
   v1.3.0 - Product Cards + Taxonomy Grid + Gallery
   + Fix: tap highlight on Android
   ======================================== */

/* === ОСНОВНИЙ КОНТЕЙНЕР === */
.jetengine-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: visible;
    padding: 2px 0;
}

/* === КОНТЕЙНЕР ТРЕКУ === */
.slider-container {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}

.slider-container::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* === ТРЕК СЛАЙДЕРА === */
.slider-track {
    display: flex;
    gap: 2px;
}

/* === ЕЛЕМЕНТ СЛАЙДЕРА === */
.slider-item {
    flex: 0 0 173px;
    width: 173px;
    scroll-snap-align: start;
}

@media (max-width: 480px) {
    .slider-item {
        flex: 0 0 calc(100vw / 1.92) !important;
        width: calc(100vw / 1.92) !important;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .slider-item {
        flex: 0 0 calc(100vw / 2.5) !important;
        width: calc(100vw / 2.5) !important;
    }
}

/* === КНОПКИ НАВІГАЦІЇ === */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) !important;
    width: 44px !important;
    height: 44px !important;
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F4FF 100%) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer;
    font-size: 32px !important;
    color: #4272F9 !important;
    z-index: 10;
    transition: all 0.2s ease !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: 0 0 4px 0 !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 
                0 2px 6px rgba(0, 0, 0, 0.12),
                0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.slider-btn:hover {
    background: #4272F9 !important;
    color: #FFFFFF !important;
    transform: translateY(-50%) !important;
    box-shadow: 0 6px 16px rgba(66, 114, 249, 0.3), 
                0 3px 8px rgba(0, 0, 0, 0.15),
                0 1px 4px rgba(0, 0, 0, 0.1) !important;
}

.slider-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F4FF 100%) !important;
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

/* === DOTS ІНДИКАТОР === */
.slider-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 0 10px;
    margin-top: 6px;
    height: 40px;
}

.slider-dot {
    width: 7px;
    height: 7px;
    background: rgba(66, 114, 249, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.slider-dot.active {
    background: #4272F9;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(66, 114, 249, 0.4);
}

/* === ДЕСКТОП === */
@media (min-width: 1024px) {
    .slider-btn {
        display: flex !important;
    }
    
    .slider-dots {
        display: none !important;
    }
}

/* ========================================
   PRODUCT CARD STYLES
   ======================================== */

.product-card {
    position: relative;
    background: #fff;
    border: 1px solid #D0DBE2;
    border-radius: 5px;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Hover тільки для mouse (desktop) і тільки коли не на кнопці */
@media (hover: hover) and (pointer: fine) {
    .product-card:not(:has(.custom-add-to-cart-btn:hover)):hover {
        border-color: #D0DBE2;
        box-shadow: 0 2px 20px rgba(46, 55, 65, 0.2);
    }
}

.product-card .product-button-container {
    position: relative;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

/* === БЕЙДЖІ === */
.badge-listing-main {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    padding: 4px 8px;
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    border-radius: 5px;
}

.badge-listing-main.ridgid-badge {
    padding-bottom: 3px;
}

.badge-listing-main.ridgid-badge::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 8px;
    right: 8px;
    height: 1px;
    background-color: #F5822B;
}

.sale-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    background: #FF4444;
    color: #fff;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

/* === ЗОБРАЖЕННЯ === */
.product-image {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 5px 0;
    overflow: hidden;
}

.product-image img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center !important;
}

/* === ІНФОРМАЦІЯ === */
.product-info-container {
    padding: 5px 8px 5px 5px;
    min-height: 118px;
    flex: 1;
}

.product-sku {
    margin-bottom: 5px;
    color: #8893A6;
    font-family: -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.product-description {
    color: #0F172A;
    font-family: -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-stock-status {
    display: block;
    margin-top: 5px;
    margin-bottom: 5px;
}

.product-stock-status .stock-text {
    color: #198754;
    background: #d1e7dd;
    padding: 4px 6px;
    border-radius: 5px;
    font-weight: 400;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fg-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
    padding: 4px 6px;
    background: #2E3741;
    color: #FFAD00;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
    white-space: nowrap;
    
}

/* iOS specific - lighter font */
@supports (-webkit-touch-callout: none) {
    .product-stock-status .stock-text {
        font-weight: 300;
    }
}

/* === ЦІНИ === */
.product-price-container {
    padding: 5px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 2px 7px;
    min-height: 50px;
    margin-right: 10px;
    flex-direction: column;
}

.product-regular-price {
    color: #8893A6;
    font-size: 16px;
    font-weight: 600;
    text-decoration: line-through;
    font-family: Poppins, sans-serif;
    font-style: oblique;
    line-height: 1;
    white-space: nowrap;
}

.product-price {
    font-size: 16px;
    font-weight: 600;
    font-family: Poppins, sans-serif;
    line-height: 1;
    white-space: nowrap;
}

/* === КНОПКА === */
.product-button-container {
    padding: 0 5px;
    min-height: 40px;
    display: flex;
    align-items: stretch;
}

.product-button-container > * {
    flex: 1;
}

/* ========================================
   TAXONOMY GRID SLIDER (BRANDS)
   ======================================== */

.taxonomy-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F0F4FF;
    border-radius: 5px;
    padding: 11px;
    min-height: 80px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.taxonomy-card:hover {
    background: #E0EAFF;
    box-shadow: 0 4px 12px rgba(66, 114, 249, 0.2);
    transform: translateY(-2px);
}

.taxonomy-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(66, 114, 249, 0.15);
}

.taxonomy-card img {
    max-width: 80%;
    max-height: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}

.taxonomy-card:hover img {
    transform: scale(1.05);
}

/* === TAXONOMY GRID MODE === */
@media (min-width: 768px) {
    .jetengine-slider-wrapper.taxonomy-mode .slider-container {
        overflow: visible;
    }
    
    .jetengine-slider-wrapper.taxonomy-mode .slider-track {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 5px;
    }
    
    .jetengine-slider-wrapper.taxonomy-mode .slider-item {
        flex: none;
        width: 100%;
    }
    
    .jetengine-slider-wrapper.taxonomy-mode .slider-dots {
        display: none !important;
    }
    
    .taxonomy-card {
        min-height: 80px;
        padding: 11px;
    }
}

@media (min-width: 1024px) {
    .jetengine-slider-wrapper.taxonomy-mode .slider-track {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 5px;
    }
    
    .taxonomy-card {
        height: 80px;
        min-height: auto;
        padding: 12px;
    }
    
    .taxonomy-card img {
        max-height: 40px;
    }
}

@media (min-width: 1200px) {
    .jetengine-slider-wrapper.taxonomy-mode .slider-track {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 5px;
    }
    
    .taxonomy-card {
        height: 80px;
        min-height: auto;
        padding: 14px;
    }
    
    .taxonomy-card img {
        max-height: 40px;
    }
}

/* === TAXONOMY SLIDER MODE (Mobile) === */
@media (max-width: 767px) {
    .jetengine-slider-wrapper.taxonomy-mode .slider-track {
        gap: 5px;
    }
    
    .jetengine-slider-wrapper.taxonomy-mode .slider-item {
        flex: 0 0 154px;
        width: 154px;
    }
    
    .taxonomy-card {
        height: 100%;
        min-height: 60px;
        padding: 8px;
    }
}

/* ========================================
   PRODUCT GALLERY SLIDER
   ======================================== */

.product-gallery-slider {
    position: relative;
}

.product-gallery-slider .slider-container {
    position: relative;
    max-width: 100%;
    height: 400px;
    overflow: hidden;
    margin: 0 auto;
}

.product-gallery-slider .slider-track {
    display: flex;
    gap: 0;
    transition: transform 0.4s ease-in-out;
    height: 100%;
    transform: translateX(0);
}

.product-gallery-slider .slider-item {
    position: relative;
    min-width: 100%;
    width: 100%;
    flex: 0 0 100%;
    height: 100%;
    flex-shrink: 0;
}

.product-gallery-slider .gallery-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-gallery-slider .gallery-image img,
.product-gallery-slider .gallery-image .gallery-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.product-gallery-slider .sale-badge {
    position: absolute !important;
    width: 43.75px;
    height: 43.75px;
    font-size: 13.75px;
    bottom: 8px !important;
    left: 8px;
    z-index: 10;
}

.product-gallery-slider .slider-btn {
    display: flex !important;
}

.product-gallery-slider .slider-dots {
    display: none !important;
}

@media (max-width: 768px) {
    .product-gallery-slider .slider-container {
        max-width: 100%;
        height: 400px;
    }
}

/* ========================================
   SINGLE PRODUCT CARD LAYOUT
   ======================================== */

.single-product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.product-info-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.product-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    color: #0F172A;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-badge {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #6B7280;
}

.meta-item {
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

.meta-sku {
    color: #64748B;
}

.meta-stock {
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 500;
}

.meta-stock.in-stock {
    color: #10B981;
    background: #ECFDF5;
}

.meta-stock.out-of-stock {
    color: #EF4444;
    background: #FEF2F2;
}

.product-pricing {
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.old-price {
    font-size: 24px;
    font-weight: 600;
    color: #94A3B8;
    text-decoration: line-through;
    font-family: 'Poppins', sans-serif;
}

.current-price {
    font-size: 36px;
    font-weight: 700;
    color: #EF4444;
    font-family: 'Poppins', sans-serif;
}

.related-products-slider-block .related-products-title {
    font-size: 26px !important;
    font-weight: 600 !important;
    color: #0F172A !important;
    line-height: 1.1 !important;
    margin: 16px 0 16px 0 !important;
    padding-top: 16px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
}

@supports (-webkit-touch-callout: none) {
    .related-products-slider-block .related-products-title {
        font-weight: 500 !important;
    }
}
@media (max-width: 768px) {
    .related-products-slider-block .related-products-title {
        font-size: 20px !important;
        line-height: 1.1 !important;
    }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .single-product-layout {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }
    
    .product-title {
        font-size: 24px;
    }
    
    .current-price {
        font-size: 28px;
    }
    
    .old-price {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .product-title {
        font-size: 20px;
    }
    
    .current-price {
        font-size: 24px;
    }
}