
/**
 * Responsive Pagination CSS
 * Style dla responsywnej paginacji
 */

/* === PODSTAWOWE STYLE PAGINACJI === */
.responsive-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.responsive-pagination .page-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    gap: 5px;
}

.responsive-pagination .page-item {
    margin: 0;
}

.responsive-pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    background: white;
}

.responsive-pagination .page-link:hover {
    background-color: #f8f9fa;
    border-color: #079257;
    color: #079257;
    transform: translateY(-1px);
}

.responsive-pagination .page-link.current {
    background-color: #079257;
    color: white;
    border-color: #079257;
    cursor: default;
}

.responsive-pagination .page-link.current:hover {
    transform: none;
}

.responsive-pagination .page-item.disabled .page-link {
    color: #ccc;
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.6;
}

/* === RESPONSYWNE STYLE === */

/* DESKTOP (domyślne) */
.responsive-pagination {
    --pagination-gap: 5px;
    --page-size: 40px;
    --page-padding: 8px 12px;
    --font-size: 14px;
}

/* TABLET */
@media (max-width: 1024px) {
    .responsive-pagination {
        --pagination-gap: 4px;
        --page-size: 36px;
        --page-padding: 6px 10px;
        --font-size: 13px;
        margin: 25px 0;
    }
    
    .responsive-pagination .page-list {
        gap: var(--pagination-gap);
    }
    
    .responsive-pagination .page-link {
        min-width: var(--page-size);
        height: var(--page-size);
        padding: var(--page-padding);
        font-size: var(--font-size);
    }
    
    /* Ukryj niektóre numery stron na tablecie */
    .responsive-pagination .page-item:nth-child(n+8):nth-last-child(n+3) {
        display: none;
    }
}

/* MOBILE */
@media (max-width: 768px) {
    .responsive-pagination {
        --pagination-gap: 3px;
        --page-size: 32px;
        --page-padding: 4px 8px;
        --font-size: 12px;
        margin: 20px 0;
        gap: 5px;
    }
    
    .responsive-pagination .page-list {
        gap: var(--pagination-gap);
    }
    
    .responsive-pagination .page-link {
        min-width: var(--page-size);
        height: var(--page-size);
        padding: var(--page-padding);
        font-size: var(--font-size);
        border-radius: 4px;
    }
    
    /* Pokaż tylko niezbędne elementy na mobile */
    .responsive-pagination .page-item:not(.previous):not(.next):not(.current):nth-child(n+4) {
        display: none;
    }
    
    /* Mobilne style dla przycisków Previous/Next */
    .responsive-pagination .page-item.previous .page-link,
    .responsive-pagination .page-item.next .page-link {
        padding: 4px 6px;
        min-width: 28px;
    }
    
    .responsive-pagination .page-item.previous .page-link::before {
        content: "‹";
        font-size: 16px;
    }
    
    .responsive-pagination .page-item.next .page-link::after {
        content: "›";
        font-size: 16px;
    }
}

/* === DEVICE-SPECIFIC HIDING === */

/* Produkty ukrywane przez JavaScript */
.product-item.desktop-hidden,
.category-product-card.desktop-hidden {
    display: none !important;
}

.product-item.tablet-hidden,
.category-product-card.tablet-hidden {
    display: none !important;
}

.product-item.mobile-hidden,
.category-product-card.mobile-hidden {
    display: none !important;
}

/* === LOADING STATES === */
.responsive-pagination.loading {
    opacity: 0.6;
    pointer-events: none;
}

.responsive-pagination.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #079257;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === DEVICE INDICATORS (debug) === */
.device-mobile .responsive-pagination::before,
.device-tablet .responsive-pagination::before,
.device-desktop .responsive-pagination::before {
    content: attr(data-device);
    position: absolute;
    top: -25px;
    left: 0;
    font-size: 11px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    display: none; /* Pokazuj tylko w trybie debug */
}

.debug-mode .device-mobile .responsive-pagination::before {
    content: "📱 Mobile";
    display: block;
}

.debug-mode .device-tablet .responsive-pagination::before {
    content: "📱 Tablet";
    display: block;
}

.debug-mode .device-desktop .responsive-pagination::before {
    content: "💻 Desktop";
    display: block;
}

/* === PAGINATION INFO === */
.pagination-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 10px 0;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.pagination-info .showing-products {
    font-weight: 500;
}

.pagination-info .device-info {
    font-size: 12px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .pagination-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        font-size: 13px;
    }
    
    .pagination-info .device-info {
        order: -1;
    }
}

/* === TRANSITIONS === */
.responsive-pagination,
.pagination-info {
    transition: all 0.3s ease;
}

.product-item,
.category-product-card {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.product-item.hiding,
.category-product-card.hiding {
    opacity: 0;
    transform: scale(0.95);
}

/* === ACCESSIBILITY === */
.responsive-pagination .page-link:focus {
    outline: 2px solid #079257;
    outline-offset: 2px;
}

.responsive-pagination .page-link[aria-current="page"] {
    background-color: #079257;
    color: white;
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    .responsive-pagination .page-link {
        border-width: 2px;
        font-weight: bold;
    }
    
    .responsive-pagination .page-link.current {
        border-color: #000;
        background-color: #000;
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    .responsive-pagination .page-link,
    .product-item,
    .category-product-card {
        transition: none;
    }
    
    .responsive-pagination.loading::after {
        animation: none;
    }
}