/* Professional Free Shipping Badge - Rectangular Design */
.kacfs-free-shipping-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(90deg, #1A3C5A 0%, #2A6F97 100%); /* Updated to match custom truck design */
    color: #fff;
    padding: 12px 20px; /* Reverted to original padding */
    border-radius: 8px; /* Reverted to original border radius */
    font-weight: 600;
    font-size: 14px; /* Reverted to original font size */
    box-shadow: 0 3px 6px rgba(0,0,0,0.12); /* Reverted to original shadow */
    transition: all 0.3s ease-in-out;
    text-align: center;
    line-height: 1.4;
    animation: kacfsSlideIn 0.5s ease forwards;
    margin-bottom: 20px;
}

/* Slide-in Animation for Badge */
@keyframes kacfsSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Truck Icon Animation (On Right, Facing and Moving Right) */
.kacfs-free-shipping-badge .kacfs-badge-icon {
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 25px;;
    animation: kacfsTruckMoveRight 7s ease-in-out infinite;
    transform: scaleX(1); /* Ensure truck faces right */
    order: 2; /* Force icon to the right in flex layout */
}

/* Truck Movement Animation Toward Right */
@keyframes kacfsTruckMoveRight {
    0%, 100% { transform: translateX(0) scaleX(1); }
    50% { transform: translateX(-38px) scaleX(1); }
}

/* Badge Text Styling */
.kacfs-free-shipping-badge .kacfs-badge-text {
    font-size: 17px;
    font-weight: 500;
    flex-grow: 1;
    order: 1; /* Force text to the left in flex layout */
}

/* Hover Effect for Interactivity */
.kacfs-free-shipping-badge:hover {
    background: linear-gradient(90deg, #2A6F97 0%, #1A3C5A 100%); /* Reversed gradient on hover */
    box-shadow: 0 5px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Hide on Fade Out */
.kacfs-free-shipping-badge.hiding {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Dark Theme Compatibility */
.theme-dark .kacfs-free-shipping-badge {
    background: linear-gradient(90deg, #2F4F4F 0%, #4682B4 100%);
    color: #e6e6e6;
}

/* Responsive */
@media (max-width: 600px) {
    .kacfs-free-shipping-badge {
        flex-direction: column;
        font-size: 13px;
        padding: 10px 15px;
    }

    .kacfs-free-shipping-badge .kacfs-badge-icon {
        font-size: 16px;
        order: 2; /* Maintain icon on bottom in column */
    }

    .kacfs-free-shipping-badge .kacfs-badge-text {
        font-size: 12px;
        text-align: center;
        order: 1; /* Maintain text on top in column */
    }
}

/* Product Free Shipping Badge - Individual Product Badge */
.kacfs-product-free-shipping-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #1976D2 0%, #2196F3 50%, #42A5F5 100%);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    box-shadow: 0 3px 12px rgba(46, 125, 50, 0.3), 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    margin: 6px 0;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}


/* Badge Text Styling */
.kacfs-product-free-shipping-badge .kacfs-badge-text {
    font-weight: 600;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    order: 1;
}

/* Badge Icon with Animation */
.kacfs-product-free-shipping-badge .kacfs-badge-icon {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: kacfsBadgeTruckMove 4s ease-in-out infinite;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
    order: 2;
    margin-left: 2px;
}

/* Enhanced Truck Animation */
@keyframes kacfsBadgeTruckMove {
    0%, 100% { 
        transform: translateX(0) scale(1);
    }
    25% { 
        transform: translateX(2px) scale(1.05);
    }
    50% { 
        transform: translateX(-2px) scale(1.1);
    }
    75% { 
        transform: translateX(1px) scale(1.05);
    }
}

.kacfs-product-free-shipping-badge:hover {
    background: linear-gradient(135deg, #0D47A1 0%, #1565C0 50%, #1E88E5 100%);
    box-shadow: 0 8px 24px rgba(21, 101, 192, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Active/Focus States */
.kacfs-product-free-shipping-badge:active {
    transform: translateY(0) scale(1.01);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

/* Badge Entry Animation */
.kacfs-product-free-shipping-badge {
    animation: kacfsBadgeSlideIn 0.6s ease-out forwards;
}

@keyframes kacfsBadgeSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Dark Theme Optimization */
.theme-dark .kacfs-product-free-shipping-badge,
body.dark-mode .kacfs-product-free-shipping-badge {
    background: linear-gradient(135deg, #1B4332 0%, #2D5A3D 50%, #40916C 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 3px 12px rgba(27, 67, 50, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
    color: #E8F5E8;
}

.theme-dark .kacfs-product-free-shipping-badge:hover,
body.dark-mode .kacfs-product-free-shipping-badge:hover {
    background: linear-gradient(135deg, #081C15 0%, #1B4332 50%, #2D5A3D 100%);
    box-shadow: 0 6px 20px rgba(27, 67, 50, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .kacfs-product-free-shipping-badge {
        font-size: 12px;
        padding: 6px 12px;
        gap: 5px;
        border-radius: 20px;
    }
    
    .kacfs-product-free-shipping-badge .kacfs-badge-icon {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .kacfs-product-free-shipping-badge {
        font-size: 11px;
        padding: 5px 10px;
        gap: 4px;
        border-radius: 18px;
    }
    
    .kacfs-product-free-shipping-badge .kacfs-badge-icon {
        font-size: 13px;
    }
}