/* ===== Share Widget ===== */
.share-widget {
    position: relative;
    display: inline-block;
}

.share-btn-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    background: #fff;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1;
}
.share-btn-trigger:hover {
    background: #f5f7fa;
    border-color: rgba(0,0,0,0.18);
    color: #333;
}
.share-btn-trigger:focus-visible {
    outline: 2px solid #1a6fc4;
    outline-offset: 2px;
    background: #f5f7fa;
    border-color: rgba(0,0,0,0.18);
}
.share-btn-trigger svg {
    flex-shrink: 0;
    opacity: 0.7;
}
.share-btn-trigger:hover svg {
    opacity: 1;
}

.share-popup {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 8px;
    z-index: 100;
    min-width: 160px;
    animation: sharePopIn 0.15s ease-out;
}
.share-popup.open {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
@keyframes sharePopIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.share-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    color: #333;
    transition: background 0.15s;
    white-space: nowrap;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}
.share-link:hover {
    background: #f0f4f8;
}
.share-link:focus-visible {
    outline: 2px solid #1a6fc4;
    outline-offset: -2px;
    background: #f0f4f8;
}

.share-vk  { color: #0077ff; }
.share-vk:hover { background: #e8f0ff; }
.share-tg  { color: #0088cc; }
.share-tg:hover { background: #e5f3ff; }
.share-wa  { color: #25d366; }
.share-wa:hover { background: #e8faf0; }
.share-copy { color: #666; }
.share-copy:hover { background: #f5f5f5; }
.share-copy.copied { color: #27ae60; }

/* Arrow */
.share-popup::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid rgba(0,0,0,0.08);
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* Inline variant — inside action bars */
.share-inline {
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
}
.share-inline .share-widget {
    vertical-align: middle;
}
.share-inline .share-btn-trigger {
    padding: 4px 8px;
    font-size: 11px;
    gap: 4px;
}
.share-inline .share-btn-trigger svg {
    width: 12px;
    height: 12px;
}
.share-inline .share-popup {
    left: auto;
    right: 0;
    transform: none;
}
.share-inline .share-popup::before {
    left: auto;
    right: 16px;
    transform: rotate(45deg);
}

/* Responsive */
@media (max-width: 480px) {
    .share-btn-trigger span {
        display: none;
    }
    .share-btn-trigger {
        padding: 6px;
        border-radius: 50%;
    }
    .share-popup {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: none;
        border-radius: 16px 16px 0 0;
        padding: 12px;
        animation: shareSlideUp 0.2s ease-out;
    }
    .share-popup::before { display: none; }
    .share-link { padding: 12px 16px; font-size: 15px; }
    @keyframes shareSlideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
}
