/**
 * Share Popup + Gallery Action Buttons
 * @package Drewniane
 */

/* ============================================
   GALLERY ACTION BUTTONS (Share + Wishlist)
   ============================================ */

.gallery-action-buttons {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-product-btn,
.wishlist-product-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-product-btn:hover,
.wishlist-product-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-product-btn:focus-visible,
.wishlist-product-btn:focus-visible {
    outline: 2px solid var(--color-primary, #8b5a2b);
    outline-offset: 2px;
}

.wishlist-product-btn.is-active svg {
    fill: #ef4444;
    stroke: #ef4444;
}

.wishlist-product-btn.is-active:hover svg {
    fill: #dc2626;
    stroke: #dc2626;
}

/* ============================================
   SHARE POPUP OVERLAY
   ============================================ */

.share-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.share-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   SHARE POPUP CARD
   ============================================ */

.share-popup {
    position: relative;
    width: 90%;
    max-width: 400px;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.share-popup-overlay.active .share-popup {
    transform: scale(1) translateY(0);
}

.share-popup h4 {
    margin: 0 0 20px 0;
    padding: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
}

.share-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-popup-close:hover {
    background: #e5e7eb;
    color: #374151;
}

/* ============================================
   SHARE OPTIONS GRID
   ============================================ */

.share-popup-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.share-popup-options a,
.share-popup-options button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-popup-options a:hover,
.share-popup-options button:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-2px);
}

.share-popup-options svg {
    width: 28px;
    height: 28px;
}

/* Brand colors */
.share-messenger svg { color: #0084ff; }
.share-whatsapp svg { color: #25d366; }
.share-telegram svg { color: #0088cc; }
.share-sms svg { color: #34c759; }
.share-discord svg { color: #5865f2; }
.share-signal svg { color: #3a76f0; }
.share-email svg { color: #6b7280; }
.share-copy svg { color: #8b5a2b; }

/* ============================================
   COPIED MESSAGE TOAST
   ============================================ */

.share-copied-msg {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    background: #1f2937;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100001;
}

.share-copied-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

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

@media (max-width: 480px) {
    .share-popup {
        width: 95%;
        padding: 20px 16px;
    }

    .share-popup-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .share-popup-options a,
    .share-popup-options button {
        padding: 12px 4px;
        font-size: 0.7rem;
    }

    .share-popup-options svg {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   GALLERY POSITION FIX
   ============================================ */

.woocommerce-product-gallery {
    position: relative;
}
