/* Tooltip Wrapper */
.angie-pat-wrapper {
    display: inline-block;
    float: right; /* Right justify */
    margin-left: 10px;
    position: relative;
    font-weight: normal;
    font-size: 0.85em; 
    line-height: inherit;
    z-index: 101; /* Ensure above swatches if overlapping */
}

/* Clearfix for floats */
.angie-pat-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* The Link */
.angie-pat-link {
    text-decoration: underline;
    text-decoration-style: dotted;
    color: inherit;
    cursor: pointer;
    font-size: 1em;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.angie-pat-link:hover {
    opacity: 1;
}

/* The Tooltip Balloon */
.angie-pat-tooltip {
    position: absolute;
    bottom: 140%; /* Move up */
    right: -10px; /* Align to right edge */
    left: auto;   
    transform: none; 
    width: 280px;
    max-width: 80vw;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-radius: 4px;
    z-index: 1000;
    padding: 15px 25px 15px 15px; /* Added right padding for close button */
    text-align: left;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    display: none;
}

/* Visible State */
.angie-pat-tooltip.is-active {
    display: block;
    animation: angie-fade-in 0.2s ease-out;
}

/* Arrow - Positioned on the right side */
.angie-pat-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 20px; 
    left: auto;
    margin-left: 0;
    border-width: 8px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

/* Arrow Border */
.angie-pat-tooltip::before {
    content: "";
    position: absolute;
    top: 100%;
    right: 19px; 
    left: auto;
    margin-left: 0;
    border-width: 9px;
    border-style: solid;
    border-color: #ddd transparent transparent transparent;
}

/* Close Button */
.angie-pat-close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    line-height: 1;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    font-size: 18px; /* Standard X size */
    font-family: Arial, sans-serif;
    font-weight: normal;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.angie-pat-close:hover {
    color: #333;
    opacity: 1;
    background: transparent !important;
}

/* Content */
.angie-pat-content p:last-child {
    margin-bottom: 0;
}

.angie-pat-content img {
    max-width: 100%;
    height: auto;
}

@keyframes angie-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .angie-pat-tooltip {
        width: 260px;
        right: -20px;
    }
}
