/* ==========================================================================
   Inbuilt Top Bar Ticker (Ditty Replacement) Styles
   Preserves all exact Ditty frontend classes:
   .ditty, .ditty__contents, .ditty__items, .ditty__item, .ditty-item__elements
   ========================================================================== */

.ditty.mlh-ticker-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    line-height: 1.2;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--mlh-ticker-bg, transparent);
    color: var(--mlh-ticker-color, #d9534f);
    padding: var(--mlh-ticker-padding, 4px 0);
    font-size: var(--mlh-ticker-font-size, 13px);
    font-weight: var(--mlh-ticker-font-weight, 400);
    letter-spacing: 0.01em;
}

.ditty.mlh-ticker-wrapper,
.ditty.mlh-ticker-wrapper .ditty__item,
.ditty.mlh-ticker-wrapper .ditty-item__elements,
.ditty.mlh-ticker-wrapper .ditty-item__elements span,
.ditty.mlh-ticker-wrapper .ditty-item__elements a {
    font-weight: var(--mlh-ticker-font-weight, 400) !important;
    font-size: var(--mlh-ticker-font-size, 13px);
}

.ditty.mlh-ticker-wrapper .ditty__contents {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    /* Force track direction LTR so track always scrolls Right to Left in all languages */
    direction: ltr !important;
    text-align: left !important;
}

/* ==========================================================================
   Continuous Marquee / Scrolling Ticker (Strict Right to Left Motion)
   ========================================================================== */
.mlh-ticker--marquee .ditty__contents {
    white-space: nowrap;
    overflow: hidden;
}

.mlh-ticker--marquee .ditty__items {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    width: max-content;
    will-change: transform;
    animation: mlhMarqueeRightToLeft var(--mlh-marquee-duration, 28s) linear infinite;
    list-style: none;
    margin: 0;
    padding: 0;
    direction: ltr !important;
}

/* Pause on hover */
.mlh-ticker--marquee[data-pause-hover="true"]:hover .ditty__items {
    animation-play-state: paused;
}

/* Guaranteed Right-to-Left movement across all languages */
@keyframes mlhMarqueeRightToLeft {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.mlh-ticker--marquee .ditty__item {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    /* Spacing between repeated text items */
    padding: 0 var(--mlh-ticker-item-gap, 50px) !important;
    box-sizing: border-box;
}

/* Absolutely no dots, bullets, or pseudo-elements */
.mlh-ticker--marquee .ditty__item::before,
.mlh-ticker--marquee .ditty__item::after {
    content: none !important;
    display: none !important;
}

/* ==========================================================================
   Fade Animation Mode
   ========================================================================== */
.mlh-ticker--fade .ditty__items {
    position: relative;
    display: block;
    width: 100%;
    min-height: 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mlh-ticker--fade .ditty__item {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    text-align: center;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.mlh-ticker--fade .ditty__item.is-active {
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

/* ==========================================================================
   Slide Up Animation Mode
   ========================================================================== */
.mlh-ticker--slide_up .ditty__items {
    position: relative;
    display: block;
    width: 100%;
    min-height: 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mlh-ticker--slide_up .ditty__item {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(10px);
    visibility: hidden;
    pointer-events: none;
    text-align: center;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
}

.mlh-ticker--slide_up .ditty__item.is-active {
    position: relative;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

/* ==========================================================================
   Static Mode
   ========================================================================== */
.mlh-ticker--none .ditty__items {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mlh-ticker--none .ditty__item {
    text-align: center;
    width: 100%;
}

/* ==========================================================================
   Item Elements & Links
   ========================================================================== */
.ditty-item__elements {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    font-family: inherit;
    white-space: nowrap;
}

.ditty-item__elements a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.ditty-item__elements a:hover {
    text-decoration: underline;
    opacity: 0.85;
}

/* RTL / Arabic specific text rendering inside item */
[dir="rtl"] .ditty-item__elements,
html[lang="ar"] .ditty-item__elements {
    direction: rtl;
    text-align: right;
}

/* Woodmart WHB Top Bar alignment normalization */
.whb-top-bar .ditty {
    height: 100%;
    min-height: 28px;
}
