/**
 * SneakyPeak Front-end Styles
 *
 * RULE 1: Never wrap or alter product images or image links.
 * All badges attach to the product CARD element only via absolute positioning.
 */

/* Card positioning fallback ensuring card is the positioning context */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
ul.products li.product,
.wc-block-grid__product,
.wp-block-woocommerce-all-products .wc-block-product,
.products .product {
    position: relative;
}

/* Ensure single product gallery primary image has relative positioning */
.woocommerce-product-gallery__image,
.sneakypeak-promo .woocommerce-product-gallery__image {
    position: relative !important;
}

/* Base Badge Wrapper: Absolute-positioned on the card */
.sneakypeak-badge-wrap {
    position: absolute !important;
    z-index: 30 !important;
    pointer-events: none !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
    line-height: 1 !important;
}

/* Corner Positions (defaults if offsets are 0) */
.sneakypeak-corner-top-right {
    top: 0 !important;
    right: 0 !important;
}
.sneakypeak-corner-top-left {
    top: 0 !important;
    left: 0 !important;
}
.sneakypeak-corner-bottom-left {
    bottom: 0 !important;
    left: 0 !important;
}
.sneakypeak-corner-bottom-right {
    bottom: 0 !important;
    right: 0 !important;
}

/* Base Badge Text Tag */
.sneakypeak-badge {
    color: #ffffff !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    box-sizing: border-box !important;
    animation: sneakypeakShimmer 3.5s ease-in-out infinite;
}

/* Shapes */
/* 1. Ribbon (Angled left edge) */
.sneakypeak-badge-shape-ribbon {
    padding: 6px 14px 6px 18px !important;
    clip-path: polygon(12px 0%, 100% 0%, 100% 100%, 0% 100%, 6px 50%);
    -webkit-clip-path: polygon(12px 0%, 100% 0%, 100% 100%, 0% 100%, 6px 50%);
}

/* 2. Pill */
.sneakypeak-badge-shape-pill {
    padding: 6px 14px !important;
    border-radius: 9999px !important;
}

/* 3. Circle */
.sneakypeak-badge-shape-circle {
    width: 48px !important;
    height: 48px !important;
    padding: 4px !important;
    border-radius: 50% !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 10px !important;
}

/* 4. Flag (Bookmark notch) */
.sneakypeak-badge-shape-flag {
    padding: 6px 12px 10px 12px !important;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% calc(100% - 6px), 0% 100%);
    -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% calc(100% - 6px), 0% 100%);
}

/* Sizes */
.sneakypeak-badge-size-small {
    padding: 4px 10px 4px 12px !important;
}
.sneakypeak-badge-size-large {
    padding: 8px 18px 8px 22px !important;
}

/* Single product gallery ribbon sizing */
.sneakypeak-badge-single {
    padding: 7px 16px 7px 20px !important;
}

/* Icons */
.sneakypeak-badge-icon {
    line-height: 1;
    display: inline-block;
}
.sneakypeak-icon-star {
    color: #ffd700;
    font-size: 11px;
}

/* Subtle Shimmer Animation */
@keyframes sneakypeakShimmer {
    0%, 100% {
        opacity: 0.96;
    }
    50% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sneakypeak-badge {
        animation: none !important;
    }
}

/* Teaser Price Block */
.sneakypeak-teaser-wrap {
    display: block !important;
    margin-top: 10px !important;
    padding-top: 8px !important;
    border-top: 1px dashed rgba(255, 75, 43, 0.4) !important;
    line-height: 1.3 !important;
    font-family: inherit !important;
    clear: both !important;
}

.single-product .price .sneakypeak-teaser-wrap,
.single-product .summary .sneakypeak-teaser-wrap {
    margin-top: 14px !important;
}

.sneakypeak-teaser-label {
    display: block !important;
    font-size: 0.8em !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #444444 !important;
    margin-bottom: 2px !important;
    line-height: 1.2 !important;
}

.sneakypeak-teaser-price {
    display: block !important;
    font-family: inherit !important;
    font-size: 1.1em !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
}

.single-product .price .sneakypeak-teaser-price,
.product-type-variable .woocommerce-variation-price .sneakypeak-teaser-price {
    font-size: 1.15em !important;
    font-weight: 800 !important;
}

/* Suppress default Sale flash badge ONLY on promo products during teaser */
.sneakypeak-promo.sneakypeak-phase-teaser .onsale,
body.sneakypeak-promo-single.sneakypeak-phase-teaser .woocommerce-product-gallery .onsale {
    display: none !important;
}
