/**
 * UA Top Offer - Frontend CSS
 * Version: 2.3.6 - Logo unter 460px ausblenden
 */

/* Container - Fullwidth */
.ua-top-offer-wrapper {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow: visible;
    min-height: 400px;
}

/* Hintergrund */
.ua-top-offer-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
    display: block;
}

.ua-top-offer-bg-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.7);
    transform: scale(1.1);
    z-index: 0;
}

.ua-top-offer-bg-solid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.ua-top-offer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2;
}

/* Content */
.ua-top-offer-content {
    position: relative;
    z-index: 3;
    padding: clamp(30px, 6vw, 50px) clamp(3%, 5vw, 5%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.ua-top-offer-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* ========================================
   BANNER - Linear Responsive
   ======================================== */

.ua-banner {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 1 auto;
    max-width: 100%;
    min-width: 0;
    position: relative;
    
    padding: clamp(10px, 2vw, 20px) 
             clamp(20px, 6vw, 70px) 
             clamp(13px, 2.5vw, 25px) 
             clamp(28px, 5vw, 60px);
    
    background:
        repeating-linear-gradient(-45deg,
            rgba(255,255,255,0.05) 0 8px,
            transparent 8px 16px),
        var(--ua-banner-color, #2f4449);
    
    clip-path: polygon(
        0 0,
        100% 0,
        100% calc(100% - clamp(12px, 2.5vw, 24px)),
        calc(100% - clamp(12px, 2.5vw, 24px)) 100%,
        0 100%
    );
    
    border-radius: 4px;
    box-shadow: 0 clamp(3px, 1vw, 8px) clamp(10px, 2.5vw, 24px) rgba(0,0,0,0.3);
    
    animation: slideInLeft 0.6s ease-out backwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Wrapper für Banner + Logo (Logo außerhalb clip-path) */
.ua-banner-row {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2.5vw, 30px);
    margin: clamp(6px, 1.5vw, 12px) 0;
    position: relative;
}

/* Banner mit Logo braucht extra Platz rechts */
.ua-banner.has-inline-logo {
    padding-right: clamp(30px, 8vw, 90px);
}

.ua-banner::before {
    content: "";
    position: absolute;
    left: clamp(12px, 2.5vw, 32px);
    top: clamp(10px, 2vw, 20px);
    bottom: clamp(13px, 2.5vw, 25px);
    width: clamp(4px, 0.6vw, 7px);
    border-radius: 3px;
    background-color: #fabe0c;
}

.ua-banner:hover {
    transform: translateX(clamp(4px, 1vw, 8px));
    box-shadow: 0 clamp(4px, 1.5vw, 12px) clamp(12px, 3vw, 32px) rgba(0,0,0,0.35);
}

/* Banner Text Container */
.ua-banner-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ua-banner h2,
.ua-banner h3 {
    margin: 0;
    padding: 0;
    font-weight: 700;
    line-height: 1.15;
    color: var(--ua-banner-text-color, #FFFFFF);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    position: relative;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Subtitle Styling */
.ua-banner-subtitle {
    display: block;
    font-size: clamp(11px, 1.6vw, 16px);
    font-weight: 500;
    color: var(--ua-banner-text-color, #FFFFFF);
    opacity: 0.85;
    margin-top: clamp(3px, 0.5vw, 6px);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.ua-banner-1 {
    animation-delay: 0.2s;
}

.ua-banner-1 h2 {
    font-size: clamp(calc(var(--ua-heading-base) * 0.5), 4vw, var(--ua-heading-base));
}

.ua-banner-row:nth-child(2) {
    margin-left: clamp(15px, 3.5vw, 50px);
}

.ua-banner-2 {
    animation-delay: 0.4s;
}

.ua-banner-2 h3 {
    font-size: clamp(calc(var(--ua-heading-base) * 0.5), 3.2vw, var(--ua-heading-base));
}

/* ========================================
   JAVASCRIPT-GESTEUERTES PILL-LAYOUT
   ======================================== */

/* Default: Pill rechts neben Banner 1 (Flexbox) */
.ua-price-badge {
    flex-shrink: 0;
    align-self: center;
    transform: rotate(12deg);
    z-index: 10;
    transition: transform 0.3s ease, margin 0.3s ease;
    margin-left: clamp(20px, 3vw, 40px);
}

/* Pop-Animation nur beim ersten Laden */
.ua-price-badge:not(.pop-done) {
    animation: priceBadgePop 0.5s ease-out 0.8s backwards;
}

.ua-price-badge:hover {
    transform: rotate(10deg) scale(1.05);
}

/* Wecker-Wackel-Animation */
.ua-price-badge.shake {
    animation-name: weckerShake;
    animation-duration: 0.6s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: none;
}

@keyframes weckerShake {
    0% { 
        transform: rotate(12deg); 
    }
    10%, 30%, 50% { 
        transform: rotate(8deg); 
    }
    20%, 40%, 60% { 
        transform: rotate(16deg); 
    }
    70%, 100% { 
        transform: rotate(12deg); 
    }
}

/* Wenn JavaScript entscheidet: Pill muss unter Banner 2 */
.ua-top-offer-inner.pill-below {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "banner1"
        "banner2"
        "price"
        "cta";
    gap: clamp(6px, 1.5vw, 12px);
}

.ua-top-offer-inner.pill-below .ua-banner-row:nth-child(1) {
    display: contents;
}

.ua-top-offer-inner.pill-below .ua-banner-row:nth-child(1) .ua-banner {
    grid-area: banner1;
    width: fit-content;
    max-width: 100%;
}

.ua-top-offer-inner.pill-below .ua-banner-row:nth-child(1) .ua-price-badge {
    grid-area: price;
    margin-left: clamp(15px, 3.5vw, 50px);
    transform: rotate(8deg);
    width: fit-content;
    max-width: calc(100% - clamp(15px, 3.5vw, 50px));
}

.ua-top-offer-inner.pill-below .ua-banner-row:nth-child(1) .ua-price-badge.shake {
    animation-name: weckerShakeBelow;
    animation-duration: 0.6s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: none;
}

@keyframes weckerShakeBelow {
    0% { 
        transform: rotate(8deg); 
    }
    10%, 30%, 50% { 
        transform: rotate(4deg); 
    }
    20%, 40%, 60% { 
        transform: rotate(12deg); 
    }
    70%, 100% { 
        transform: rotate(8deg); 
    }
}

.ua-top-offer-inner.pill-below .ua-banner-row:nth-child(2) {
    grid-area: banner2;
    width: fit-content;
    max-width: 100%;
}

.ua-top-offer-inner.pill-below .ua-banner-row:nth-child(2) .ua-banner {
    width: fit-content;
    max-width: 100%;
}

.ua-top-offer-inner.pill-below .ua-cta-box {
    grid-area: cta;
    width: fit-content;
    max-width: 100%;
}

.ua-top-offer-inner.pill-below .ua-price-badge:hover {
    transform: rotate(6deg) scale(1.02);
}

/* ========================================
   PREIS-PILL
   ======================================== */

.ua-price-pill {
    background: linear-gradient(145deg, #fabe0c 0%, #e5a800 100%);
    color: #2f4449;
    padding: clamp(10px, 1.5vw, 14px) clamp(18px, 2.5vw, 28px);
    border-radius: 40px;
    box-shadow: 
        0 6px 20px rgba(250, 190, 12, 0.4),
        0 3px 8px rgba(0, 0, 0, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ua-price-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.ua-price-badge-label {
    font-size: clamp(14px, 1.8vw, 18px);
    font-weight: 600;
    opacity: 0.8;
}

.ua-price-badge-value {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.ua-price-badge-note {
    font-size: clamp(9px, 1vw, 11px);
    font-weight: 500;
    opacity: 0.6;
    margin-top: 2px;
}

@keyframes priceBadgePop {
    0% {
        opacity: 0;
        transform: rotate(12deg) scale(0.5);
    }
    60% {
        transform: rotate(12deg) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: rotate(12deg) scale(1);
    }
}

/* ========================================
   LOGO
   ======================================== */

.ua-banner-logo {
    display: inline-block;
    vertical-align: middle;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    width: auto;
    object-fit: contain;
}

.ua-banner-logo-inline {
    /* Negativer Margin zieht Logo näher an Banner */
    margin-left: -20px;
}

.ua-banner-logo-end {
    margin-left: clamp(12px, 2vw, 20px);
    position: relative;
    z-index: 20;
}

.ua-banner-logo-outside {
    width: auto;
    flex-shrink: 0;
}

.ua-banner.has-logo-outside {
    /* Kein extra margin mehr nötig, Logo ist jetzt neben Banner */
}

/* ========================================
   CTA BUTTON
   ======================================== */

.ua-cta-box {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: clamp(10px, 1.5vw, 14px) clamp(16px, 2.5vw, 24px);
    margin-top: clamp(12px, 2vw, 20px);
    margin-left: clamp(10px, 2vw, 20px);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-decoration: none;
    transition: all 0.3s ease;
    animation: slideInUp 0.6s ease-out 0.6s backwards;
    max-width: fit-content;
}

.ua-cta-box:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    text-decoration: none;
}

.ua-cta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: clamp(16px, 2vw, 22px);
    min-width: 40px;
}

.ua-cta-text {
    font-size: clamp(14px, 1.8vw, 18px);
    font-weight: 600;
}

.ua-cta-arrow {
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: bold;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.ua-cta-box:hover .ua-cta-arrow {
    transform: translateX(4px);
}

/* ========================================
   ANIMATIONEN
   ======================================== */

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   QUICKSEARCH
   ======================================== */

.ua-quicksearch-integrated {
    border-radius: 8px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* ========================================
   SEASONAL EFFECTS
   ======================================== */

.ua-seasonal-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    overflow: hidden;
}

.ua-effect-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ========================================
   RESPONSIVE FALLBACKS
   ======================================== */

@media (max-width: 768px) {
    .ua-top-offer-content {
        padding: 30px 15px;
    }
    
    /* Sanfte Verkleinerung - behält ca. 70-80% der Größe */
    .ua-banner-logo-inline,
    .ua-banner-logo-outside {
        transform: scale(0.75);
        transform-origin: left center;
    }
}

@media (max-width: 480px) {
    .ua-banner {
        padding: 10px 20px 14px 35px;
    }
    
    .ua-banner::before {
        left: 12px;
        top: 10px;
        bottom: 14px;
        width: 4px;
    }
    
    .ua-cta-box {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 460px) {
    .ua-banner-logo-inline,
    .ua-banner-logo-outside {
        display: none;
    }
}

/* ========================================
   PRINT
   ======================================== */

@media print {
    .ua-top-offer-wrapper,
    .ua-seasonal-effect {
        display: none;
    }
}
