/**
 * Dynamic Sale Badge - Frontend Styles
 * עיצוב הבאג בפרונט אנד
 */

/* בסיס הבאג */
.dsb-sale-badge {
    position: absolute !important;
    z-index: 999 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif !important;
    font-weight: bold !important;
    text-align: center !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden !important;
    transition: transform 0.3s ease !important;
    cursor: pointer !important;
}

/* מיקומים */
.dsb-position-top-right {
    top: 10px !important;
    right: 10px !important;
}

.dsb-position-top-left {
    top: 10px !important;
    left: 10px !important;
}

.dsb-position-bottom-right {
    bottom: 10px !important;
    right: 10px !important;
}

.dsb-position-bottom-left {
    bottom: 10px !important;
    left: 10px !important;
}

/* גדלים */
.dsb-size-small {
    width: 40px !important;
    height: 40px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
}

.dsb-size-medium {
    width: 60px !important;
    height: 60px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.dsb-size-large {
    width: 80px !important;
    height: 80px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
}

/* גדלים מותאמים לדף מוצר יחיד */
.dsb-single.dsb-size-small {
    width: 50px !important;
    height: 50px !important;
    font-size: 11px !important;
}

.dsb-single.dsb-size-medium {
    width: 70px !important;
    height: 70px !important;
    font-size: 13px !important;
}

.dsb-single.dsb-size-large {
    width: 90px !important;
    height: 90px !important;
    font-size: 15px !important;
}

/* תוכן הבאג */
.dsb-badge-content {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 5px !important;
    box-sizing: border-box !important;
}

/* תמונת הבאג */
.dsb-badge-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    z-index: 1 !important;
}

/* טקסט הבאג */
.dsb-badge-text {
    position: relative !important;
    z-index: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
}

.dsb-discount-percentage {
    font-size: 1.2em !important;
    font-weight: bold !important;
    line-height: 1 !important;
    margin-bottom: 2px !important;
}

.dsb-discount-label {
    font-size: 0.8em !important;
    font-weight: bold !important;
    line-height: 1 !important;
    opacity: 0.95 !important;
}

/* באג טקסט בלבד */
.dsb-text-only {
    padding: 8px !important;
}

.dsb-text-content {
    font-weight: bold !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7) !important;
    text-align: center !important;
    line-height: 1.1 !important;
}

/* אנימציות */
.dsb-animated {
    animation: dsbPulse 2s infinite ease-in-out !important;
}

@keyframes dsbPulse {
    0%, 100% {
        transform: scale(1) !important;
        opacity: 1 !important;
    }
    50% {
        transform: scale(1.05) !important;
        opacity: 0.95 !important;
    }
}

/* אנימציה על hover */
.dsb-sale-badge:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

/* אנימציות מתקדמות */
.dsb-bounce {
    animation: dsbBounce 1.5s infinite !important;
}

@keyframes dsbBounce {
    0%, 20%, 53%, 80%, 100% {
        transform: scale(1) !important;
    }
    40%, 43% {
        transform: scale(1.08) !important;
    }
}

.dsb-rotate {
    animation: dsbRotate 3s infinite linear !important;
}

@keyframes dsbRotate {
    from {
        transform: rotate(0deg) !important;
    }
    to {
        transform: rotate(360deg) !important;
    }
}

.dsb-shake {
    animation: dsbShake 1s infinite !important;
}

@keyframes dsbShake {
    0%, 50%, 100% {
        transform: translateX(0) !important;
    }
    25% {
        transform: translateX(-2px) !important;
    }
    75% {
        transform: translateX(2px) !important;
    }
}

/* וידא שהמיכלים יחסיים */
.product-wrapper,
.wd-product,
.product,
.product-element-top,
.woodmart-product-wrapper,
.product-grid-item,
.woocommerce-product-gallery {
    position: relative !important;
}

/* סגנונות מיוחדים לעיצובים שונים */

/* באג משושה */
.dsb-hexagon {
    border-radius: 0 !important;
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%) !important;
}

/* באג מרובע מעוגל */
.dsb-rounded-square {
    border-radius: 15% !important;
}

/* באג עם גבול */
.dsb-bordered {
    border: 3px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 12px rgba(0, 0, 0, 0.25) !important;
}

/* באג עם זוהר */
.dsb-glow {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3), 0 2px 12px rgba(0, 0, 0, 0.25) !important;
}

/* גרדיינטים מוכנים */
.dsb-gradient-red {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52) !important;
}

