/* KRPP Banner Discount Widget - Main Styles */

:root {
    --krpp-banner-bg: #e74c3c;
    --krpp-banner-text: #ffffff;
    --krpp-product-card-bg: #ffffff;
    --krpp-discount-badge-bg: #e74c3c;
    --krpp-discount-badge-text: #ffffff;
    --krpp-countdown-bg: #2c3e50;
    --krpp-countdown-text: #ffffff;
    --krpp-border-radius: 0px;
    --krpp-image-height: 200px;
    --krpp-image-fit: cover;
    --krpp-products-per-row: 2;
    --krpp-slider-speed: 600ms;
    --krpp-slider-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Increase desktop gap to avoid any visual overlap between items */
    --krpp-gap-desktop: 20px;
    --krpp-gap-tablet: 5px;
    --krpp-gap-mobile: 5px;
    --krpp-slider-padding-inline: 12px;
}

/* Banner Discount Wrapper */
.krpp-banner-discount-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

.krpp-banner-discount-wrapper[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.krpp-banner-discount-wrapper[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* Banner Container */
.krpp-banner-discount-container {
    width: 100%;
    background: linear-gradient(135deg, var(--krpp-banner-bg) 0%, rgba(231, 76, 60, 0.9) 100%);
    border-radius: var(--krpp-border-radius);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
}

/* Sidebar Layout - Desktop */
.krpp-banner-discount-wrapper[data-layout="sidebar"] .krpp-banner-discount-container {
    display: grid;
    grid-template-columns: var(--krpp-sidebar-content-width, 50%) var(--krpp-sidebar-products-width, 50%);
    gap: 0px !important;
    padding: 5px !important;
    border-radius: 8px;
}

@media (max-width: 1023px) {
    .krpp-banner-discount-wrapper[data-layout="sidebar"] .krpp-banner-discount-container {
        display: flex;
        flex-direction: column;
        gap: 0px !important;
        padding: 5px !important;
        border-radius: 8px;
    }
}

.krpp-banner-discount-container:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    transform: translateY(-2px);
}

/* Banner Header */
.krpp-banner-discount-header {
    display: flex;
    flex-direction: column;
    padding: 8px;
    color: var(--krpp-banner-text);
    align-items: stretch;
}

/* Sidebar Layout - Header in first column */
.krpp-banner-discount-wrapper[data-layout="sidebar"] .krpp-banner-discount-header {
    grid-column: 1;
    grid-row: 1;
}

.krpp-banner-discount-text-section {
    display: flex;
    flex-direction: column;
    animation: krpp-fade-in-left 0.6s ease-out;
    padding: 1px;
    min-width: 280px;
    flex-shrink: 0;
}

/* Countdown Column */
.krpp-countdown-column {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

[dir="rtl"] .krpp-countdown-column {
    justify-content: flex-start !important;
}

/* Title and Subtitle Column */
.krpp-title-subtitle-column {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Desktop Layout: Title/Subtitle first, then Countdown below */
@media (min-width: 1025px) {
    .krpp-banner-discount-text-section {
        flex-direction: column;
    }

    .krpp-title-subtitle-column {
        order: 1;
    }

    .krpp-countdown-column {
        order: 2;
    }
}

@keyframes krpp-fade-in-left {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

[dir="rtl"] .krpp-banner-discount-text-section {
    animation: krpp-fade-in-right 0.6s ease-out;
}

@keyframes krpp-fade-in-right {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Banner Title */
.krpp-banner-discount-title {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--krpp-banner-text);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Banner Subtitle */
.krpp-banner-discount-subtitle {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--krpp-banner-text);
    opacity: 0.95;
}


/* Countdown Container */
.krpp-countdown-container {
    flex: 0 0 auto;
    animation: krpp-fade-in-right 0.6s ease-out 0.2s both;
}

[dir="rtl"] .krpp-countdown-container {
    animation: krpp-fade-in-left 0.6s ease-out 0.2s both;
}

.krpp-countdown-display {
    display: inline-flex; /* shrink to content */
    width: max-content; /* background fits values */
    background: var(--krpp-countdown-bg);
    padding: 1px 1px;
    border-radius: var(--krpp-border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-height: 45px;
}

[dir="rtl"] .krpp-countdown-display {
    direction: rtl;
}

/* Countdown Item */
.krpp-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 40px;
    animation: krpp-countdown-item-show 0.3s ease-out;
    position: relative;
}

.krpp-countdown-item::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 700;
    color: var(--krpp-countdown-text);
    opacity: 0.6;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Hide trailing colon after the last visible unit (e.g., seconds) */
.krpp-countdown-item:last-child::after { content: none; }

@keyframes krpp-countdown-item-show {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.krpp-countdown-value {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--krpp-countdown-text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.krpp-countdown-label {
    display: block;
    font-size: 9px;
    font-weight: 600;
    color: var(--krpp-countdown-text);
    opacity: 0.8;
    text-transform: uppercase;
}

/* Products Wrapper */
.krpp-products-wrapper {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Products Grid */
.krpp-products-grid {
    display: grid;
    grid-template-columns: repeat(var(--krpp-products-per-row), 1fr);
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    width: 100%;
}

/* Products Slider Wrapper */
.krpp-products-slider-wrapper {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Products Slider Container */
.krpp-products-slider-container {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--krpp-gap-desktop);
    padding: 12px var(--krpp-slider-padding-inline);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
    scrollbar-width: thin;
    scrollbar-color: var(--krpp-scrollbar-thumb, rgba(231, 76, 60, 0.3)) var(--krpp-scrollbar-track, rgba(255, 255, 255, 0.1));
    width: 100%;
    box-sizing: border-box;
    scroll-snap-type: x proximity;
    margin: 0;
    scroll-padding-left: var(--krpp-slider-padding-inline);
    scroll-padding-right: var(--krpp-slider-padding-inline);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    will-change: scroll-position;
}

.krpp-products-slider-container:active {
    cursor: grabbing;
}

/* Smooth scroll behavior for all browsers */
html {
    scroll-behavior: smooth;
}

.krpp-products-slider-container::-webkit-scrollbar {
    height: 6px;
}

.krpp-products-slider-container::-webkit-scrollbar-track {
    background: var(--krpp-scrollbar-track, rgba(255, 255, 255, 0.1));
    border-radius: 0px;
}

.krpp-products-slider-container::-webkit-scrollbar-thumb {
    background: var(--krpp-scrollbar-thumb, rgba(231, 76, 60, 0.3));
    border-radius: 0px;
    transition: background 0.3s ease;
}

.krpp-products-slider-container::-webkit-scrollbar-thumb:hover {
    background: var(--krpp-scrollbar-thumb-hover, rgba(231, 76, 60, 0.6));
}

/* Slider Item */
.krpp-products-slider-item {
    flex: 0 0 auto;
    width: calc((70% - (var(--krpp-products-per-row) - 1) * var(--krpp-gap-desktop)) / var(--krpp-products-per-row));
    min-width: 0;
    box-sizing: border-box;
    margin-right: 0;
}   

/* Give extra space between the text/countdown (first item) and product items */
.krpp-products-slider-item:first-child { margin-inline-end: calc(var(--krpp-gap-desktop) * 1.5); }

/* RTL spacing fix for horizontal cards */
[dir="rtl"] .krpp-products-slider-item { margin-left: 0; }

/* Slider Navigation Buttons */
.krpp-slider-nav {
    position: absolute;
    z-index: 20;
    background: transparent !important;
    color: #000000;
    border: 0 !important;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    font-size: 28px;
    font-weight: bold;
    padding: 0;
    line-height: 1;
    outline: none;
    opacity: 0.8;
    visibility: visible;
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    top: 50%;
    transform: translateY(-50%);
}

/* Keep arrows always visible */
.krpp-slider-nav:hover:not(:disabled),
.krpp-slider-nav:active:not(:disabled),
.krpp-slider-nav:focus:not(:disabled) {
    color: #000000;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1;
}

.krpp-slider-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.krpp-slider-nav-prev {
    left: -45px;
}

.krpp-slider-nav-next {
    right: -45px;
}

/* Slider Indicators */
.krpp-slider-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 0;
    width: 100%;
    flex-wrap: wrap;
}

.krpp-slider-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cccccc;
    border: 0;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.krpp-slider-indicator:hover {
    opacity: 0.8;
    background: #999999;
}

.krpp-slider-indicator.active {
    width: 8px;
    height: 8px;
    background: #333333;
    opacity: 1;
}

/* Product Card */
.krpp-product-card {
    background: var(--krpp-product-card-bg);
    border-radius: 0;
    border: 3px solid rgba(128, 128, 128, 0.2);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: krpp-product-card-enter 0.5s ease-out;
    position: relative;
}

@keyframes krpp-product-card-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.krpp-product-card.krpp-product-card-shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-width: 300px;
}

.krpp-product-card:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.krpp-product-card:hover .krpp-product-card-image img {
    transform: none;
}

/* Product Card Image */
.krpp-product-card-image {
    position: relative;
    width: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 1;
}

.krpp-product-card-image a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.krpp-product-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: var(--krpp-image-fit);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

/* Discount Badge Circle */
.krpp-discount-badge-circle {
    position: absolute;
    top: 5px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    animation: krpp-badge-circle-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    font-weight: 700;
    flex-direction: column;
    gap: 2px;
    font-size: 30px !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50px;
}

[dir="rtl"] .krpp-discount-badge-circle {
    right: auto;
    left: 5px;
}

.krpp-badge-circle-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 0;
}

.krpp-badge-label {
    display: block;
    font-size: 0.4em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    opacity: 0.9;
    color:#ffffff;
}

.krpp-badge-value {
    display: block;
    font-size: 0.45em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color:#ffffff
}

@keyframes krpp-badge-circle-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Discount Badge Corner */
.krpp-discount-badge-corner {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--krpp-discount-badge-bg);
    color: var(--krpp-discount-badge-text);
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    animation: krpp-badge-corner-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 70%);
    border-radius: 0 8px 0 20px;
}

[dir="rtl"] .krpp-discount-badge-corner {
    right: auto;
    left: 0;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
    border-radius: 8px 0 20px 0;
}

@keyframes krpp-badge-corner-pop {
    0% {
        transform: scale(0) translateY(-20px);
        opacity: 0;
    }
    50% {
        transform: scale(1.15) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.krpp-discount-badge-text {
    display: block;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Product Card Content */
.krpp-product-card-content {
    flex: 1;
    padding: 11px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Product Card Title */
.krpp-product-card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    line-clamp: 2; /* standard property for compatibility */
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.krpp-product-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.krpp-product-card:hover .krpp-product-card-title a {
    color: var(--krpp-discount-badge-bg);
}

/* Product Card Price */
.krpp-product-card-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.krpp-product-price,
.krpp-product-price-sale {
    font-size: 11px;
    font-weight: 700;
    color: var(--krpp-discount-badge-bg);
}

.krpp-product-price-regular {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    font-weight: 500;
}

/* No Products Message */
.krpp-no-products {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

.krpp-no-products p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .krpp-banner-discount-header {
        display: flex; /* switch from grid to flex on tablet */
        flex-direction: column;
        width: 100%;
    }

    .krpp-banner-discount-title {
        font-size: 28px;
    }

    .krpp-banner-discount-subtitle {
        font-size: 16px;
    }

    .krpp-products-grid {
        gap: 10px;
        padding: 10px;
    }
    
    /* Tablet: Two-column layout (will be applied by 768px query) */
    .krpp-banner-discount-text-section {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    [dir="rtl"] .krpp-banner-discount-text-section {
        flex-direction: row-reverse;
    }

    .krpp-countdown-column {
        flex: 0 0 50%;
        width: 50%;
        max-width: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
        order: 0; /* Reset order for two-column layout */
    }

    [dir="rtl"] .krpp-countdown-column {
        justify-content: center;
    }

    .krpp-title-subtitle-column {
        flex: 0 0 50%;
        width: 50%;
        max-width: 50%;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0 8px;
        order: 0; /* Reset order for two-column layout */
    }

    .krpp-countdown-container {
        display: flex;
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 768px) {
    :root {
        --krpp-gap-tablet: 12px;
    }
    /* compute safe var in same scope as custom props set inline on wrapper */
    .krpp-products-slider-wrapper { --krpp-tablet-cols-safe: max(var(--krpp-tablet-cols, 1), 1); }
    :root { --krpp-slider-padding-inline: 16px; }
    /* Reset grid-specific placement so products section shows under the title on mobile */
    .krpp-products-wrapper {
        grid-column: auto;
        grid-row: auto;
        width: 100%;
    }

    .krpp-banner-discount-container {
        border-radius: 0px;
    }

    .krpp-banner-discount-header {
        display: flex; /* ensure flex layout on mobile */
        flex-direction: column;
        padding: 5px;
        width: 100%;
    }

    /* Two-column layout on tablet: 50% countdown (left), 50% title/subtitle (right) */
    .krpp-banner-discount-text-section {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    [dir="rtl"] .krpp-banner-discount-text-section {
        flex-direction: row-reverse;
    }

    /* Countdown Column - 50% width on tablet */
    .krpp-countdown-column {
        flex: 0 0 50%;
        width: 50%;
        max-width: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
        order: 0; /* Reset order for two-column layout */
    }

    [dir="rtl"] .krpp-countdown-column {
        justify-content: center;
    }

    /* Title and Subtitle Column - 50% width on tablet */
    .krpp-title-subtitle-column {
        flex: 0 0 50%;
        width: 50%;
        max-width: 50%;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0 8px;
        order: 0; /* Reset order for two-column layout */
    }

    .krpp-banner-discount-title {
        font-size: 24px;
        margin: 0;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .krpp-banner-discount-subtitle {
        font-size: 15px;
        margin: 0;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .krpp-countdown-display {
        gap: 8px;
        padding: 8px 12px;
        width: 100%;
        justify-content: center;
    }

    .krpp-countdown-item {
        min-width: 40px;
        flex: 0 0 auto;
    }

    .krpp-countdown-value {
        font-size: 15px;
    }

    .krpp-countdown-label {
        font-size: 10px;
    }

    .krpp-countdown-container {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    /* Force slider layout on tablet when 1 column is set */
    .krpp-products-grid {
        display: none;
    }

    .krpp-products-slider-wrapper {
        display: block;
    }

    .krpp-products-slider-container {
        padding: 0 var(--krpp-slider-padding-inline) 12px var(--krpp-slider-padding-inline);
        gap: 5px;
        scroll-padding-left: var(--krpp-slider-padding-inline);
        scroll-padding-right: var(--krpp-slider-padding-inline);
    }

    .krpp-products-slider-item {
        margin: 0;
        max-width: none;
        min-width: calc((100% - (var(--krpp-tablet-cols-safe, 1) - 1) * var(--krpp-gap-tablet, 12px)) / var(--krpp-tablet-cols-safe, 1));
        flex-shrink: 0;
    }

    .krpp-slider-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .krpp-slider-nav-prev {
        left: -45px;
    }

    .krpp-slider-nav-next {
        right: -45px;
    }


    .krpp-slider-indicator {
        width: 8px;
        height: 8px;
    }

    .krpp-slider-indicator.active {
        width: 24px;
    }

    .krpp-product-card-title {
        font-size: 12px;
    }

    .krpp-product-price,
    .krpp-product-price-sale {
        font-size: 13px;
    }

    .krpp-product-price-regular {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    /* Ensure products section is visible and stacked properly on small phones */
    .krpp-products-wrapper {
        grid-column: auto;
        grid-row: auto;
        width: 100%;
    }

    .krpp-banner-discount-container {
        border-radius: 0px;
    }

    .krpp-banner-discount-header {
        display: flex; /* ensure flex layout on small phones */
        width: 100%;
    }

    /* Two-column layout on mobile: 50% countdown (left), 50% title/subtitle (right) */
    .krpp-banner-discount-text-section {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        width: 100%;
    }

    [dir="rtl"] .krpp-banner-discount-text-section {
        flex-direction: row-reverse;
    }

    /* Countdown Column - 50% width on mobile */
    .krpp-countdown-column {
        flex: 0 0 50%;
        width: 50%;
        max-width: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 5px;
        order: 0; /* Reset order for two-column layout */
    }

    [dir="rtl"] .krpp-countdown-column {
        justify-content: center;
    }

    /* Title and Subtitle Column - 50% width on mobile */
    .krpp-title-subtitle-column {
        flex: 0 0 50%;
        width: 50%;
        max-width: 50%;
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0 10px;
        order: 0; /* Reset order for two-column layout */
    }

    .krpp-banner-discount-title {
        font-size: 18px;
        margin: 0;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .krpp-banner-discount-subtitle {
        font-size: 12px;
        margin: 0;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .krpp-countdown-display {
        gap: 4px;
        padding: 6px 8px;
        width: 100%;
        justify-content: center;
    }

    .krpp-countdown-item {
        min-width: 30px;
        flex: 0 0 auto;
    }

    .krpp-countdown-value {
        font-size: 12px;
    }

    .krpp-countdown-label {
        font-size: 7px;
    }

    .krpp-countdown-container {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    /* Force slider layout on mobile */
    .krpp-products-grid {
        display: none;
    }

    .krpp-products-slider-wrapper {
        display: block;
    }

    .krpp-products-slider-container {
        padding: 0px;
        scroll-padding-left: var(--krpp-slider-padding-inline, 12px);
        scroll-padding-right: var(--krpp-slider-padding-inline, 12px);
    }

    /* compute safe var in same scope as custom props set inline on wrapper */
    .krpp-products-slider-wrapper { --krpp-mobile-cols-safe: max(var(--krpp-mobile-cols, 1), 1); }

    .krpp-products-slider-item {
        margin: 0;
        max-width: none;
        min-width: calc((100% - (var(--krpp-mobile-cols-safe, 1) - 1) * var(--krpp-gap-mobile, 10px)) / var(--krpp-mobile-cols-safe, 1));
        flex-shrink: 0;
    }

    .krpp-slider-nav {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .krpp-slider-nav-prev {
        left: -40px;
    }

    .krpp-slider-nav-next {
        right: -40px;
    }

    .krpp-product-card-content {
        padding: 10px;
        gap: 8px;
    }

    .krpp-product-card-title {
        font-size: 11px;
    }

    .krpp-product-price,
    .krpp-product-price-sale {
        font-size: 9px;
    }

    .krpp-product-price-regular {
        font-size: 9px;
    }
}

/* Animation Styles */
.krpp-banner-discount-wrapper[data-animation="fade"] .krpp-product-card {
    animation: krpp-fade-in 0.5s ease-out;
}

@keyframes krpp-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.krpp-banner-discount-wrapper[data-animation="slide"] .krpp-product-card {
    animation: krpp-slide-in 0.5s ease-out;
}

@keyframes krpp-slide-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

[dir="rtl"] .krpp-banner-discount-wrapper[data-animation="slide"] .krpp-product-card {
    animation: krpp-slide-in-rtl 0.5s ease-out;
}

@keyframes krpp-slide-in-rtl {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.krpp-banner-discount-wrapper[data-animation="zoom"] .krpp-product-card {
    animation: krpp-zoom-in 0.5s ease-out;
}

@keyframes krpp-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.krpp-banner-discount-wrapper[data-animation="bounce"] .krpp-product-card {
    animation: krpp-bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes krpp-bounce-in {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(0);
    }
}

/* Stagger Animation */
.krpp-product-card:nth-child(1) {
    animation-delay: 0s;
}

.krpp-product-card:nth-child(2) {
    animation-delay: 0.1s;
}

.krpp-product-card:nth-child(3) {
    animation-delay: 0.2s;
}

.krpp-product-card:nth-child(4) {
    animation-delay: 0.3s;
}

.krpp-product-card:nth-child(5) {
    animation-delay: 0.4s;
}

.krpp-product-card:nth-child(6) {
    animation-delay: 0.5s;
}

.krpp-product-card:nth-child(n+7) {
    animation-delay: 0.6s;
}

/* Accessibility */
.krpp-product-card-title a:focus,
.krpp-product-card-image a:focus {
    outline: 2px solid var(--krpp-discount-badge-bg);
    outline-offset: 2px;
}

/* Countdown Pulse Animation */
.krpp-countdown-display.krpp-countdown-pulse {
    animation: krpp-pulse 1s ease-in-out infinite;
}

@keyframes krpp-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.3);
    }
}

/* Countdown Complete State */
.krpp-countdown-display.krpp-countdown-complete {
    opacity: 0.6;
}

/* Smooth Transitions */
.krpp-countdown-value {
    transition: all 0.3s ease;
    display: inline-block;
}

/* Countdown Flip Animation - Only animate when value changes */
.krpp-countdown-value.krpp-countdown-flip {
    animation: krpp-countdown-flip 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    will-change: transform, opacity;
}

@keyframes krpp-countdown-flip {
    0% {
        transform: rotateX(0deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: rotateX(90deg) scale(0.8);
        opacity: 0.3;
    }
    100% {
        transform: rotateX(0deg) scale(1);
        opacity: 1;
    }
}

/* Product Card Hover Effects */
.krpp-product-card:hover .krpp-product-card-content {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.02) 0%, rgba(231, 76, 60, 0.05) 100%);
}

/* Print Styles */
@media print {
    .krpp-countdown-container {
        display: none;
    }

    .krpp-product-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
