/* Magicshine Addons */
:root {
    --msa-brand: #ff4b14;
    --msa-brand-dark: #d93a08;
    --msa-brand-soft: #fff4ef;
    --msa-zalo: #0068ff;
    --msa-text: #222;
    --msa-muted: #666;
    --msa-border: #e6e6e6;
    --msa-bg-soft: #f7f7f7;
    --msa-radius: 8px;
}

/* Buttons */
.msa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 5px;
    border: 2px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    text-transform: none;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
}
.msa-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.msa-btn-primary { background: var(--msa-brand); color: #fff !important; }
.msa-btn-primary:hover, .msa-btn-primary:focus { background: var(--msa-brand-dark); color: #fff !important; }
.msa-btn-zalo { background: var(--msa-zalo); color: #fff !important; }
.msa-btn-zalo:hover, .msa-btn-zalo:focus { background: #0052cc; color: #fff !important; }
.msa-btn-outline { background: transparent; color: var(--msa-brand) !important; border-color: var(--msa-brand); }
.msa-btn-outline:hover, .msa-btn-outline:focus { background: var(--msa-brand); color: #fff !important; }
.msa-btn-sm { padding: 8px 12px; font-size: 14px; }
.msa-badge {
    display: inline-block;
    background: var(--msa-brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.msa-notice { padding: 12px 14px; border: 1px dashed #bbb; border-radius: 6px; background: #fafafa; color: #555; font-size: 14px; }

/* Reset theme button styles on our own buttons */
.msa-share .msa-share-btn,
.msa-nav .msa-nav-btn,
.msa-toc .msa-toc-toggle,
.msa-popup .msa-popup-close {
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    min-height: 0;
    min-width: 0;
    margin: 0;
}

/* Countdown */
.msa-cd-items { display: flex; flex-wrap: wrap; gap: 10px; }
.msa-cd-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 68px;
    padding: 10px 8px;
    border-radius: var(--msa-radius);
    background: #111;
    color: #fff;
    text-align: center;
}
.msa-cd-num { font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.msa-cd-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.msa-cd-expired { margin-top: 8px; font-weight: 600; }
.msa-countdown.msa-hide .msa-cd-items { display: none; }
@media (max-width: 480px) {
    .msa-cd-item { min-width: 56px; }
    .msa-cd-num { font-size: 24px; }
}

/* Carousel (shared) */
[data-msa-carousel] { position: relative; }
.msa-nav .msa-nav-btn {
    position: absolute;
    top: 38%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--msa-border);
    border-radius: 50%;
    background: #fff;
    color: #222;
    font-size: 26px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    cursor: pointer;
    transition: opacity .2s;
}
.msa-nav .msa-prev { left: -8px; }
.msa-nav .msa-next { right: -8px; }
.msa-nav .msa-nav-btn[disabled] { opacity: 0; pointer-events: none; }
.msa-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 8px;
}
.msa-track::-webkit-scrollbar { display: none; }
.msa-track > * {
    flex: 0 0 calc((100% - (var(--msa-cols, 3) - 1) * 16px) / var(--msa-cols, 3));
    min-width: 0;
    scroll-snap-align: start;
}
@media (max-width: 767px) {
    .msa-track > * { flex-basis: calc((100% - (var(--msa-cols-m, 1) - 1) * 16px) / var(--msa-cols-m, 1)); }
    .msa-nav .msa-nav-btn { width: 34px; height: 34px; font-size: 22px; }
}

/* Products */
.msa-products ul.products::before,
.msa-products ul.products::after { display: none !important; content: none !important; }
.msa-products ul.products,
.msa-products ul.products li.product { list-style: none !important; }
.msa-products ul.products li.product::marker { content: none; }
.msa-products ul.products li.product {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}
.msa-layout-grid ul.products {
    display: grid !important;
    grid-template-columns: repeat(var(--msa-cols, 4), minmax(0, 1fr));
    gap: 24px 16px;
    margin: 0 !important;
    padding: 0 !important;
}
.msa-layout-carousel ul.products {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    margin: 0 !important;
    padding: 2px 2px 8px !important;
}
.msa-layout-carousel ul.products::-webkit-scrollbar { display: none; }
.msa-layout-carousel ul.products li.product {
    flex: 0 0 calc((100% - (var(--msa-cols, 4) - 1) * 16px) / var(--msa-cols, 4)) !important;
    scroll-snap-align: start;
}
@media (max-width: 1024px) {
    .msa-layout-grid ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .msa-layout-carousel ul.products li.product { flex-basis: calc((100% - 2 * 16px) / 3) !important; }
}
@media (max-width: 767px) {
    .msa-layout-grid ul.products { grid-template-columns: repeat(var(--msa-cols-m, 2), minmax(0, 1fr)); gap: 16px 12px; }
    .msa-layout-carousel ul.products { gap: 12px; }
    .msa-layout-carousel ul.products li.product { flex-basis: calc((100% - (var(--msa-cols-m, 2) - 1) * 12px) / var(--msa-cols-m, 2)) !important; }
}

/* Share */
.msa-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.msa-share-label { margin-right: 4px; font-weight: 600; }
.msa-share .msa-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--msa-border);
    border-radius: 5px;
    background: #fff;
    color: #333 !important;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
}
.msa-share .msa-share-btn svg { width: 16px; height: 16px; }
.msa-share .msa-share-btn:hover { background: var(--msa-bg-soft); }
.msa-share .msa-share-zalo { color: var(--msa-zalo) !important; border-color: #cfe0ff; }
.msa-share .msa-share-fb { color: #1877f2 !important; border-color: #d4e3fb; }
.msa-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 100000;
    max-width: 90vw;
    padding: 10px 16px;
    border-radius: 6px;
    background: #222;
    color: #fff;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity .2s;
}
.msa-toast.is-show { opacity: 1; }

/* Call-to-action */
.msa-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    padding: 24px;
    border-radius: var(--msa-radius);
}
.msa-cta-brand { background: var(--msa-brand-soft); border: 1px solid #ffd8c9; }
.msa-cta-light { background: var(--msa-bg-soft); border: 1px solid var(--msa-border); }
.msa-cta-dark { background: #151515; color: #fff; }
.msa-cta-dark .msa-cta-title, .msa-cta-dark .msa-cta-text { color: #fff; }
.msa-cta-column { flex-direction: column; text-align: center; }
.msa-cta-body { flex: 1 1 320px; min-width: 0; }
.msa-cta-column .msa-cta-body { flex-basis: auto; }
.msa-cta-title { margin: 0 0 6px; font-size: 22px; font-weight: 700; line-height: 1.3; }
.msa-cta-text p { margin: 0 0 6px; }
.msa-cta-text p:last-child { margin-bottom: 0; }
.msa-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.msa-cta-column .msa-cta-actions { justify-content: center; }
@media (max-width: 600px) {
    .msa-cta { padding: 18px; }
    .msa-cta-actions { width: 100%; }
    .msa-cta-actions .msa-btn { flex: 1 1 100%; }
}

/* Featured product box */
.msa-pbox {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    border: 1px solid var(--msa-border);
    border-radius: var(--msa-radius);
    background: #fff;
}
.msa-pbox-column { flex-direction: column; text-align: center; }
.msa-pbox-media { flex: 0 0 38%; max-width: 38%; }
.msa-pbox-column .msa-pbox-media { flex-basis: auto; max-width: 100%; }
.msa-pbox-media img { display: block; width: 100%; height: auto; border-radius: 6px; }
.msa-pbox-info { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.msa-pbox-column .msa-pbox-info { align-items: center; }
.msa-pbox-title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.3; }
.msa-pbox-title a { color: inherit; text-decoration: none; }
.msa-pbox-title a:hover { color: var(--msa-brand); }
.msa-pbox-price { color: var(--msa-brand); font-size: 20px; font-weight: 700; }
.msa-pbox-price del { margin-right: 6px; color: #999; font-size: .8em; font-weight: 400; }
.msa-pbox-price ins { text-decoration: none; }
.msa-pbox-bullets { margin: 0; padding-left: 20px; text-align: left; }
.msa-pbox-bullets li { margin: 3px 0; }
.msa-pbox-stock { color: #b00020; font-weight: 600; }
.msa-pbox-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.msa-pbox .added_to_cart { margin-left: 4px; font-weight: 600; }
@media (max-width: 767px) {
    .msa-pbox { flex-direction: column; align-items: stretch; padding: 16px; }
    .msa-pbox-media { flex-basis: auto; max-width: 100%; }
    .msa-pbox-actions .msa-btn { flex: 1 1 auto; }
}

/* Comparison table */
.msa-compare { margin: 8px 0 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.msa-compare table { width: 100%; min-width: 520px; border-collapse: collapse; table-layout: fixed; font-size: 15px; }
.msa-compare th,
.msa-compare td { padding: 10px; border: 1px solid var(--msa-border); text-align: center; vertical-align: middle; }
.msa-compare thead th { background: #fff; vertical-align: top; }
.msa-compare tbody th { width: 24%; background: var(--msa-bg-soft); font-weight: 600; text-align: left; }
.msa-compare .msa-compare-corner { width: 24%; background: #fff; border-top-color: transparent; border-left-color: transparent; }
.msa-compare tbody th,
.msa-compare .msa-compare-corner { position: sticky; left: 0; z-index: 1; }
.msa-compare-head { display: flex; flex-direction: column; align-items: center; gap: 8px; color: inherit; font-weight: 600; text-decoration: none; }
.msa-compare-head img { width: 110px; height: 110px; object-fit: contain; }
.msa-compare .msa-badge { margin-top: 6px; }
.msa-compare-price td { color: var(--msa-brand); font-weight: 700; }
.msa-compare-price del { display: block; color: #999; font-size: .85em; font-weight: 400; }
.msa-compare-price ins { text-decoration: none; }
@media (max-width: 767px) {
    .msa-compare table { font-size: 14px; }
    .msa-compare-head img { width: 80px; height: 80px; }
}

/* Posts grid */
.msa-posts { display: grid; grid-template-columns: repeat(var(--msa-cols, 3), minmax(0, 1fr)); gap: 24px; }
.msa-post { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--msa-border); border-radius: var(--msa-radius); background: #fff; }
.msa-post-media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.msa-post-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.msa-post-date { color: var(--msa-muted); font-size: 13px; }
.msa-post-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.35; }
.msa-post-title a { color: inherit; text-decoration: none; }
.msa-post-title a:hover { color: var(--msa-brand); }
.msa-post-excerpt { margin: 0; color: #444; font-size: 15px; line-height: 1.55; }
@media (max-width: 1024px) { .msa-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .msa-posts { grid-template-columns: 1fr; } }

/* Table of contents */
.msa-toc { margin: 8px 0 20px; padding: 14px 18px; border: 1px solid var(--msa-border); border-radius: var(--msa-radius); background: var(--msa-bg-soft); }
.msa-toc[hidden] { display: none; }
.msa-toc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.msa-toc-title { font-size: 17px; font-weight: 700; }
.msa-toc .msa-toc-toggle { padding: 4px 0; border: 0; background: none; color: var(--msa-brand); font-size: 14px; font-weight: 600; cursor: pointer; }
.msa-toc-list,
.msa-toc-list ol { margin: 10px 0 0; padding-left: 22px; }
.msa-toc-list ol { margin-top: 4px; }
.msa-toc-list li { margin: 5px 0; line-height: 1.45; }
.msa-toc-list a { color: inherit; text-decoration: none; }
.msa-toc-list a:hover { color: var(--msa-brand); text-decoration: underline; }
.msa-toc.is-collapsed .msa-toc-list { display: none; }

/* Testimonials */
.msa-tcard { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 20px; border: 1px solid var(--msa-border); border-radius: var(--msa-radius); background: #fff; }
.msa-stars { color: #f5a623; font-size: 16px; letter-spacing: 2px; }
.msa-stars-off { color: #ddd; }
.msa-tcard .msa-t-text { flex: 1 1 auto; margin: 0; padding: 0; border: 0; background: none; color: #333; font-size: 15px; font-style: normal; line-height: 1.6; }
.msa-tcard .msa-t-text::before,
.msa-tcard .msa-t-text::after { display: none; content: none; }
.msa-t-author { display: flex; align-items: center; gap: 10px; }
.msa-t-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.msa-t-author small { display: block; color: var(--msa-muted); font-size: 13px; }

/* Popup */
.msa-popup { position: fixed; inset: 0; z-index: 99990; display: flex; align-items: center; justify-content: center; padding: 16px; }
.msa-popup[hidden] { display: none; }
.msa-popup-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.msa-popup-box {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
    animation: msa-pop .25s ease-out;
}
@keyframes msa-pop {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.msa-popup-media img { display: block; width: 100%; height: auto; border-radius: 12px 12px 0 0; }
.msa-popup-body { padding: 22px 22px 24px; text-align: center; }
.msa-popup-title { margin-bottom: 8px; font-size: 22px; font-weight: 700; line-height: 1.3; color: var(--msa-text); }
.msa-popup-content { color: #444; font-size: 15px; line-height: 1.6; }
.msa-popup-content p { margin: 0 0 8px; }
.msa-popup-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.msa-popup .msa-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.msa-popup.msa-popup--bar { inset: auto 0 0 0; display: block; padding: 0; }
.msa-popup--bar .msa-popup-overlay,
.msa-popup--bar .msa-popup-media,
.msa-popup--bar .msa-popup-content,
.msa-popup--bar .msa-popup-actions .msa-btn-outline { display: none; }
.msa-popup--bar .msa-popup-box { max-width: none; border-radius: 12px 12px 0 0; box-shadow: 0 -6px 20px rgba(0, 0, 0, .18); }
.msa-popup--bar .msa-popup-body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 48px 14px 14px; text-align: left; }
.msa-popup--bar .msa-popup-title { flex: 1 1 160px; margin: 0; font-size: 16px; }
.msa-popup--bar .msa-popup-actions { margin: 0; }
.msa-popup--bar .msa-btn { padding: 9px 14px; font-size: 14px; }
html.msa-bar-open .group-cta-mb,
html.msa-bar-open .go-to-top { translate: 0 calc(-1 * var(--msa-bar-h, 64px)); transition: translate .25s ease; }
