/* WP Occasion Notifier - Frontend Styles */
/* Version: 1.0.0 */

.won-banner-wrapper {
    width: 100%;
    z-index: 99988;
    transition: all 0.5s ease-out;
}

/* Fixed Positions */
.won-pos-top_fixed {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
}

.won-pos-bottom_fixed {
    position: fixed;
    bottom: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
}

/* Body Padding for Fixed Banner */
body:not(.admin-bar).won-has-top-fixed-banner {
    padding-block-start: 62px !important;
}

body.admin-bar.won-has-top-fixed-banner {
    padding-block-start: 62px !important;
}

body.admin-bar .won-pos-top_fixed {
    top: 32px;
}

/* Banner Structure */
.won-banner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-radius: 0;
    font-weight: 600;
    min-height: 50px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.won-banner a {
    color: inherit;
    text-decoration: none;
}

/* CRITICAL: Force Horizontal Layout */
.won-banner-wrapper .won-banner-inner {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    align-items: center !important;
    flex: 1 !important;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
}

/* Sliders - Force horizontal layout with specificity */
.won-banner-wrapper .won-messages,
.won-banner-wrapper .won-products,
.won-banner-wrapper .won-articles {
    display: inline-block !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    min-height: 24px !important;
    margin: 0 !important;
}

.won-banner-wrapper .won-slider {
    display: inline-block !important;
}

.won-banner-wrapper .won-slider .won-slide {
    display: none !important;
}

.won-banner-wrapper .won-slider .won-slide.won-active {
    display: inline-block !important;
    white-space: nowrap !important;
}

.won-products img, .won-articles img {
    max-height: 30px;
    margin-inline-start: 10px;
    vertical-align: middle;
    border-radius: 4px;
    display: inline-block;
}

.won-products a, .won-articles a {
    vertical-align: middle;
    font-size: 13px;
    font-weight: bold;
    color: inherit !important;
    display: inline-block;
}

.won-messages span, .won-messages a {
    display: inline-block;
    vertical-align: middle;
}

.won-right {
    display: flex;
    align-items: center;
}

/* Timer */
.won-timer {
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
    margin-inline-start: 20px;
    font-size: 10px;
}

.won-time-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 35px;
}

.won-time-number {
    font-size: 18px;
    font-weight: bold;
}

/* Close Button */
.won-close {
    background: none;
    border: 2px solid currentColor;
    color: inherit;
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.won-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Animations */
.won-animate-slide {
    opacity: 0;
}

.won-pos-top_fixed.won-animate-slide {
    transform: translateY(-100%);
    opacity: 1;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.won-pos-top_fixed.won-animate-slide.won-show {
    transform: translateY(0);
}

.won-pos-bottom_fixed.won-animate-slide {
    transform: translateY(100%);
    opacity: 1;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.won-pos-bottom_fixed.won-animate-slide.won-show {
    transform: translateY(0);
}

.won-animate-fade {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.won-animate-fade.won-show {
    opacity: 1;
}

/* Mobile Icon Trigger */
.won-icon-trigger {
    display: none;
    position: fixed;
    bottom: 20px;
    inset-inline-end: 20px;
    z-index: 1500;
    width: 50px;
    height: 50px;
    padding: 0;
    background-color: #ff6600;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 50px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease-in-out;
}

.won-icon-trigger:hover {
    background-color: #cc5200;
}

/* Responsive Design */
@media (max-width: 992px) {
    .won-banner {
        padding: 8px 10px;
    }
    
    .won-banner-inner {
        gap: 15px;
        font-size: 13px !important;
    }
    
    .won-timer {
        gap: 5px;
        margin-inline-start: 10px;
    }
    
    .won-time-segment {
        padding: 0 4px;
        min-width: 30px;
    }
    
    .won-time-label {
        font-size: 9px;
    }
    
    .won-time-number {
        font-size: 16px;
    }
}

@media (max-width: 600px) {
    .won-banner {
        flex-direction: column;
        align-items: center;
        padding: 8px 5px;
    }
    
    .won-banner-inner {
        width: 100%;
        order: 1;
        gap: 8px;
        font-size: 12px !important;
        margin-block-end: 5px;
    }
    
    .won-right {
        width: 95%;
        order: 2;
        justify-content: center;
        margin-block-start: 5px;
    }
    
    .won-close {
        display: none;
    }
    
    .won-banner-wrapper {
        display: none !important;
    }
    
    .won-icon-trigger {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    body:not(.admin-bar).won-has-top-fixed-banner {
        padding-block-start: 0 !important;
    }
    
    body.admin-bar.won-has-top-fixed-banner {
        padding-block-start: 32px !important;
    }
    
    .won-banner-wrapper.won-mobile-open {
        display: block !important;
        position: fixed;
        bottom: 90px;
        inset-inline-end: 20px;
        top: auto;
        inset-inline-start: auto;
        width: 80%;
        max-width: 260px;
        min-height: 100px;
        border-radius: 8px;
        overflow: hidden;
        z-index: 1490;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
        transform: scale(0.8) translateY(20px);
        opacity: 0;
        transition: all 0.3s ease-out;
    }
    
    .won-banner-wrapper.won-mobile-open.won-show-animate {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    
    .won-banner-wrapper.won-mobile-open .won-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
        height: 100%;
        box-shadow: none;
        background-color: rgba(255, 255, 255, 0.85);
    }
    
    .won-banner-wrapper.won-mobile-open .won-right {
        width: 100%;
        justify-content: space-between;
        order: 1;
        margin-block-end: 10px;
        padding-block-end: 5px;
        border-block-end: 1px solid rgba(0,0,0,0.1);
    }
    
    .won-banner-wrapper.won-mobile-open .won-banner-inner {
        order: 2;
        margin-block-start: 10px;
    }
}

/* Inline/Shortcode Position */
.won-pos-inline .won-banner {
    display: flex;
    flex-wrap: wrap;
    padding: 5px 10px;
    min-height: auto;
}

.won-pos-inline .won-banner-inner {
    flex-grow: 1;
    flex-basis: 70%;
    min-width: 250px;
}

.won-pos-inline .won-right {
    flex-basis: auto;
}

@media (max-width: 600px) {
    .won-pos-inline .won-banner {
        flex-direction: column;
    }
    
    .won-pos-inline .won-banner-inner,
    .won-pos-inline .won-right {
        width: 100%;
    }
}
