/*
 * Shared campaign pieces for the default / custom / national-day media page
 * themes: coupon tabs (pages linked to several coupons), the "not open yet /
 * ended" note and the featured product card. Colours come from the site
 * tokens (twelve-ui.css); the national-day theme maps them to its palette.
 */

[data-mp-campaign] {
    --mp-surface: var(--tw-surface, #fff);
    --mp-chip: var(--tw-surface2, #f7f7f8);
    --mp-ink: var(--tw-ink, #1c1b20);
    --mp-ink2: var(--tw-ink2, #77757d);
    --mp-line: var(--tw-line, #e9e8ec);
    --mp-accent: var(--tw-brand, #f5395f);
    --mp-accent-ink: #fff;
    --mp-gold: #ffb400;
    --mp-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.nd-page [data-mp-campaign] {
    --mp-surface: var(--nd-surface);
    --mp-chip: var(--nd-chip);
    --mp-ink: var(--nd-ink);
    --mp-ink2: var(--nd-ink2);
    --mp-line: var(--nd-soft);
    --mp-accent: var(--nd-brand);
    --mp-accent-ink: #0b100d;
    --mp-gold: var(--nd-gold);
    --mp-shadow: var(--nd-shadow2);
}

.mp-panel[hidden] {
    display: none;
}

/* ── Coupon tabs ────────────────────────────────────────────────── */

.mp-tabs {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

/* The tabs take over the negative offset that pulls the first card onto the hero. */
.media-page-content .mp-has-tabs .mp-tabs {
    margin-top: -125px;
}

.media-page-content .mp-has-tabs .countdown-section {
    margin-top: 0;
}

.nd-page .mp-has-tabs .mp-tabs {
    margin-top: -90px;
}

.nd-page .mp-has-tabs .nd-topcards {
    margin-top: 0;
}

.mp-tab {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 16px;
    border: 2px solid var(--mp-line);
    background: var(--mp-surface);
    color: var(--mp-ink);
    box-shadow: var(--mp-shadow);
    font-family: inherit;
    text-align: start;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}

.mp-tab:hover {
    transform: translateY(-2px);
}

.mp-tab.is-active {
    border-color: var(--mp-accent);
    background: var(--mp-accent);
    color: var(--mp-accent-ink);
}

.mp-tab__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.mp-tab__day {
    font-size: 13px;
    font-weight: 700;
}

.mp-tab__status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--mp-chip);
    color: var(--mp-ink2);
    white-space: nowrap;
}

.mp-tab--live .mp-tab__status {
    color: var(--mp-accent);
}

.mp-tab.is-active .mp-tab__status {
    background: rgba(255, 255, 255, 0.22);
    color: inherit;
}

.mp-tab__name,
.mp-tab__date {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-tab__name {
    font-size: 14px;
    font-weight: 700;
}

.mp-tab__date {
    font-size: 11px;
    opacity: 0.8;
}

/* ── Note ───────────────────────────────────────────────────────── */

.mp-note {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--mp-surface);
    border: 1.5px solid var(--mp-line);
    color: var(--mp-ink2);
    font-size: 14px;
    font-weight: 600;
}

/* ── Featured product ───────────────────────────────────────────── */

.mp-featured {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    margin-bottom: 32px;
    border-radius: 24px;
    overflow: hidden;
    background: var(--mp-surface);
    border: 2px solid var(--mp-line);
    box-shadow: var(--mp-shadow);
    color: var(--mp-ink);
}

.mp-featured__art {
    position: relative;
    min-height: 240px;
    background-color: var(--mp-chip);
    background-size: cover;
    background-position: center;
}

.mp-featured__badge,
.mp-featured__pct {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 99px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.mp-featured__badge {
    top: 14px;
    inset-inline-start: 14px;
    padding: 6px 12px;
    background: #fff;
    color: #1c1b20;
    font-size: 12px;
}

.mp-featured__badge i {
    color: var(--mp-gold);
}

.mp-featured__pct {
    bottom: 14px;
    inset-inline-end: 14px;
    padding: 8px 14px;
    background: var(--mp-accent);
    color: var(--mp-accent-ink);
    font-size: 18px;
    border-radius: 14px;
}

.mp-featured__pct small {
    font-size: 11px;
}

.mp-featured__body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.mp-featured__name {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--mp-ink);
}

.mp-featured__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 13px;
    color: var(--mp-ink2);
}

.mp-featured__meta b {
    color: var(--mp-ink);
}

.mp-featured__packs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.mp-pack {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 14px;
    border: 1.5px solid var(--mp-line);
    background: var(--mp-chip);
    color: var(--mp-ink);
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}

.mp-pack:hover {
    border-color: var(--mp-accent);
    color: var(--mp-ink);
    transform: translateY(-2px);
}

.mp-pack--best {
    border-color: var(--mp-gold);
}

.mp-pack__name {
    font-size: 13px;
    font-weight: 700;
}

.mp-pack__prices {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.mp-pack__prices b {
    font-size: 15px;
}

.mp-pack__prices s {
    font-size: 11.5px;
    color: var(--mp-ink2);
}

.mp-pack__pct {
    font-size: 11px;
    font-weight: 700;
    color: var(--mp-accent);
}

.mp-pack__best {
    position: absolute;
    top: -9px;
    inset-inline-end: 10px;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--mp-gold);
    color: #1c1b20;
    font-size: 10px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .media-page-content .mp-has-tabs .mp-tabs {
        margin-top: -100px;
    }

    .mp-tabs {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }

    .mp-tab {
        padding: 10px;
    }

    .mp-featured {
        grid-template-columns: 1fr;
    }

    .mp-featured__art {
        min-height: 200px;
    }

    .mp-featured__packs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .media-page-content .mp-has-tabs .mp-tabs {
        margin-top: -70px;
    }
}

/* ── Hidden code (closed / not yet open tab on a multi-tab page) ── */

/* A random placeholder, blurred: the real code is never in the page. */
.mp-code-blur {
    filter: blur(5px);
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    letter-spacing: 2px;
}

.mp-code-card--hidden,
.rf-code--hidden {
    cursor: not-allowed;
    opacity: 0.85;
}

.mp-code-card--hidden button:disabled,
.rf-code--hidden .rf-code__copy {
    cursor: not-allowed;
    opacity: 0.7;
}

/* ── Tab not open yet: blurred layout under a lock (multi-tab pages) ── */

.mp-concealed {
    position: relative;
    z-index: 3;
}

.mp-concealed__content {
    filter: blur(7px);
    opacity: 0.75;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.mp-concealed__overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding-top: 80px;
    color: var(--mp-ink);
    font-size: 16px;
    text-align: center;
    pointer-events: none;
}

.mp-concealed__overlay i {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--mp-surface);
    border: 2px solid var(--mp-line);
    box-shadow: var(--mp-shadow);
    color: var(--mp-accent);
    font-size: 22px;
}

.mp-concealed__overlay b {
    padding: 8px 16px;
    border-radius: 99px;
    background: var(--mp-surface);
    box-shadow: var(--mp-shadow);
}

/* Image areas of the placeholder layout. */
.mp-skeleton-block {
    background: var(--mp-chip) !important;
}
