/**
 * WooCommerce Product Offer Labels Styles
 * Version: 1.1.0
 */

/* --- WRAPPERS --- */
.wpol-label-wrapper {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 9;
}

/* For single product pages, position it inside the image container */
.woocommerce div.product div.images .wpol-label-wrapper {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 9;
}

/* Base styles for ALL labels */
.wpol-offer-label {
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    color: #ffffff; /* Default text color */
    background-color: #d9534f; /* Default background color */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
    transform-origin: center center;
}

/* --- SHAPES --- */

/* 1. Rectangle Shape */
.wpol-shape-rectangle {
    padding: 8px 14px;
    border-radius: 4px;
}

/* 2. Round Shape */
.wpol-shape-round {
    height: 70px;
    min-width: 70px;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

/* 3. Angled Banner Shape */
.wpol-shape-angle {
    padding: 8px 16px;
    transform: skewX(-15deg);
}
/* Un-skew the text inside */
.wpol-shape-angle span { 
    display: inline-block;
    transform: skewX(15deg);
}

/* 4. Banner Shape */
.wpol-shape-banner {
    padding: 10px 18px;
    clip-path: polygon(0% 0%, 100% 0%, 92% 50%, 100% 100%, 0% 100%, 8% 50%);
}

/* 5. Corner Flag Shape */
/* This one requires a specific wrapper to position correctly */
.wpol-shape-corner-wrapper {
    top: 0;
    left: 0;
    width: 120px;
    height: 120px;
    overflow: hidden;
}
.wpol-shape-corner {
    position: absolute;
    width: 170px; /* wide enough to span the corner */
    padding: 8px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    left: -45px;
    top: 30px;
    transform: rotate(-45deg);
}

/* --- ANIMATIONS --- */

/* 1. Pulse Animation (applied to wrapper) */
.wpol-animate-pulse {
    animation: wpol-pulse 1.5s infinite;
}

@keyframes wpol-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 2. Shake Animation (applied to wrapper) */
.wpol-animate-shake {
    animation: wpol-shake 0.82s cubic-bezier(.36,.07,.19,.97) both infinite;
}

@keyframes wpol-shake {
  10%, 90% {
    transform: translate3d(-2px, 0, 0);
  }
  
  20%, 80% {
    transform: translate3d(3px, 0, 0);
  }

  30%, 50%, 70% {
    transform: translate3d(-5px, 0, 0);
  }

  40%, 60% {
    transform: translate3d(5px, 0, 0);
  }
}

/* 3. Flash Animation (applied to label itself) */
.wpol-animate-flash {
    animation: wpol-flash 1.5s infinite;
}

@keyframes wpol-flash {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.4;
    }
}

