/* ==========================================================================
   Custom Share Widget — Frontend Styles v1.1.0
   ========================================================================== */

/* ── Wrapper ───────────────────────────────────────────────────────────── */
.csw-wrapper {
    position: relative;
    display: inline-block;
}

/* ── Share Button ──────────────────────────────────────────────────────── */
.csw-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #1a1a2e;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1;
    transition:
        background  0.25s ease,
        border-color 0.25s ease,
        transform   0.2s ease,
        box-shadow  0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.csw-share-btn:hover,
.csw-share-btn:focus-visible {
    background: #16213e;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    outline: none;
}

.csw-share-btn:active {
    transform: translateY(0);
}

/* Slide-in label on hover */
.csw-share-label {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    transition:
        max-width 0.35s ease,
        opacity   0.25s ease;
    display: inline-block;
}

.csw-wrapper:hover .csw-share-label,
.csw-share-btn:focus-visible .csw-share-label {
    max-width: 120px;
    opacity: 1;
}

.csw-share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Overlay (backdrop) ────────────────────────────────────────────────── */
.csw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: csw-fade-in 0.2s ease;
}

.csw-overlay.csw-active {
    display: block;
}

/* ── Popup ─────────────────────────────────────────────────────────────── */
.csw-popup {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 320px;
    max-width: 90vw;
}

.csw-popup.csw-active {
    display: block;
    animation: csw-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Mobile: full-width sheet from bottom */
@media (max-width: 480px) {
    .csw-popup {
        bottom: 0;
        left:  0;
        right: 0;
        transform: none;
        max-width: 100vw;
        min-width: 0;
    }

    .csw-popup-inner {
        border-radius: 20px 20px 0 0 !important;
    }
}

.csw-popup-inner {
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 20px;
    padding: 20px 22px 22px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ── Popup Header ──────────────────────────────────────────────────────── */
.csw-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.csw-popup-header > span {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.2px;
}

/* ── Close Button (×) ──────────────────────────────────────────────────── */
.csw-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 50%;
    color: #aaa;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color      0.2s ease,
        transform  0.25s ease,
        border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.csw-close-btn:hover,
.csw-close-btn:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: rotate(90deg);
    outline: none;
}

.csw-close-btn:active {
    transform: rotate(90deg) scale(0.9);
}

/* ── Items Grid ────────────────────────────────────────────────────────── */
.csw-items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* ── Share Item ────────────────────────────────────────────────────────── */
.csw-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 10px 8px;
    border-radius: 14px;
    min-width: 68px;
    cursor: pointer;
    border: 1px solid transparent;
    transition:
        background    0.2s ease,
        border-color  0.2s ease,
        transform     0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.csw-item:hover,
.csw-item:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.10);
    transform: translateY(-2px);
    outline: none;
}

.csw-item:active {
    transform: translateY(0) scale(0.94);
}

/* Icon circle */
.csw-item-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition:
        background 0.2s ease,
        transform  0.2s ease;
    overflow: hidden;
}

.csw-item:hover .csw-item-icon {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.08);
}

/* Icon SVG — size controlled by Elementor slider or default */
.csw-item-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
}

.csw-item-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

/* Label */
.csw-item-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

/* ── Toast ─────────────────────────────────────────────────────────────── */
.csw-toast {
    display: none;
    margin-top: 14px;
    padding: 9px 14px;
    background: rgba(39, 174, 96, 0.12);
    border: 1px solid rgba(39, 174, 96, 0.35);
    border-radius: 10px;
    color: #2ecc71;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    animation: csw-fade-in 0.2s ease;
}

.csw-toast.csw-active {
    display: block;
}

/* ── Animations ────────────────────────────────────────────────────────── */
@keyframes csw-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes csw-slide-up {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 480px) {
    @keyframes csw-slide-up {
        from {
            opacity: 0;
            transform: translateY(36px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}