.dsb-gradient-green {
    background: linear-gradient(135deg, #4ecdc4, #44a08d) !important;
}

.dsb-gradient-blue {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
}

.dsb-gradient-orange {
    background: linear-gradient(135deg, #f093fb, #f5576c) !important;
}

.dsb-gradient-purple {
    background: linear-gradient(135deg, #a8edea, #fed6e3) !important;
}

/* התאמות לעיצובים פופולריים */

/* Astra Theme */
.ast-separate-container .dsb-sale-badge {
    z-index: 10 !important;
}

/* Storefront Theme */
.storefront .dsb-sale-badge {
    z-index: 99 !important;
}

/* OceanWP Theme */
.oceanwp .dsb-sale-badge {
    z-index: 999 !important;
}

/* Woodmart Theme (מיוחד לכם) */
.woodmart .dsb-sale-badge {
    z-index: 15 !important;
}

.woodmart .product-labels .dsb-sale-badge {
    position: relative !important;
    display: inline-block !important;
    margin: 5px !important;
}

/* התאמות לנייד */
@media (max-width: 768px) {
    /* הקטנת הבאג בנייד */
    .dsb-size-small {
        width: 35px !important;
        height: 35px !important;
        font-size: 9px !important;
    }
    
    .dsb-size-medium {
        width: 45px !important;
        height: 45px !important;
        font-size: 10px !important;
    }
    
    .dsb-size-large {
        width: 60px !important;
        height: 60px !important;
        font-size: 12px !important;
    }
    
    /* מיקומים מותאמים לנייד */
    .dsb-position-top-right,
    .dsb-position-top-left {
        top: 5px !important;
    }
    
    .dsb-position-top-right,
    .dsb-position-bottom-right {
        right: 5px !important;
    }
    
    .dsb-position-top-left,
    .dsb-position-bottom-left {
        left: 5px !important;
    }
    
    .dsb-position-bottom-right,
    .dsb-position-bottom-left {
        bottom: 5px !important;
    }
    
    /* ביטול אנימציות בנייד */
    .dsb-animated,
    .dsb-bounce,
    .dsb-rotate,
    .dsb-shake {
        animation: none !important;
    }
    
    /* ביטול hover effects בנייד */
    .dsb-sale-badge:hover {
        transform: none !important;
    }
    
    /* טקסט קטן יותר בנייד */
    .dsb-discount-percentage {
        font-size: 1em !important;
    }
    
    .dsb-discount-label {
        font-size: 0.7em !important;
    }
}

/* התאמות לטאבלט */
@media (min-width: 769px) and (max-width: 1024px) {
    .dsb-size-small {
        width: 38px !important;
        height: 38px !important;
        font-size: 9.5px !important;
    }
    
    .dsb-size-medium {
        width: 55px !important;
        height: 55px !important;
        font-size: 11px !important;
    }
    
    .dsb-size-large {
        width: 75px !important;
        height: 75px !important;
        font-size: 13px !important;
    }
}

/* התאמות למסכים גדולים */
@media (min-width: 1200px) {
    .dsb-single.dsb-size-large {
        width: 100px !important;
        height: 100px !important;
        font-size: 16px !important;
    }
}

/* RTL Support */
.rtl .dsb-position-top-right {
    right: auto !important;
    left: 10px !important;
}

.rtl .dsb-position-top-left {
    left: auto !important;
    right: 10px !important;
}

.rtl .dsb-position-bottom-right {
    right: auto !important;
    left: 10px !important;
}

.rtl .dsb-position-bottom-left {
    left: auto !important;
    right: 10px !important;
}

/* אפקטי טקסט מתקדמים */
.dsb-text-outline {
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000 !important;
}

.dsb-text-glow {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
}

/* מצב חושך */
@media (prefers-color-scheme: dark) {
    .dsb-sale-badge {
        box-shadow: 0 2px 12px rgba(255, 255, 255, 0.1) !important;
    }
    
    .dsb-badge-text {
        text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.2) !important;
    }
}

/* אנימציית כניסה */
.dsb-sale-badge {
    animation: dsbFadeIn 0.5s ease-out !important;
}

@keyframes dsbFadeIn {
    from {
        opacity: 0 !important;
        transform: scale(0.5) !important;
    }
    to {
        opacity: 1 !important;
        transform: scale(1) !important;
    }
}

/* התאמות לביצועים */
.dsb-sale-badge * {
    backface-visibility: hidden !important;
    transform-style: preserve-3d !important;
}

/* הסרת margin/padding שעלולים להפריע */
.dsb-sale-badge,
.dsb-sale-badge * {
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}