/* 
   ==========================================================
   COUPON CARD SYSTEM V4 (REBUILT FROM SCRATCH)
   Namespace: .cp-card
   Maintenance: Easy & Independent
   ========================================================== 
*/

:root {
    --cp-bg: rgba(22, 26, 32, 0.4);
    --cp-bg-hover: rgba(30, 41, 59, 0.55);
    --cp-border: rgba(255, 255, 255, 0.1);
    --cp-gold: #FFDF73;
    --cp-gold-glow: rgba(229, 169, 60, 0.2);
    --cp-text-main: #f8fafc;
    --cp-text-dim: #94a3b8;
    --cp-radius: 20px;
    --cp-glass-highlight: rgba(255, 255, 255, 0.15);
}

/* 🏆 Premium Badges */
.cp-badge-hot {
    position: absolute;
    top: 15px;
    left: -35px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 6px 40px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    transform: rotate(-45deg);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    z-index: 10;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Section Spacing - Managed here only */
.brand-section {
    margin-bottom: 20px;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* Card Container */
.cp-card {
    display: grid;
    grid-template-columns: 130px 1fr 280px;
    background: var(--cp-bg);
    border: 1px solid var(--cp-border);
    border-top: 1px solid var(--cp-glass-highlight);
    border-left: 1px solid var(--cp-glass-highlight);
    border-radius: var(--cp-radius);
    position: relative;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    margin-bottom: 16px;
    min-height: 100px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    width: 100%;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 0 1px rgba(255, 255, 255, 0.1);
}

.cp-card:hover {
    transform: translateY(-6px);
    background: var(--cp-bg-hover);
    border-color: rgba(229, 169, 60, 0.3);
    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.45),
        0 0 25px rgba(229, 169, 60, 0.1),
        inset 0 0 1px rgba(255, 255, 255, 0.2);
}

/* 1. Brand Section */
.cp-brand {
    padding: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.01);
}

.cp-logo {
    width: 64px;
    height: 64px;
    background: #fff;
    border-radius: 12px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
}

.cp-logo:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.cp-logo img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    object-fit: contain;
}

