

.mm-share {
    --mm-share-size: 42px;
    --mm-share-gap: 10px;
    display: block;
}

.mm-share__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--mm-share-gap);
}

.mm-share__item {
    margin: 0;
    padding: 0;
    line-height: 0;
}

/* ---------- Nút ---------- */
.mm-share__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--mm-share-size);
    height: var(--mm-share-size);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--mm-brand, #6c757d);
    color: #fff;
    box-shadow: 0 3px 8px -2px rgba(0, 0, 0, .28);
    cursor: pointer;
    text-decoration: none;
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1),
                box-shadow .28s ease,
                background-color .28s ease;
}

.mm-share__btn svg {
    width: 54%;
    height: 54%;
    fill: currentColor;
    position: relative;
    z-index: 1;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1);
}

/* Zalo có wordmark bên trong -> phóng to hơn cho đọc được */
.mm-share__btn--zalo svg {
    width: 68%;
    height: auto;
}

/* Facebook/Zalo: dùng nguyên ảnh logo thật (đã có sẵn hình dạng/màu riêng)
   thay vì bọc icon svg trong nền tròn -> vẫn giữ vòng sáng lan ra + nhấc lên
   khi hover giống các nút khác (nền/::after dùng chung .mm-share__btn). */
.mm-share__btn--img {
    background: #fff;
}

.mm-share__btn--img img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1);
    border-radius: 50%;
}

.mm-share__btn--img:hover img,
.mm-share__btn--img:focus-visible img {
    transform: scale(1.08);
}

/* Vòng sáng lan ra khi hover */
.mm-share__btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--mm-brand, #6c757d);
    opacity: 0;
    transform: scale(.85);
    transition: transform .45s ease, opacity .45s ease;
    pointer-events: none;
}

.mm-share__btn:hover,
.mm-share__btn:focus-visible {
    transform: translateY(-5px);
    box-shadow: 0 12px 22px -6px color-mix(in srgb, var(--mm-brand, #6c757d) 75%, transparent),
                0 0 0 3px color-mix(in srgb, var(--mm-brand, #6c757d) 22%, transparent);
    outline: 0;
}

.mm-share__btn:hover svg,
.mm-share__btn:focus-visible svg {
    transform: scale(1.12);
}

.mm-share__btn:hover::after,
.mm-share__btn:focus-visible::after {
    opacity: .35;
    transform: scale(1.35);
}

.mm-share__btn:active {
    transform: translateY(-2px) scale(.94);
}

/* ---------- Tooltip ---------- */
.mm-share__tip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, 6px);
    padding: 4px 9px;
    border-radius: 6px;
    background: #1f2430;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 5;
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.mm-share__tip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -4px;
    border: 4px solid transparent;
    border-top-color: #1f2430;
}

.mm-share__btn:hover .mm-share__tip,
.mm-share__btn:focus-visible .mm-share__tip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* ---------- Màu thương hiệu ---------- */
.mm-share__btn--facebook  { --mm-brand: #1877f2; }
.mm-share__btn--zalo      { --mm-brand: #0d8bd9; }
.mm-share__btn--x         { --mm-brand: #14171a; }
.mm-share__btn--linkedin  { --mm-brand: #0a66c2; }
.mm-share__btn--telegram  { --mm-brand: #229ed9; }
.mm-share__btn--mail      { --mm-brand: #ea4335; }
.mm-share__btn--sms       { --mm-brand: #22c55e; }
.mm-share__btn--native    { --mm-brand: #64748b; }
.mm-share__btn--copy      { --mm-brand: #f59e0b; }
.mm-share__btn--more      { --mm-brand: #64748b; }

.mm-share__btn--messenger {
    --mm-brand: #a334fa;
    /* gradient nhận diện của Messenger */
    background-image: linear-gradient(45deg, #0695ff 0%, #a334fa 58%, #ff6699 100%);
}

/* ---------- Nút sao chép: 2 icon đổi trạng thái ---------- */
.mm-share__btn--copy .mm-share__ico-check {
    position: absolute;
    inset: 0;
    margin: auto;
    opacity: 0;
    transform: scale(.4) rotate(-25deg);
}

.mm-share__btn--copy.is-copied {
    background: #16a34a;
    box-shadow: 0 12px 22px -6px rgba(22, 163, 74, .7);
}

.mm-share__btn--copy.is-copied .mm-share__ico-link {
    opacity: 0;
    transform: scale(.4);
}

.mm-share__btn--copy.is-copied .mm-share__ico-check {
    opacity: 1;
    transform: scale(1) rotate(0);
}

.mm-share__btn--copy.is-copied .mm-share__tip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    background: #16a34a;
}

.mm-share__btn--copy.is-copied .mm-share__tip::after {
    border-top-color: #16a34a;
}

/* ---------- Nút "+" mở rộng ---------- */
.mm-share.is-open .mm-share__btn--more svg {
    transform: rotate(45deg);
}

.mm-share__item--more {
    display: none;
}

/* Bước 1: hiện chỗ (display) nhưng vẫn trong suốt */
.mm-share.is-open .mm-share__item--more {
    display: list-item;
    opacity: 0;
    transform: translateY(8px) scale(.85);
}

/* Bước 2: JS thêm class này 1 frame sau -> transition chạy mượt, so le theo --i */
@media (prefers-reduced-motion: no-preference) {
    .mm-share.is-open .mm-share__item--more {
        transition: opacity .3s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
        transition-delay: calc((var(--i, 0) - 3) * 45ms);
    }
}

.mm-share.is-open.is-animated .mm-share__item--more {
    opacity: 1;
    transform: none;
}

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

/* Mạng chỉ chạy trên mobile -> ẩn ở desktop (thắng cả khi đang mở rộng) */
@media (min-width: 992px) {
    .mm-share .mm-share__item[data-mobile],
    .mm-share.is-open .mm-share__item[data-mobile] {
        display: none;
    }
}

/* Ngược lại: chỉ hiện trên desktop -> ẩn ở mobile (VD: Zalo, vì mobile đã có
   sẵn Zalo trong nút "Chia sẻ khác" qua Web Share API của hệ điều hành) */
@media (max-width: 991.98px) {
    .mm-share .mm-share__item[data-desktop-only],
    .mm-share.is-open .mm-share__item[data-desktop-only] {
        display: none;
    }
}

@media (max-width: 767px) {
    .mm-share {
        --mm-share-size: 40px;
        --mm-share-gap: 8px;
    }

    /* Mobile không có hover -> bỏ tooltip cho gọn */
    .mm-share__tip {
        display: none;
    }
}

@media (max-width: 575px) {
    .mm-share {
        --mm-share-size: 38px;
        --mm-share-gap: 7px;
    }
}

/* ---------- Fallback cho trình duyệt không hỗ trợ color-mix ---------- */
@supports not (color: color-mix(in srgb, red 50%, transparent)) {
    .mm-share__btn:hover,
    .mm-share__btn:focus-visible {
        box-shadow: 0 12px 22px -6px rgba(0, 0, 0, .45);
    }
}

.detail-share-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

/* [Block share dùng chung - templates/layout/blocks/share.php] */
/* Nút mạng xã hội (.mm-share*) style trong assets/css/share.css */
.detail-share-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px;}
.detail-share-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;}
.detail-share-label { font-size: 15px; font-weight: 600; color: var(--text-main);}
.detail-share-views { display: flex; align-items: center; font-size: 14px; color: #8C8C8C; white-space: nowrap;}
/* [/Block share dùng chung] */
.mm-share__btn:hover {color: gold !important;}