/* =====================================================
   Mobile Promotions Plugin — Frontend Stylesheet
   Brand Colors:
     AIS  (Green) : #82CF00
     TRUE (Red)   : #FF0000
     DTAC (Blue)  : #00A9E0
   ===================================================== */

/* ── Google Font ───────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@400;500;600;700&display=swap');

/* ── CSS Custom Properties ─────────────────────────── */
:root {
    --mp-font: 'IBM Plex Sans Thai', 'Sarabun', 'Noto Sans Thai', system-ui, sans-serif;
}

/* ── Base Wrapper ──────────────────────────────────── */
.mp-promotions,
.mp-all-wrap {
    --mp-primary:   #1e293b;
    --mp-dark:      #0f172a;
    --mp-light:     #f1f5f9;
    --mp-btn-text:  #fff;
    --mp-radius:    16px;
    --mp-shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
    font-family: var(--mp-font);
    box-sizing: border-box;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px;
}

*, *::before, *::after { box-sizing: inherit; }

/* ── Brand Theme Overrides (Correct Official Colors) ── */
.mp-theme-ais {
    --mp-primary: #82CF00;
    --mp-dark:    #6DB800;
    --mp-light:   #F2FAE6;
}
.mp-theme-true {
    --mp-primary: #FF0000;
    --mp-dark:    #D50000;
    --mp-light:   #FFF0F0;
}
.mp-theme-dtac {
    --mp-primary: #00A9E0;
    --mp-dark:    #0090C0;
    --mp-light:   #E6F6FC;
}

/* ══════════════════════════════════════════════════════
   OPERATOR TABS — ระดับ 1 (AIS / TRUE / DTAC)
   ══════════════════════════════════════════════════════ */
.mp-op-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    overflow-x: auto;
    background: #fff;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border-bottom: 2px solid #f0f0f0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mp-op-tabs::-webkit-scrollbar { display: none; }

.mp-op-tab {
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 16px 36px;
    font-size: 15px;
    font-family: var(--mp-font);
    font-weight: 700;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: color .25s ease, background .25s ease;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    flex-shrink: 0;
    letter-spacing: .01em;
}
.mp-op-tab:hover {
    color: var(--op-primary, #333);
    background: rgba(0,0,0,.02);
}
.mp-op-tab.active {
    color: var(--op-primary);
    border-bottom-color: var(--op-primary);
    background: var(--op-light, rgba(0,0,0,.02));
}
.mp-op-icon { font-size: 18px; line-height: 1; }

.mp-op-panel {
    padding: 28px 0 8px;
    animation: mp-slideUp .3s cubic-bezier(.22,1,.36,1);
}

/* ── Sub Tab Bar (ประเภทโปร) ────────────────────────── */
.mp-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding: 5px;
    background: #f3f4f6;
    border-radius: 12px;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.mp-tab {
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 13.5px;
    font-family: var(--mp-font);
    font-weight: 600;
    color: #6b7280;
    transition: all .25s cubic-bezier(.22,1,.36,1);
    white-space: nowrap;
    line-height: 1.4;
    letter-spacing: .01em;
}
.mp-tab:hover {
    background: rgba(0,0,0,.05);
    color: var(--mp-primary);
}
.mp-tab.active {
    background: var(--mp-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* ── Cards Grid ──────────────────────────────────────── */
.mp-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, 1fr);
}
.mp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.mp-cols-1 { grid-template-columns: 1fr; }

@media (max-width: 960px) {
    .mp-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (max-width: 600px) {
    .mp-grid { grid-template-columns: 1fr; gap: 16px; }
    .mp-tabs { width: 100%; border-radius: 12px; justify-content: stretch; }
    .mp-tab  { flex: 1; text-align: center; padding: 10px 12px; font-size: 13px; }
    .mp-promotions,
    .mp-all-wrap { padding: 0 12px; }
}

/* ── Card ────────────────────────────────────────────── */
.mp-card {
    background: #fff;
    border-radius: var(--mp-radius);
    box-shadow: var(--mp-shadow);
    border: 1px solid #eef0f4;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform .3s cubic-bezier(.22,1,.36,1),
                box-shadow .3s cubic-bezier(.22,1,.36,1);
    overflow: hidden;
    animation: mp-slideUp .35s cubic-bezier(.22,1,.36,1) backwards;
}
.mp-card:nth-child(1) { animation-delay: .0s; }
.mp-card:nth-child(2) { animation-delay: .06s; }
.mp-card:nth-child(3) { animation-delay: .12s; }
.mp-card:nth-child(4) { animation-delay: .18s; }
.mp-card:nth-child(5) { animation-delay: .24s; }
.mp-card:nth-child(6) { animation-delay: .30s; }

.mp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
}
.mp-card.mp-hidden { display: none; }

/* Card top accent bar */
.mp-card::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--mp-primary), var(--mp-dark));
    flex-shrink: 0;
}