.cp-store-name {
    font-size: 0.7rem;
    color: var(--cp-text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cp-store-name:hover {
    color: var(--cp-gold);
}

/* 2. Info Section */
.cp-info {
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    position: relative;
    /* Neo nhãn Hot bên trong vùng thông tin */
}

.cp-offer-row {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.cp-discount {
    font-size: 2.8rem;
    font-weight: 900;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--cp-gold);
    background: linear-gradient(135deg, #FFDF73 0%, #E5A93C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 0.9;
    letter-spacing: -2px;
    flex-shrink: 0;
}

.cp-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--cp-text-main);
    line-height: 1.25;
    margin: 0;
    padding-right: 55px;
    /* Chống bị nhãn Hot đè lên chữ */
}

.cp-desc {
    font-size: 0.85rem;
    color: var(--cp-text-dim);
    line-height: 1.5;
    margin: 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cp-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.cp-expiry {
    font-size: 0.78rem;
    color: #fbbf24;
    font-weight: 800;
    background: rgba(251, 191, 36, 0.1);
    padding: 5px 12px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.2px;
}

.cp-urgent {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
    animation: cp-pulse 2s infinite;
}

@keyframes cp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* 3. Action Section */
.cp-action {
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cp-code-box {
    width: 100%;
    background: #1e293b;
    border: 2px dashed rgba(229, 169, 60, 0.5);
    color: var(--cp-gold);
    padding: 8px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 1px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    white-space: nowrap;
}

.cp-code-box::after {
    content: "CHÉP MÃ";
    position: absolute;
    inset: 0;
    background: var(--cp-gold);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: all 0.2s ease;
    transform: translateY(100%);
}

.cp-code-box:hover {
    border-color: var(--cp-gold);
    background: rgba(229, 169, 60, 0.1);
}

.cp-code-box:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* 🎁 Special style for deals with NO CODE */
.cp-no-code {
    border-style: solid !important;
    background: linear-gradient(102deg, #ef9731 0%, #ff5f3c 50%, #ca7006 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(229, 169, 60, 0.3);
}

.cp-no-code::after {
    display: none !important;
}

.cp-no-code:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(229, 169, 60, 0.4);
    background: #202020 !important;
}

.cp-btn {
    width: 100%;
    background: linear-gradient(102deg, #FFC37D 0%, #FF8A00 50%, #E17A00 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0px 0px 8px #ffe2c1 inset;
    padding: 10px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.cp-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(229, 169, 60, 0.3);
}

.cp-status {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    position: relative;
}

.cp-status.is-active {
    color: #10b981;
}

.cp-status.is-active .status-dot {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.cp-status.is-expired-status {
    color: #f87171;
}

.cp-status.is-expired-status .status-dot {
    background: #f87171;
    box-shadow: 0 0 10px #f87171;
}

/* Special States */
.cp-card.is-sticky {
    border: 1.5px solid rgba(229, 169, 60, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.cp-sticky-badge {
    position: absolute;
    top: 14px;
    right: -32px; /* Đẩy ra ngoài để xoay tạo hiệu ứng cắt góc */
    width: 120px;
    background: linear-gradient(135deg, #FFDF73 0%, #E5A93C 100%);
    color: #111;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 4px 0;
    z-index: 10;
    text-transform: uppercase;
    transform: rotate(45deg); /* Xoay chéo */
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.cp-hot-badge {
    position: absolute;
    top: 0;
    right: 10px;
    /* Neo đúng vào cp-info nên cực kỳ an toàn */
    background: linear-gradient(to bottom, #ff416c, #ff4b2b) !important;
    color: #fff !important;
    width: 48px !important;
    height: 75px !important;
    z-index: 100 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding-top: 8px !important;
    text-transform: uppercase !important;
    line-height: 0.82 !important;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 93%, 0 100%);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)) !important;
    border: none !important;
}

.hot-top {
    margin-bottom: 5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.hot-bottom {
    font-size: 11px !important;
    font-weight: 900 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    letter-spacing: -0.2px !important;
    line-height: 1.1 !important;
    /* Tăng nhẹ để chữ không dính nhau */
}

.hot-l1 {
    margin-bottom: 0px !important;
}

.hot-l2 {
    margin-top: 0px !important;
}

.cp-icon-hot {
    display: inline-block !important;
    width: 22px !important;
    height: 22px !important;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNMTIgM3ExIDQgNCA2LjV0MyA1LjVhMSAxIDAgMCAxLTE0IDAgNSA1IDAgMCAxIDEtMyAxIDEgMCAwIDAgNSAwYzAtMi0xLjUtMy0xLjUtNXEwLTIgMi41LTQiLz48L3N2Zz4=');
    background-size: contain;
    background-repeat: no-repeat;
}

.cp-hot-badge.has-sticky {
    /* Đã ở trong cp-info nên không cần dịch chuyển nữa */
}

.cp-card.is-expired {
    filter: grayscale(1);
    opacity: 0.5;
    pointer-events: none;
}

.cp-expired-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    pointer-events: none;
}

.cp-expired-stamp {
    border: 3px solid #64748b;
    color: #64748b;
    padding: 5px 20px;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 900;
    transform: rotate(-15deg);
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.4);
}

/* Mobile Responsive */
@media (max-width: 850px) {
    .cp-card {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    .cp-brand {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding: 12px 20px;
        justify-content: flex-start;
    }

    .cp-logo {
        width: 44px;
        height: 44px;
    }

    .cp-offer-row {
        flex-direction: column;
        gap: 5px;
    }

    .cp-discount {
        font-size: 2rem;
    }

    .cp-action {
        border-left: none;
        border-top: 1px dashed rgba(255, 255, 255, 0.1);
    }
}

/* CP Pagination Nav - Modern & Beautiful */
.cp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
    position: relative;
    z-index: 9999;
    pointer-events: auto !important;
}

.cp-page-btn {
    min-width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--cp-text-dim);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 0.95rem;
}

.cp-page-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: #fff;
}

.cp-page-btn.active {
    background: linear-gradient(135deg, #FFDF73 0%, #E5A93C 100%);
    color: #111;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(229, 169, 60, 0.3);
    transform: scale(1.05);
}

.cp-empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--cp-text-dim);
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 1.2rem;
    grid-column: 1 / -1;
    width: 100%;
}