/* VIP Mobile Plugin Styles - Compact v2.4 (Gray Pagination) */
/* REMOVED @import to improve page load speed (Moved to PHP enqueue) */

:root {
    --font-heading: 'Kanit', sans-serif;
    --font-body: 'Sarabun', sans-serif;
    --status-success: #28a745;
    --status-danger: #dc3545;
    --text-dark: #1a202c;
    --text-grey: #4a5568;
    /* เปลี่ยนสี Pagination เป็นสีเทา */
    --pagination-color: #6c757d;
}

.mns-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: var(--font-body);
}

.mns-results h3 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

/* --- GRID SYSTEM --- */
.mns-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* --- CARD DESIGN --- */
.mns-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 6px solid var(--card-color, #ccc);
    border-left: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    position: relative;
}

.mns-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* --- VIP BADGE (UPDATED) --- */
.mns-vip-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 48px; /* ขยายเล็กน้อย */
    height: 48px;
    /* ปรับ Gradient ให้เข้มขึ้น ดูแพงขึ้น (Gold -> Orange Red) */
    background: linear-gradient(135deg, #FFD700 0%, #ff8c00 100%);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding-top: 6px;
    padding-right: 6px;
    z-index: 10;
    box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.15);
    overflow: hidden; /* จำเป็นสำหรับ Shine Effect */
}

/* Shine Animation Layer */
.mns-vip-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
    transform: skewX(-25deg);
    animation: mns-shine 4s infinite; /* เล่นวนทุก 4 วินาที */
}

@keyframes mns-shine {
    0% { left: -150%; }
    20% { left: 150%; } /* วิ่งผ่านเร็วๆ ในช่วงแรก */
    100% { left: 150%; } /* รอจนครบเวลา */
}

.mns-vip-badge svg {
    width: 22px; /* ขยายไอคอน */
    height: 22px;
    color: #fff;
    /* เพิ่มเงาให้ไอคอนลอยเด่น */
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
    position: relative;
    z-index: 2;
}

.mns-card-body {
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    text-align: center;
    height: 100%;
}

/* 1. Phone Number */
.mns-row-phone {
    width: 100%;
    margin-bottom: 0px;
}

.mns-row-phone a {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    line-height: 1.1;
    display: block;
}

/* 2. Info */
.mns-row-info {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2px;
    border-bottom: 1px dashed #f0f0f0;
}

/* แก้ไขให้รองรับ img และ class .mns-logo-img */
.mns-info-logo img,
.mns-info-logo svg,
.mns-logo-img,
.mns-logo-svg {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.mns-info-price {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--card-color, #dc3545);
}

/* 3. Stats */
.mns-row-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin: 1px 0;
}

.mns-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
}

.mns-stat-label {
    font-size: 0.85rem;
    color: #a0aec0;
    font-weight: 600;
}

.mns-grade-circle,
.mns-sum-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
}

.mns-grade-circle {
    color: #fff;
    background-color: var(--card-color, #ccc);
}

.mns-sum-circle {
    background-color: #fff;
    color: var(--card-color, #ccc);
    border: 2px solid var(--card-color, #ccc);
}

.mns-stat-divider {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
}

/* 4. Description (Dynamic Prediction) - THAI FONT FIX & COLOR CHANGE */
.mns-row-desc {
    flex-grow: 1;
    width: 100%;
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 600; 
    
    /* Change 1: ใช้สีดำตามคำขอ */
    color: #000000; 
    
    /* Change 2: ปรับ line-height และ padding สำหรับภาษาไทยสระ 3 ชั้น */
    line-height: 1.6; /* เพิ่มความสูงบรรทัด */
    padding-top: 4px; /* เผื่อที่ด้านบนสำหรับวรรณยุกต์ */
    
    /* Adjusted min-height for correct alignment with new line-height */
    min-height: 3.2em; 
    
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
    margin-top: 2px;
}

/* 5. Actions Buttons */
.mns-row-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: auto;
    padding-top: 1px;
}

/* Change: บังคับปุ่มรถเข็น (ตัวแรก) ให้ใช้สีตามเครือข่าย */
.mns-row-actions .mns-btn-circle:first-child {
    background: var(--card-color, #28a745) !important;
}

.mns-btn-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.mns-btn-circle:hover {
    transform: scale(1.1);
}

.mns-btn-circle svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5px;
}

.mns-btn-compare {
    background: linear-gradient(135deg, #f6ad55, #ed8936);
}

.mns-btn-call {
    background: linear-gradient(135deg, #48bb78, #38a169);
}


/* --- PAGINATION STYLES --- */
.mns-pagination-wrapper {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.mns-pagination {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.mns-pagination li {
    display: inline-block;
    margin: 0;
}

.mns-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    color: var(--pagination-color);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.mns-pagination a.page-numbers:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
    border-color: var(--pagination-color);
}

.mns-pagination .page-numbers.current {
    background-color: var(--pagination-color);
    color: #fff;
    border-color: var(--pagination-color);
    pointer-events: none;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .mns-container {
        padding: 10px;
    }

    .mns-results-grid {
        gap: 8px;
    }

    .mns-card-body {
        padding: 6px 4px;
    }

    .mns-row-phone a {
        font-size: 1.6rem;
        white-space: nowrap;
    }

    /* แก้ไขขนาด Logo Image บนมือถือ */
    .mns-info-logo img,
    .mns-info-logo svg,
    .mns-logo-img,
    .mns-logo-svg {
        height: 30px;
    }

    .mns-info-price {
        font-size: 1.6rem;
    }

    .mns-grade-circle,
    .mns-sum-circle {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .mns-row-desc {
        font-size: 1.1rem;
        min-height: 2.2em;
    }

    .mns-vip-badge {
        width: 35px;
        height: 35px;
    }

    .mns-vip-badge svg {
        width: 16px;
        height: 16px;
    }

    .mns-pagination .page-numbers {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}