.torobpay-widget {
    /* Base styles - colors and dimensions will be set via inline CSS from admin settings */
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 10px 0;
    transition: opacity 200ms ease-in-out;
    border-style: solid;
    /* Default fallback styles (will be overridden by inline CSS) */
    border-radius: 16px;
    border: 1px solid #ebecf2;
    background-color: #ffffff;
    position: relative;
}

.torobpay-widget-image {
    width: 60px;
    border-radius: 15px;
}

.torobpay-widget-media { display: flex; align-items: center; }

.torobpay-widget-content {
    /* Default text color (will be overridden by inline CSS from admin settings) */
    color: #1a1c23;
}

.torobpay-widget-title {
    font-size: 14px;
    font-weight: bold;
    line-height: 180%;
    margin-bottom: 2px;
}

.torobpay-widget-description {
    font-weight: 300;
    font-size: 12px;
    line-height: 180%;
    letter-spacing: -0.36px;
}

/* Container transition and loading state */
#torobpay-variation-widget-container {
    opacity: 1;
    transition: opacity 200ms ease-in-out;
}

#torobpay-variation-widget-container.torobpay-loading,
.torobpay-widget.torobpay-loading {
    opacity: 0.5;
    pointer-events: none;
}
/* Logo animation keyframes */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes wobble {
    0%, 100% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25%) rotate(-5deg);
    }
    30% {
        transform: translateX(20%) rotate(3deg);
    }
    45% {
        transform: translateX(-15%) rotate(-3deg);
    }
    60% {
        transform: translateX(10%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-7px);
    }
}

@keyframes ping {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(156, 231, 106, 0.45);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 18px rgba(156, 231, 106, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(156, 231, 106, 0);
    }
}

/* Animation classes */
.torobpay-logo-pulse {
    animation: pulse 1s ease-in-out infinite;
}

.torobpay-logo-wobble {
    animation: wobble 1.2s ease-in-out infinite;
}

.torobpay-logo-bounce {
    animation: bounce 1.2s ease-in-out infinite;
}

.torobpay-logo-ping {
    animation: ping 1.6s ease-out infinite;
}

.torobpay-widget-media.torobpay-logo-light-sweep {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

.torobpay-widget-media.torobpay-logo-light-sweep::after {
    content: '';
    position: absolute;
    top: -35%;
    left: 0;
    width: 60%;
    height: 170%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.75) 50%, rgba(255, 255, 255, 0) 100%);
    transform: translateX(0) rotate(25deg);
    opacity: 0;
    pointer-events: none;
    animation: torobpay-light-sweep 1.8s ease-in-out infinite;
}

.torobpay-widget-status-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.torobpay-widget-status-indicator .torobpay-status-heartbeat,
.torobpay-widget-status-indicator .torobpay-status-dot {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
}

.torobpay-widget-status-indicator .torobpay-status-dot {
    background: #9ce76a;
}

.torobpay-widget-status-indicator .torobpay-status-heartbeat {
    background: #9ce76a;
    opacity: 0.7;
    animation: torobpay-status-ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes torobpay-status-ping {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    75% {
        transform: scale(2.1);
        opacity: 0;
    }
    100% {
        transform: scale(2.3);
        opacity: 0;
    }
}

@keyframes torobpay-light-sweep {
    0% {
        transform: translateX(-120%) rotate(25deg);
        opacity: 0;
    }
    30% {
        opacity: 0.85;
    }
    60% {
        transform: translateX(160%) rotate(25deg);
        opacity: 0;
    }
    100% {
        transform: translateX(160%) rotate(25deg);
        opacity: 0;
    }
}

/* Ensure parent containers have relative positioning for absolute badge positioning */
.products .product,
li.product,
.wc-block-grid__product,
.wp-block-post {
    position: relative !important;
}

.torobpay-product-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    direction: rtl;
    margin: 0;
    pointer-events: none;
}

/* Re-enable pointer events on the inner element for hover effects */
.torobpay-product-badge-inner {
    pointer-events: auto;
}

.torobpay-product-badge-inner {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    border: 1px solid #9ce76a;
    border-radius: 999px;
    background-color: #ffffff;
    transition: padding 300ms ease, box-shadow 300ms ease;
    overflow: hidden;
}

.torobpay-product-badge-icon {
    width: auto;
    height: 24px;
    margin: 0 !important;
    flex-shrink: 0;
    transition: transform 300ms ease;
}

.torobpay-product-badge-text {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: max-width 300ms ease, opacity 300ms ease, margin-left 300ms ease, margin-right 300ms ease;
    font-size: 12px;
    font-weight: 500;
}

.torobpay-product-badge:hover .torobpay-product-badge-inner {
    box-shadow: 0 6px 16px rgba(0, 61, 1, 0.12);
}

.torobpay-product-badge:hover .torobpay-product-badge-text {
    max-width: 240px;
    opacity: 1;
    margin-right: 5px;
    margin-left: 9px;
}
