/**
 * External Price Sync - Frontend Styles
 *
 * @package ExternalPriceSync
 * @since 1.2.0
 */

/* Price Labels (VK/EK for dōTERRA, UVP/Preis for Amazon) */
.eps-price-label {
    display: inline !important;
    font-weight: 600;
    font-size: 0.9em;
    margin-right: 3px;
    color: inherit;
    white-space: nowrap;
}

/* Ensure price container allows inline elements */
.price .eps-price-label,
.elementor-widget-woocommerce-product-price .eps-price-label {
    display: inline !important;
}

/* Amazon UVP Tooltip - Base styling */
abbr.eps-rrp-tooltip {
    display: inline !important;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
    cursor: help;
    border-bottom: none; /* Remove default browser styling */
    position: relative;
}

/* Custom CSS Tooltip (more reliable than native title) */
abbr.eps-rrp-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    text-align: left;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Tooltip arrow */
abbr.eps-rrp-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    margin-bottom: -4px;
}

/* Show tooltip on hover */
abbr.eps-rrp-tooltip:hover::after,
abbr.eps-rrp-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Fix for Elementor flex/grid price containers */
.elementor-widget-woocommerce-product-price .price {
    display: block !important;
}

/* Stacked prices: VK + price on line 1, EK + price on line 2 */
.woocommerce .elementor-product-price-block-yes.elementor-widget-woocommerce-product-price .price del,
.woocommerce .elementor-product-price-block-yes.elementor-widget-woocommerce-product-price .price ins {
    display: inline !important;
}

/* Line break between prices (added via PHP) */
.eps-price-break {
    display: block !important;
    margin: 2px 0;
}

/* Responsive: Stack labels on very small screens */
@media (max-width: 360px) {
    .eps-price-label {
        display: block !important;
        margin-bottom: 2px;
    }
}
