/* ============================================
   COMPONENTS — Reusable UI Elements
   ============================================ */

/* ── Buttons ──────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: var(--text-sm);
    white-space: nowrap;
    transition: all var(--duration) var(--ease-out);
    cursor: pointer;
    border: none;
    line-height: 1;
}
.btn:hover { transform: translateY(-1px); }

.btn-red       { background: var(--cta); color: #fff; }
.btn-red:hover { background: var(--cta-dark); box-shadow: 0 4px 12px rgba(212,88,58,0.25); }

.btn-green       { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(0.9); }

.btn-gold       { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; }
.btn-gold:hover { filter: brightness(1.1); }

.btn-outline       { background: transparent; border: 1.5px solid var(--border); color: var(--warm-gray); }
.btn-outline:hover { border-color: var(--dark); color: var(--dark); }

.btn-sm   { padding: 6px 14px; font-size: 12px; }
.btn-lg   { padding: 14px 28px; font-size: var(--text-base); border-radius: var(--radius-md); }
.btn-full { width: 100%; }

/* ── Sim Card ─────────────────────────────────── */
.sim-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--duration) var(--ease-out);
}
.sim-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.sim-card__badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.3px;
}
.badge--vip  { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; }
.badge--hot  { background: var(--cta); color: #fff; }
.badge--sale { background: var(--green); color: #fff; }

.sim-card__main {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 8px;
}
.sim-card__carrier-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sim-card__carrier-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}
.sim-card__carrier-abbr {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}
.sim-card__info {
    flex: 1;
    min-width: 0;
}

.sim-card__number {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--dark);
    margin-bottom: 4px;
}

.sim-card__meaning {
    font-size: var(--text-xs);
    color: var(--warm-gray);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sim-card__price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 14px;
}

.sim-card__price {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--cta);
}

.sim-card__price-old {
    font-size: var(--text-sm);
    color: var(--warm-gray);
    text-decoration: line-through;
}

.sim-card__actions {
    display: flex;
    gap: var(--space-sm);
}

/* ── Sim Table Row (compact view) ─────────────── */
.sim-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: center;
    gap: var(--space-md);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.sim-row:last-child { border-bottom: none; }

.sim-row__number {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-base);
    letter-spacing: 0.5px;
}
.sim-row__carrier { font-size: var(--text-sm); color: var(--warm-gray); }
.sim-row__price   { font-weight: 700; color: var(--cta); }

/* ── Search Bar ───────────────────────────────── */
.search-bar {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1.5px solid var(--border);
    transition: border-color var(--duration);
}
.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27,42,74,0.08);
}
.search-bar__input {
    flex: 1;
    padding: 16px 20px;
    font-size: var(--text-base);
    background: transparent;
}
.search-bar__input::placeholder { color: var(--warm-gray); }
.search-bar__btn {
    padding: 16px 28px;
    background: linear-gradient(135deg, var(--cta), var(--cta-dark));
    color: #fff;
    font-weight: 700;
    font-size: var(--text-base);
    transition: filter var(--duration);
}
.search-bar__btn:hover { filter: brightness(1.1); }

.search-bar--hero {
    border: none;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(27,42,74,0.08);
    max-width: 560px;
    margin: 0 auto;
}

/* ── Search Hints ─────────────────────────────── */
.search-hints {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-md);
}
.search-hint {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all var(--duration);
}
.search-hint:hover {
    background: rgba(196,148,90,0.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Filter Chip ──────────────────────────────── */
.filter-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration);
    font-weight: 600;
    font-size: 14px;
}
.filter-chip:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.filter-chip__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.chip-red   { background: var(--cta-light); }
.chip-gold  { background: var(--accent-light); }
.chip-green { background: var(--green-light); }
.chip-blue  { background: var(--blue-light); }

/* ── Form Inputs ──────────────────────────────── */
.form-group { margin-bottom: var(--space-md); }
.form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    transition: border-color var(--duration);
    background: var(--white);
}
.form-input:focus { border-color: var(--primary); }

.form-select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    background: var(--white) url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color var(--duration) var(--ease-out);
}
.form-select:focus {
    border-color: var(--primary);
    outline: none;
}

/* ── Focus states for all interactive elements ── */
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── Badge / Status ───────────────────────────── */
.status-badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
}
.status--success { background: var(--green-light); color: var(--green); }
.status--warning { background: var(--orange-light); color: var(--orange); }
.status--danger  { background: var(--red-light); color: var(--red); }

/* ── FOMO Badge ───────────────────────────────── */
.fomo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--orange-light);
    color: var(--orange);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 600;
    animation: fomoPulse 2s infinite;
}
@keyframes fomoPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ── Trust Item ───────────────────────────────── */
.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--charcoal);
}
.trust-item__icon {
    width: 42px;
    height: 42px;
    background: var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Carrier Card ─────────────────────────────── */
.carrier-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all var(--duration);
}
.carrier-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.carrier-card__logo { font-size: 36px; margin-bottom: 12px; }
.carrier-card h3    { font-weight: 700; margin-bottom: 4px; }
.carrier-card p     { font-size: var(--text-sm); color: var(--warm-gray); }