/* Card inner padding */
.mp-card-header,
.mp-features,
.mp-card-footer {
    padding-left: 22px;
    padding-right: 22px;
}

/* Card header */
.mp-card-header {
    padding-top: 20px;
    padding-bottom: 0;
    margin-bottom: 14px;
}
.mp-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.45;
    letter-spacing: -.01em;
}

/* Badge */
.mp-badge {
    position: absolute;
    top: 4px;
    right: 16px;
    background: var(--mp-primary);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    font-family: var(--mp-font);
    padding: 4px 12px;
    border-radius: 0 0 8px 8px;
    letter-spacing: .04em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    z-index: 2;
}

/* Features list */
.mp-features {
    list-style: none;
    margin: 0 0 auto;
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mp-feature {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.55;
}
.mp-feat-icon {
    flex-shrink: 0;
    width: 18px;
    font-size: 13px;
    margin-top: 2px;
    text-align: center;
}
.mp-feature-speed        span:last-child { font-weight: 600; color: #1f2937; }
.mp-feature-after-speed  span:last-child { color: #6b7280; font-size: 12.5px; font-weight: 500; }
.mp-feature-call         span:last-child { color: #374151; }
.mp-feature-extra        span:last-child { color: #6b7280; }

/* ── Card Footer: Price + Button ─────────────────────── */
.mp-card-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 16px;
    padding-bottom: 20px;
    border-top: 1px solid #f3f4f6;
    gap: 12px;
    background: #fafbfc;
}

.mp-price-block {}
.mp-price-main {
    display: flex;
    align-items: baseline;
    gap: 3px;
}
.mp-price-num {
    font-size: 34px;
    font-weight: 800;
    color: var(--mp-primary);
    line-height: 1;
    letter-spacing: -.5px;
}
.mp-price-dec {
    font-size: 20px;
    font-weight: 700;
    color: var(--mp-primary);
    line-height: 1;
}
.mp-price-unit {
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    margin-left: 3px;
    align-self: flex-end;
    padding-bottom: 3px;
}
.mp-price-tax {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-top: 3px;
}

/* Subscribe Button */
.mp-btn-subscribe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mp-primary);
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 700;
    font-family: var(--mp-font);
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .25s cubic-bezier(.22,1,.36,1);
    box-shadow: 0 2px 8px rgba(0,0,0,.10);
    letter-spacing: .01em;
    position: relative;
    overflow: hidden;
}
.mp-btn-subscribe::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}
.mp-btn-subscribe:hover {
    background: var(--mp-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.mp-btn-subscribe:active {
    transform: translateY(0) scale(.97);
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/* ── Animations ──────────────────────────────────────── */
@keyframes mp-slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Admin style hint label ──────────────────────────── */
.mp-hint {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

/* ── Responsive — Operator Tabs ──────────────────────── */
@media (max-width: 600px) {
    .mp-op-tab {
        padding: 12px 20px;
        font-size: 13.5px;
    }
    .mp-op-panel {
        padding-top: 20px;
    }
    .mp-card-header,
    .mp-features,
    .mp-card-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    .mp-price-num { font-size: 28px; }
    .mp-btn-subscribe { padding: 10px 18px; font-size: 13px; }
}

/* ── Print-friendly ──────────────────────────────────── */
@media print {
    .mp-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
    .mp-op-tabs, .mp-tabs { display: none; }
}
