/* =========================================
   MODULE: PAGINATION CONTROLS & SLIDER
   ========================================= */

.thx-ec-pagination-controls {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 20px; padding-top: 15px; border-top: 1px solid #f0f0f0;
}

.thx-ec-pagination-controls button {
    background: #fff; border: 1px solid #ddd; padding: 8px 16px; 
    border-radius: 4px; cursor: pointer; font-size: 14px; color: #555;
    transition: all 0.2s; position: relative; min-width: 110px; 
    display: inline-flex; align-items: center; justify-content: center;
}

.thx-ec-pagination-controls button:hover:not(:disabled) { 
    background: #f7f7f7; color: #000; border-color: #bbb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.thx-ec-pagination-controls button:disabled { 
    opacity: 0.5; cursor: not-allowed; background-color: #f9f9f9;
}

.thx-ec-page-info { font-weight: 600; font-size: 14px; color: #777; }
.thx-ec-page-info-container { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.thx-ec-page-info-select { display: none; } /* Chỉ hiện trên mobile */

/* --- STEPPED SLIDER --- */
.thx-ec-slider-wrapper {
    margin: 30px 0 20px 0; padding: 15px 0;
    cursor: pointer; user-select: none; touch-action: none; position: relative;
}

/* Thanh ray nền */
.thx-ec-slider-track {
    position: relative; height: 6px; 
    background: #e0e0e0; border-radius: 3px; width: 100%;
}

/* Phần đã chạy */
.thx-ec-slider-fill {
    position: absolute; top: 0; left: 0; bottom: 0;
    background: #ffb74d; border-radius: 3px; width: 0%; pointer-events: none;
    transition: width 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Vạch chia trang (Ticks) */
.thx-ec-slider-tick {
    position: absolute; top: 50%; transform: translate(-50%, -50%);
    width: 8px; height: 8px; 
    background: #fff; border: 2px solid #bdbdbd;
    border-radius: 50%; 
    z-index: 1;
    transition: background-color 0.15s, border-color 0.15s;
    
    /* [CẬP NHẬT] Cho phép nhận sự kiện chuột để hiện tooltip */
    pointer-events: auto; 
}

.thx-ec-slider-tick:hover {
    border-color: #fb8c00; /* Hiệu ứng hover nhẹ */
}

/* Tick đã được fill qua (Active) */
.thx-ec-slider-tick.is-active {
    background: #ffb74d; border-color: #ffb74d;
}

/* Nút kéo (Thumb) */
.thx-ec-slider-thumb {
    position: absolute; top: 50%; left: 0%;
    width: 22px; height: 22px; 
    background: #fff; border: 3px solid #fb8c00; 
    border-radius: 50%; transform: translate(-50%, -50%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); z-index: 2;
    transition: left 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.thx-ec-slider-wrapper:hover .thx-ec-slider-thumb { transform: translate(-50%, -50%) scale(1.1); }
.thx-ec-slider-thumb.active { background: #ffb74d; transform: translate(-50%, -50%) scale(1.2); }

/* TOOLTIP CHÍNH (Hiện khi kéo/hover wrapper) */
.thx-ec-slider-tooltip {
    position: absolute; bottom: 35px; left: 0; transform: translateX(-50%);
    background-color: #333; color: #fff; padding: 4px 8px;
    border-radius: 4px; font-size: 12px; font-weight: bold; white-space: nowrap;
    opacity: 0; visibility: hidden; transition: opacity 0.2s;
    pointer-events: none; z-index: 10;
}
.thx-ec-slider-tooltip::after {
    content: ''; position: absolute; top: 100%; left: 50%; margin-left: -4px;
    border-width: 4px; border-style: solid; border-color: #333 transparent transparent transparent;
}
.thx-ec-slider-wrapper:hover .thx-ec-slider-tooltip,
.thx-ec-slider-wrapper.is-interacting .thx-ec-slider-tooltip {
    opacity: 1; visibility: visible;
}

/* KEYBOARD HINT OVERLAY */
.thx-ec-keyboard-hint-overlay {
    position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7); color: #fff; padding: 8px 16px;
    border-radius: 20px; font-size: 13px; pointer-events: none;
    opacity: 0; transition: opacity 0.5s ease; z-index: 5; white-space: nowrap;
}
.thx-ec-keyboard-hint-overlay.visible { opacity: 1; }

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 600px) {
    .thx-ec-pagination-controls {
        flex-wrap: wrap; /* Cho phép rớt dòng / stack layout */
        gap: 12px;
        padding-top: 12px;
    }
    
    .thx-ec-pagination-controls button {
        min-width: auto; /* Xóa fix chiều rộng tối thiểu 110px */
        padding: 8px 14px;
        flex: 1; /* Để 2 nút Previous/Next chiếm độ rộng bằng nhau nếu nằm trên 1 dòng */
        text-align: center;
    }
    
    .thx-ec-page-info {
        width: 100%; /* Đẩy số trang lên 1 dòng riêng ở giữa */
        text-align: center;
        order: -1; /* Hiển thị phía trên 2 nút bấm */
        margin-bottom: 5px;
    }
    
    .thx-ec-slider-wrapper {
        display: none !important; /* Dẹp luôn thang trượt trên mobile */
    }

    .thx-ec-page-info-text {
        display: none; /* Ẩn chữ cứng */
    }

    .thx-ec-page-info-select {
        display: block; /* Hiện Native Dropdown */
        width: 100%;
        padding: 8px 30px 8px 15px;
        font-size: 15px;
        font-weight: 700;
        color: #2d76b9;
        background-color: #f0f7fa;
        border: 1px solid #cce5f2;
        border-radius: 8px;
        appearance: none;
        -webkit-appearance: none;
        background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%232d76b9%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
        background-repeat: no-repeat;
        background-position: right 10px top 50%;
        background-size: 10px auto;
        cursor: pointer;
        text-align: center;
        text-align-last: center;
        box-shadow: 0 2px 4px rgba(45,118,185,0.05);
    }
}