/* ============================================================
   DEAL POSTS & BLOG STYLESHEET
   Inspired by BlogGiamGia.vn/deal-posts - Clean, Modern & High Conversion
   Part of TimDealNgon.com
   ============================================================ */

/* --- 1. OVERALL LAYOUT --- */
.deal-posts-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
    margin: 28px 0 60px;
}

@media (max-width: 992px) {
    .deal-posts-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* --- 2. LEFT COLUMN: STICKY CATEGORY SIDEBAR --- */
.deal-sidebar-sticky {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

.deal-cat-box {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.deal-cat-box-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.deal-cat-box-title {
    font-size: 15.5px;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.deal-cat-box-title svg {
    color: #e11d48;
}

.deal-cat-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.deal-cat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: #475569;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.deal-cat-item:hover {
    background: #f8fafc;
    color: #e11d48;
    transform: translateX(3px);
}

.deal-cat-item.active {
    background: #fff1f2;
    color: #e11d48;
    border-color: #fecdd3;
    font-weight: 700;
}

.deal-cat-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    background: #f1f5f9;
    transition: all 0.2s ease;
}

.deal-cat-item.active .deal-cat-icon-wrap {
    background: #ffe4e6;
    color: #e11d48;
}

.deal-cat-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deal-cat-count {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    margin-left: auto;
}

.deal-cat-item.active .deal-cat-count {
    background: #fecdd3;
    color: #be123c;
}

/* Sidebar Community Box */
.deal-sidebar-community {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1.5px solid #bfdbfe;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.08);
}

.deal-community-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.deal-community-desc {
    font-size: 13px;
    color: #1e3a8a;
    line-height: 1.5;
    margin-bottom: 14px;
}

.btn-deal-zalo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: #0284c7;
    color: #ffffff !important;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
    transition: all 0.2s ease;
}

.btn-deal-zalo:hover {
    background: #0369a1;
    transform: translateY(-1px);
}

/* --- 3. MOBILE HORIZONTAL CATEGORY SCROLL --- */
.deal-mobile-cat-scroll {
    display: none;
    overflow-x: auto;
    padding: 6px 4px 14px;
    gap: 8px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.deal-mobile-cat-scroll::-webkit-scrollbar {
    display: none;
}

@media (max-width: 992px) {
    .deal-mobile-cat-scroll {
        display: flex;
    }
    .deal-sidebar-sticky {
        display: none;
    }
}

.deal-mobile-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.deal-mobile-cat-pill.active {
    background: #e11d48;
    color: #ffffff;
    border-color: #e11d48;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

/* --- 4. RIGHT COLUMN: MAIN CONTENT FEED --- */
.deal-main-feed {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Feed Header Controls */
.feed-header-bar {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 20px 24px;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.feed-header-left {
    flex: 1;
    min-width: 260px;
}

.feed-main-title {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.3;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feed-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
}

.feed-search-wrap {
    position: relative;
    width: 280px;
    max-width: 100%;
}

.feed-search-input {
    width: 100%;
    padding: 10px 36px 10px 38px;
    font-size: 13.5px;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    outline: none;
    transition: all 0.2s ease;
    background: #fdfdfd;
}

.feed-search-input:focus {
    background: #ffffff;
    border-color: #e11d48;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

.feed-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.feed-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #e2e8f0;
    color: #475569;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Feed Sort Pills */
.feed-sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.feed-sort-pills {
    display: flex;
    gap: 8px;
}

.feed-sort-btn {
    padding: 6px 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feed-sort-btn.active, .feed-sort-btn:hover {
    background: #1e293b;
    color: #ffffff;
    border-color: #1e293b;
}

.feed-count-indicator {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* --- 5. DEAL POSTS GRID --- */
.deal-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 680px) {
    .deal-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Deal Card (Signature BlogGiamGia Style) */
.deal-post-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.deal-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px -6px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.deal-card-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f8fafc;
}

.deal-card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.deal-post-card:hover .deal-card-thumb-wrap img {
    transform: scale(1.06);
}

.deal-card-badge-cat {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
    color: #ffffff;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
}

.deal-card-badge-time {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    color: #1e293b;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.deal-card-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.deal-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 46px;
}

.deal-card-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.deal-card-title a:hover {
    color: #e11d48;
}

.deal-card-sapo {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 42px;
}

/* Engagement Stats Row */
.deal-card-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #64748b;
    margin-top: auto;
    margin-bottom: 12px;
}

.deal-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.deal-stat-item svg {
    color: #94a3b8;
}

/* Card Bottom Divider & Action */
.deal-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    color: #94a3b8;
}

.deal-card-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.deal-card-link-action {
    color: #e11d48;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.deal-card-link-action:hover {
    gap: 7px;
    color: #be123c;
}

/* --- 6. SIGNATURE "XEM THÊM VOUCHER / BÀI VIẾT" ANIMATION --- */
.deal-see-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    cursor: pointer;
    background: #ffffff;
    border: 1.5px dashed #cbd5e1;
    border-radius: 16px;
    transition: all 0.25s ease;
    margin-top: 10px;
}

.deal-see-more:hover {
    background: #fff1f2;
    border-color: #fecdd3;
    transform: translateY(-2px);
}

.deal-see-more-arrows {
    width: 28px;
    height: 32px;
    margin-bottom: 8px;
}

.deal-see-more-arrows path {
    stroke: #e11d48;
    fill: transparent;
    stroke-width: 3px;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: dealArrowBounce 1.8s infinite;
}

.deal-see-more-arrows path.a1 { animation-delay: -0.6s; }
.deal-see-more-arrows path.a2 { animation-delay: -0.3s; }
.deal-see-more-arrows path.a3 { animation-delay: 0s; }

@keyframes dealArrowBounce {
    0% { opacity: 0.2; transform: translateY(-4px); }
    50% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0.2; transform: translateY(4px); }
}

.deal-see-more-text {
    font-size: 14px;
    font-weight: 700;
    color: #e11d48;
    margin: 0;
}

/* Pagination container */
.deal-pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.deal-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.deal-page-btn:hover {
    border-color: #cbd5e1;
    color: #1e293b;
    background: #f8fafc;
}

.deal-page-btn.active {
    background: #e11d48;
    color: #ffffff;
    border-color: #e11d48;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

/* Skeleton Loading Shimmer Cards */
@keyframes dealShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-box {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: dealShimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.skeleton-card {
    pointer-events: none;
    border-color: #f1f5f9;
}

.skeleton-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px 12px 0 0;
}