/* ── Floating Chat ────────────────────────────── */
.float-chat {
    position: fixed;
    bottom: 80px;
    right: 16px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-btn {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: btnShake 4s ease-in-out infinite;
}
/* Pulsing ripple rings behind each button */
.chat-btn::before,
.chat-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    z-index: -1;
    animation: btnRipple 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.chat-btn::after { animation-delay: 1.1s; }
.chat-btn:hover {
    transform: scale(1.1);
    animation-play-state: paused;
}
.chat-btn:hover::before,
.chat-btn:hover::after { animation-play-state: paused; }

.chat-btn--zalo {
    background: var(--zalo);
    color: #fff;
}
.chat-btn--zalo:hover {
    box-shadow: 0 4px 20px rgba(0,145,255,0.4);
}
.chat-btn--phone {
    background: var(--cta);
    color: #fff;
    animation-delay: 0.4s;
}
.chat-btn--phone:hover {
    box-shadow: 0 4px 20px rgba(212,88,58,0.4);
}

@keyframes btnShake {
    0%, 30%, 100% { transform: rotate(0deg); }
    33%  { transform: rotate(10deg); }
    36%  { transform: rotate(-8deg); }
    39%  { transform: rotate(6deg); }
    42%  { transform: rotate(-4deg); }
    45%  { transform: rotate(2deg); }
}

@keyframes btnRipple {
    0%   { transform: scale(1);   opacity: 0.55; }
    100% { transform: scale(1.9); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .chat-btn,
    .chat-btn::before,
    .chat-btn::after { animation: none; }
}

/* ── Popup / Modal ────────────────────────────── */
.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.popup-overlay.is-active { display: flex; }

.popup {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 440px;
    width: 90%;
    position: relative;
    animation: popIn 0.3s var(--ease-out);
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--light-bg);
    border-radius: 50%;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ── Popup Payment Options ────────────────────── */
.popup-payment-options {
    display: flex;
    gap: 10px;
    margin-bottom: var(--space-md);
}
.popup-payment-options .option-card {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}
.popup-payment-options .option-card.is-selected {
    border-color: var(--primary);
    background: var(--primary-subtle);
}
.popup-payment-options .option-card h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}
.popup-payment-options .option-card p {
    font-size: 11px;
    color: var(--warm-gray);
    margin: 0;
}
.option-card__icon {
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
}
.option-card--tragop {
    border-color: var(--green) !important;
    transition: all 0.2s;
}
.option-card--tragop:hover {
    background: rgba(27, 140, 78, 0.06);
    border-color: var(--green);
}
@media (max-width: 480px) {
    .popup-payment-options .option-card {
        padding: 10px 6px;
    }
}

/* ── Section Headers ──────────────────────────── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--space-lg);
}
.section-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
}
.section-subtitle {
    color: var(--warm-gray);
    font-size: 14px;
    margin-top: 4px;
}
.section-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}
.section-link:hover { text-decoration: underline; }

/* ── 404 Page ────────────────────────────────── */
.error-404 {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.error-404__icon { font-size: 80px; margin-bottom: 16px; }
.error-404__title { font-size: 36px; font-weight: 800; margin-bottom: 12px; }
.error-404__desc { font-size: 16px; color: var(--warm-gray); margin-bottom: 24px; }
.error-404__search { max-width: 400px; margin: 0 auto 20px; }
.error-404__links { margin-top: 32px; text-align: left; }
.error-404__links-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; text-align: center; }
.error-404__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.error-404__group h3 { font-size: 14px; font-weight: 700; color: var(--green, #22c55e); margin-bottom: 8px; }
.error-404__group ul { list-style: none; padding: 0; margin: 0; }
.error-404__group li { margin-bottom: 6px; }
.error-404__group a { font-size: 13px; color: var(--text, #334155); text-decoration: none; }
.error-404__group a:hover { color: var(--green, #22c55e); text-decoration: underline; }
@media (max-width: 480px) { .error-404__grid { grid-template-columns: 1fr; } }

/* ── Page Card ───────────────────────────────── */
.page-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.page-card__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ── Blog Article ────────────────────────────── */
.blog-article {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.blog-article__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}
.blog-article__meta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 16px;
}
.blog-article__thumb { margin-bottom: 16px; }
.blog-article__img { width: 100%; height: auto; border-radius: 4px; }
.blog-article__tags {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.blog-article__tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.blog-article__tag {
    padding: 4px 12px;
    background: var(--cream);
    border-radius: 3px;
    font-size: 12px;
    color: var(--warm-gray);
}
.blog-article__tag:hover { color: var(--dark); }

/* ── FAQ Accordion ──────────────────────────── */
.faq-section {
    margin-top: 14px;
}
.faq-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    background: var(--white);
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.faq-item:last-child { margin-bottom: 0; }
.faq-item.is-open {
    border-color: var(--green);
    box-shadow: 0 2px 12px rgba(46, 125, 91, 0.08);
}
.faq-item__q {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    text-align: left;
    line-height: 1.5;
}
.faq-item__q:hover {
    background: var(--light-bg);
}
.faq-item__q::before {
    content: 'Q';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    min-width: 26px;
    background: var(--green);
    color: var(--white);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
}
.faq-item.is-open .faq-item__q::before {
    background: var(--green-dark);
}
.faq-item__q::after {
    content: '';
    margin-left: auto;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.25s ease;
}
.faq-item.is-open .faq-item__q::after {
    transform: rotate(180deg);
}
.faq-item__a-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease;
}
.faq-item.is-open .faq-item__a-wrap {
    grid-template-rows: 1fr;
}
.faq-item__a {
    overflow: hidden;
    font-size: 13px;
    line-height: 1.7;
    color: var(--charcoal);
    margin: 0;
}
.faq-item__a-inner {
    padding: 0 16px 16px 52px;
}
.faq-item__a-inner a {
    color: var(--green);
    font-weight: 600;
}
.faq-item__a-inner a:hover {
    text-decoration: underline;
}

/* Legacy inst-faq alias */
.inst-faq { margin-top: 14px; }

/* ── Entry Content ───────────────────────────── */
.entry-content { font-size: 15px; line-height: 1.8; color: var(--charcoal); }
