/* =====================================================
   Promotion Manager — promotion.css
   Version: 1.0.0
   ===================================================== */

/* ── Reset & Base ── */
.pm-archive-wrapper *,
.pm-single-wrapper * {
    box-sizing: border-box;
}

/* =====================================================
   ARCHIVE — Grid Layout
   ===================================================== */

.pm-archive-wrapper {
    padding: 8px 0 20px;
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 40px;
}

/* ── No Results ── */
.pm-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 15px;
}

/* =====================================================
   CARD
   ===================================================== */

.promo-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.promo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.13);
}

/* ── Expired State ── */
.promo-card.is-expired {
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
    cursor: default;
}

.promo-card.is-expired::before {
    content: 'ĐÃ KẾT THÚC';
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 15, 0.48);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 3px;
    border-radius: 14px;
}

/* ── Card Image ── */
.promo-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
}

.promo-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.38s ease;
}

.promo-card:hover .promo-card__image img {
    transform: scale(1.05);
}

.promo-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    font-size: 13px;
}

/* ── Card Body ── */
.promo-card__body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

/* ── Meta Row (Badge + Tags) ── */
.promo-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

/* ── Badges ── */
.promo-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.6;
}

.badge-active {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-upcoming {
    background: #fef9c3;
    color: #a16207;
    border: 1px solid #fde68a;
}

.badge-expired {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* ── Tags ── */
.promo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.promo-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Card Title ── */
.promo-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0;
    color: #111827;
}

.promo-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.promo-card__title a:hover {
    color: #2563eb;
}

/* ── Card Excerpt ── */
.promo-card__excerpt {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.65;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Card Dates ── */
.promo-card__dates {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #9ca3af;
    margin-top: auto;
}

.pm-icon {
    flex-shrink: 0;
    vertical-align: middle;
}

/* ── Card Actions ── */
.promo-card__actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.pm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.pm-btn--primary {
    background: #ee4d2d;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.pm-btn--primary:hover {
    background: #f05d40;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.36);
}

.pm-btn--primary svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.pm-btn--secondary {
    background: #f3f4f6;
    color: #374151 !important;
    border: 1px solid #e5e7eb;
}

.pm-btn--secondary:hover {
    background: #e5e7eb;
    color: #111827 !important;
}

.pm-btn--large {
    padding: 13px 28px;
    font-size: 15px;
    border-radius: 10px;
}

/* =====================================================
   PAGINATION
   ===================================================== */

.pm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 16px 0 44px;
}

.pm-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border: 1px solid #e5e7eb;
    line-height: 1;
}

.pm-pagination .page-numbers:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.pm-pagination .page-numbers.current {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    font-weight: 700;
}

.pm-pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    pointer-events: none;
}

/* =====================================================
   SINGLE PROMOTION
   ===================================================== */

.pm-single-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ── Banner ── */
.pm-single__banner {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 36px;
    aspect-ratio: 16 / 7;
    background: #FFFFFF;
}

.pm-single__banner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ── Container ── */
.pm-single__container {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* ── Meta ── */
.pm-single__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── Title ── */
.pm-single__title {
	text-align: center;
    font-size: 30px;
    font-weight: 800;
    color: #111827;
    line-height: 1.3;
    margin: 0;
}

/* ── Dates ── */
.pm-single__dates {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 16px 22px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #2563eb;
}

.pm-date-divider {
    color: #d1d5db;
    font-size: 20px;
    font-weight: 300;
}

.pm-date-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pm-date-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #9ca3af;
    font-weight: 600;
}

.pm-date-value {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

/* ── CTA ── */
.pm-single__cta {
	text-align: center;
    padding: 4px 0;
}

.pm-single__cta {
    width: 16px;
    height: 16px;
    fill: #fff;
}

/* ── Content ── */
.pm-single__content {
    font-size: 15px;
    line-height: 1.85;
    color: #374151;
    border-top: 1px solid #f3f4f6;
    padding-top: 28px;
}

.pm-single__content h2,
.pm-single__content h3,
.pm-single__content h4 {
    color: #111827;
    font-weight: 700;
    margin-top: 24px;
}

.pm-single__content img {
    max-width: 100%;
    border-radius: 8px;
}

.pm-single__content a {
    color: #2563eb;
    text-decoration: underline;
}

/* ── Back Link ── */
.pm-single__back {
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 960px) {
    .promo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .pm-single__title {
        font-size: 24px;
    }
}

@media (max-width: 600px) {
    .promo-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pm-single-wrapper {
        padding: 0 16px 60px;
    }

    .pm-single__title {
        font-size: 20px;
    }

    .pm-single__dates {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .pm-date-divider {
        display: none;
    }

    .pm-single__banner {
        border-radius: 10px;
        aspect-ratio: 16 / 9;
    }

    .promo-card__actions {
        flex-direction: column;
    }

    .pm-btn {
        width: 100%;
        justify-content: center;
    }
}