/* ============================================
   BASE WRAPPER FIX
   ============================================ */
.spi-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
    /* Fixes mysterious gaps/white space under images */
    line-height: 0;
    font-size: 0;
    max-width: 100%; /* Ensures responsive images don't overflow */
}

/* Ensure the image inside fills the wrapper correctly */
.spi-wrapper img {
    display: block; 
    max-width: 100%;
    height: auto;
}

.pinterest-icon {
    width: 12px;
    height: 12px;
    fill: currentColor;
    margin-right: 6px;
    vertical-align: middle;
    display: inline-block;
}

/* Base Button */
.spi-btn {
    position: absolute;
    z-index: 999; /* High Z-index to sit on top of everything */
    cursor: pointer;
    line-height: 1; /* Reset line-height for text */
    display: flex;
    align-items: center;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.9);
    white-space: nowrap; /* Prevents text breaking */
}

/* ============================================
   POSITIONING (Coordinates relative to Image)
   ============================================ */
.spi-btn.top-left { top: 15px; left: 15px; }
.spi-btn.top-right { top: 15px; right: 15px; }
.spi-btn.bottom-left { bottom: 15px; left: 15px; }
.spi-btn.bottom-right { bottom: 15px; right: 15px; }

/* ============================================
   HOVER LOGIC
   ============================================ */
.spi-wrapper:hover .spi-btn,
.spi-wrapper.spi-always-show .spi-btn {
    opacity: 1;
    transform: scale(1);
}

.spi-btn:hover {
    transform: scale(1.05) translateY(-2px) !important; 
}

/* ============================================
   DESIGNS
   ============================================ */
/* 1. Red */
.spi-btn.design-1 { background-color: #E60023; color: #fff !important; font-size: 14px; font-weight: 600; font-family: sans-serif; padding: 9px 16px; border-radius: 24px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.spi-btn.design-1:hover { background-color: #ad001b; }

/* 2. White */
.spi-btn.design-2 { background-color: #fff; color: #111 !important; font-size: 14px; font-weight: 600; font-family: sans-serif; padding: 9px 16px; border-radius: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.spi-btn.design-2:hover { background-color: #f0f0f0; }
.spi-btn.design-2 .pinterest-icon { fill: #E60023; }

/* 3. Dark */
.spi-btn.design-3 { background-color: #111; color: #fff !important; font-size: 14px; font-weight: 600; font-family: sans-serif; padding: 9px 16px; border-radius: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.spi-btn.design-3:hover { background-color: #000; }

/* 4. Rounded Square */
.spi-btn.design-4 { background-color: #E60023; color: #fff !important; font-size: 14px; font-weight: 600; font-family: sans-serif; padding: 10px 18px; border-radius: 8px; box-shadow: 0 2px 8px rgba(230, 0, 35, 0.3); }
.spi-btn.design-4:hover { background-color: #ad001b; }

/* 5. Glass */
.spi-btn.design-5 { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.3); color: #E60023 !important; font-size: 14px; font-weight: 600; font-family: sans-serif; padding: 9px 16px; border-radius: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.spi-btn.design-5:hover { background: rgba(255, 255, 255, 1); }
.spi-btn.design-5 .pinterest-icon { fill: #E60023; }

/* 6. Icon Only */
.spi-btn.design-6 { background-color: #E60023; color: #fff !important; font-size: 0; padding: 11px; border-radius: 50%; box-shadow: 0 2px 8px rgba(230, 0, 35, 0.3); width: 40px; height: 40px; justify-content: center; }
.spi-btn.design-6:hover { background-color: #ad001b; }
.spi-btn.design-6 .pinterest-icon { width: 18px; height: 18px; margin: 0; }

/* 7. Outlined */
.spi-btn.design-7 { background-color: transparent; border: 2px solid #fff; color: #fff !important; font-size: 14px; font-weight: 600; font-family: sans-serif; padding: 8px 16px; border-radius: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); backdrop-filter: blur(4px); }
.spi-btn.design-7:hover { background-color: #fff; color: #E60023 !important; }
.spi-btn.design-7:hover .pinterest-icon { fill: #E60023; }

/* 8. Gradient */
.spi-btn.design-8 { background: linear-gradient(135deg, #E60023 0%, #C60019 100%); color: #fff !important; font-size: 14px; font-weight: 700; font-family: sans-serif; padding: 11px 20px; border-radius: 28px; box-shadow: 0 4px 12px rgba(230, 0, 35, 0.4); }