/* ══════════════════════════════════════════
   EMOCJOLANDIA HERO SLIDER - FRONTEND STYLES
══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Nunito+Sans:wght@400;600;700&display=swap');

.ems-hero-slider {
    position: relative;
    overflow: hidden;
    height: var(--slider-height, 560px);
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ems-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
    transform: translateX(30px);
    pointer-events: none;
}

.ems-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.ems-slide-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ══════════════════════════════════════════
   BACKGROUND IMAGE (Vilgain style)
══════════════════════════════════════════ */

.ems-slide-bg-image {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60%;
    z-index: 0;
    overflow: hidden;
}

.ems-slide-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Position: Right (default, like Vilgain) */
.ems-bg-right .ems-slide-bg-image {
    right: 0;
    left: auto;
}

.ems-bg-right .ems-slide-bg-image img {
    object-position: left center;
}

/* Position: Left */
.ems-bg-left .ems-slide-bg-image {
    left: 0;
    right: auto;
}

.ems-bg-left .ems-slide-bg-image img {
    object-position: right center;
}

/* Position: Center (full width) */
.ems-bg-center .ems-slide-bg-image {
    left: 0;
    right: 0;
    width: 100%;
}

.ems-bg-center .ems-slide-bg-image img {
    object-position: center;
}

/* Slide with bg image needs white/light background for text readability */
.ems-bg-right,
.ems-bg-left {
    background: #f8f8f8 !important;
}

.ems-bg-center {
    background: transparent !important;
}

/* Text color for light backgrounds */
.ems-bg-right .ems-slide-text,
.ems-bg-left .ems-slide-text {
    color: #1a1a1a;
}

.ems-bg-right .ems-slide-badge,
.ems-bg-left .ems-slide-badge {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
    color: #333;
}

.ems-bg-right .ems-slide-sub,
.ems-bg-left .ems-slide-sub {
    color: #555;
}

.ems-bg-right .ems-btn-s,
.ems-bg-left .ems-btn-s {
    background: transparent;
    border-color: #333;
    color: #333;
}

.ems-bg-right .ems-btn-s:hover,
.ems-bg-left .ems-btn-s:hover {
    background: rgba(0,0,0,0.05);
}

.ems-slide-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 80px;
    width: 100%;
    gap: 40px;
    position: relative;
    z-index: 2;
}

/* Position variant - text on right */
.ems-slide-inner.ems-position-right {
    flex-direction: row-reverse;
}

.ems-slide-inner.ems-position-right .ems-slide-text {
    text-align: right;
}

.ems-slide-inner.ems-position-right .ems-slide-btns {
    justify-content: flex-end;
}

/* Text only mode - no products, text stays left */
.ems-slide.ems-text-only .ems-slide-inner {
    justify-content: flex-start;
}

.ems-slide.ems-text-only .ems-slide-text {
    max-width: 550px;
    flex: 0 0 auto;
}

/* ── SLIDE TEXT ── */
.ems-slide-text {
    flex: 1;
    color: white;
}

.ems-slide-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 18px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.ems-slide-title {
    font-family: 'Nunito', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.12;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.ems-slide-sub {
    font-size: 1.05rem;
    font-weight: 600;
    opacity: 0.92;
    margin: 0 0 32px 0;
    max-width: 440px;
    line-height: 1.65;
}

.ems-slide-btns {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.ems-btn-p {
    background: white;
    padding: 14px 30px;
    border-radius: 40px;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6B2D8B;
}

.ems-btn-p:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    color: #6B2D8B;
}

.ems-btn-s {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.6);
    padding: 13px 28px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.ems-btn-s:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    color: white;
}

/* ── VISUAL AREA ── */
.ems-slide-visual {
    flex: 0 0 400px;
    height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ems-glow-blob {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    filter: blur(60px);
    pointer-events: none;
}

/* ── FLOATING PRODUCT GRID ── */
.ems-prod-float-grid {
    display: grid;
    gap: 18px;
    transform: rotate(-4deg);
    position: relative;
    z-index: 1;
}

/* Layout variants */
.ems-prod-float-grid.ems-layout-1 {
    grid-template-columns: 1fr;
    max-width: 200px;
}

.ems-prod-float-grid.ems-layout-2 {
    grid-template-columns: 1fr 1fr;
    max-width: 360px;
}

.ems-prod-float-grid.ems-layout-3 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 480px;
}

.ems-prod-float-grid.ems-layout-3 .ems-prod-float-card {
    width: 140px;
    height: 140px;
}

.ems-prod-float-grid.ems-layout-4 {
    grid-template-columns: 1fr 1fr;
}

.ems-prod-float-grid.ems-layout-5 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 480px;
}

.ems-prod-float-grid.ems-layout-5 .ems-prod-float-card:nth-child(4),
.ems-prod-float-grid.ems-layout-5 .ems-prod-float-card:nth-child(5) {
    grid-column: span 1;
}

.ems-prod-float-grid.ems-layout-5 .ems-prod-float-card {
    width: 130px;
    height: 130px;
}

.ems-prod-float-grid.ems-layout-6 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 480px;
}

.ems-prod-float-grid.ems-layout-6 .ems-prod-float-card {
    width: 130px;
    height: 130px;
}

.ems-prod-float-card {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, calc(var(--card-bg-opacity, 0.25) + 0.1)), 
        rgba(255, 255, 255, var(--card-bg-opacity, 0.25)));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, calc(var(--card-bg-opacity, 0.25) + 0.3));
    border-radius: 24px;
    width: 165px;
    height: 165px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: emsFloatUp 4s ease-in-out infinite;
    transition: transform 0.3s;
}

.ems-prod-float-card:hover {
    transform: scale(1.06) rotate(2deg);
}

.ems-prod-float-card:nth-child(1) { animation-delay: 0s; }
.ems-prod-float-card:nth-child(2) { animation-delay: 0.7s; }
.ems-prod-float-card:nth-child(3) { animation-delay: 1.4s; }
.ems-prod-float-card:nth-child(4) { animation-delay: 2.1s; }
.ems-prod-float-card:nth-child(5) { animation-delay: 2.8s; }
.ems-prod-float-card:nth-child(6) { animation-delay: 3.5s; }

/* Wyłącz animację unoszenia */
.ems-no-float .ems-prod-float-card {
    animation: none;
}

.ems-no-float .ems-prod-float-card:hover {
    transform: scale(1.04);
}

@keyframes emsFloatUp {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

.ems-prod-float-card img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2));
    mix-blend-mode: multiply;
}

/* ══════════════════════════════════════════
   CARD SIZE VARIANTS
══════════════════════════════════════════ */

/* Small cards */
.ems-cards-small .ems-prod-float-card {
    width: 120px;
    height: 120px;
    border-radius: 18px;
}

.ems-cards-small .ems-prod-float-card img {
    width: 95px;
    height: 95px;
}

.ems-cards-small .ems-prod-float-grid {
    gap: 12px;
}

.ems-cards-small .ems-prod-hero-single {
    width: 280px;
    height: 320px;
}

/* Medium cards (default) */
.ems-cards-medium .ems-prod-float-card {
    width: 165px;
    height: 165px;
}

.ems-cards-medium .ems-prod-float-card img {
    width: 130px;
    height: 130px;
}

/* Large cards */
.ems-cards-large .ems-prod-float-card {
    width: 200px;
    height: 200px;
    border-radius: 28px;
}

.ems-cards-large .ems-prod-float-card img {
    width: 160px;
    height: 160px;
}

.ems-cards-large .ems-prod-float-grid {
    gap: 22px;
}

.ems-cards-large .ems-prod-hero-single {
    width: 420px;
    height: 460px;
}

.ems-cards-large .ems-slide-visual {
    flex: 0 0 480px;
}

.ems-product-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

/* ── SINGLE HERO PRODUCT ── */
.ems-prod-hero-single {
    position: relative;
    width: 360px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, calc(var(--card-bg-opacity, 0.25) + 0.1)), 
        rgba(255, 255, 255, var(--card-bg-opacity, 0.25)));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, calc(var(--card-bg-opacity, 0.25) + 0.3));
    border-radius: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    padding: 24px;
    animation: emsFloatUp 4s ease-in-out infinite;
    transition: transform 0.3s;
}

.ems-prod-hero-single:hover {
    transform: scale(1.03);
}

/* Wyłącz animację dla pojedynczego obrazka */
.ems-no-float .ems-prod-hero-single {
    animation: none;
}

.ems-no-float .ems-prod-hero-single:hover {
    transform: scale(1.02);
}

.ems-prod-hero-single img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.25));
    mix-blend-mode: multiply;
}

/* ── NAVIGATION ── */
.ems-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    z-index: 10;
}

.ems-slider-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.08);
}

.ems-arrow-prev { left: 24px; }
.ems-arrow-next { right: 24px; }

.ems-slider-nav {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 10;
}

.ems-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    padding: 0;
}

.ems-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.ems-dot.active {
    background: white;
    transform: scale(1.3);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.ems-slide-counter {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 10;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    background: rgba(0, 0, 0, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
}

/* ══════════════════════════════════════════
   TRUST BAR
══════════════════════════════════════════ */

.ems-trust-bar {
    background: #fff;
    border-bottom: 1px solid #ede8e2;
    padding: 24px 0;
}

.ems-trust-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ems-trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.ems-trust-item + .ems-trust-item {
    border-left: 1px solid #ede8e2;
    padding-left: 20px;
}

.ems-trust-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.ems-trust-icon-img {
    width: 44px;
    height: 44px;
}

.ems-trust-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ems-trust-item div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ems-trust-item strong {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #2C1810;
    white-space: nowrap;
}

.ems-trust-item span {
    font-size: 0.75rem;
    color: #888;
    font-weight: 600;
    white-space: nowrap;
}

/* ══════════════════════════════════════════
   RESPONSYWNOŚĆ – TABLET
══════════════════════════════════════════ */

@media (max-width: 1024px) {
    .ems-hero-slider {
        height: calc(var(--slider-height, 560px) - 40px);
    }
    
    .ems-slide-inner {
        padding: 0 60px;
        gap: 30px;
    }
    
    .ems-slide-title { font-size: 2.5rem; }
    .ems-slide-sub { font-size: 1rem; }
    
    .ems-slide-visual { flex: 0 0 340px; height: 380px; }
    
    .ems-prod-float-card { width: 145px; height: 145px; }
    .ems-prod-float-card img { width: 110px; height: 110px; }
    
    .ems-prod-hero-single { width: 300px; height: 340px; }
    
    .ems-trust-inner { flex-wrap: wrap; justify-content: center; }
    .ems-trust-item { flex: 0 0 auto; }
    .ems-trust-item + .ems-trust-item { border-left: none; padding-left: 0; }
}

/* ══════════════════════════════════════════
   RESPONSYWNOŚĆ – MOBILE
══════════════════════════════════════════ */

@media (max-width: 768px) {
    .ems-hero-slider {
        height: auto;
        min-height: 100svh;
    }
    
    .ems-slide {
        align-items: flex-start;
        padding: 40px 0 100px;
    }
    
    /* Background image on mobile - goes below text */
    .ems-slide-bg-image {
        position: relative;
        width: 100%;
        height: 50vh;
        min-height: 300px;
        order: 2;
        margin-top: 32px;
    }
    
    .ems-bg-right .ems-slide-bg-image,
    .ems-bg-left .ems-slide-bg-image {
        left: 0;
        right: 0;
    }
    
    .ems-bg-right .ems-slide-bg-image img,
    .ems-bg-left .ems-slide-bg-image img {
        object-position: center top;
    }
    
    /* Slide with bg image - flex column layout */
    .ems-bg-right .ems-slide,
    .ems-bg-left .ems-slide,
    .ems-bg-center .ems-slide {
        flex-direction: column;
        padding-bottom: 0;
    }
    
    .ems-slide-inner {
        flex-direction: column;
        padding: 0 24px;
        gap: 32px;
        text-align: center;
    }
    
    .ems-slide-text { order: 1; }
    .ems-slide-visual { order: 2; }
    
    .ems-slide-badge {
        font-size: 0.72rem;
        padding: 5px 12px;
        margin-bottom: 14px;
    }
    
    .ems-slide-title {
        font-size: 2rem;
        margin-bottom: 12px;
    }
    
    .ems-slide-sub {
        font-size: 0.95rem;
        margin-bottom: 24px;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .ems-slide-btns {
        justify-content: center;
        gap: 12px;
    }
    
    .ems-btn-p,
    .ems-btn-s {
        padding: 12px 22px;
        font-size: 0.88rem;
        width: 100%;
        justify-content: center;
    }
    
    .ems-slide-visual {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        min-height: 280px;
    }
    
    .ems-glow-blob {
        width: 200px;
        height: 200px;
    }
    
    .ems-prod-float-grid {
        gap: 12px;
        transform: rotate(-2deg);
    }
    
    .ems-prod-float-card {
        width: 120px;
        height: 120px;
        border-radius: 18px;
    }
    
    .ems-prod-float-card img {
        width: 90px;
        height: 90px;
    }
    
    .ems-prod-hero-single {
        width: 240px;
        height: 260px;
    }
    
    /* Card sizes on mobile - scale down */
    .ems-cards-small .ems-prod-float-card {
        width: 100px;
        height: 100px;
    }
    .ems-cards-small .ems-prod-float-card img {
        width: 75px;
        height: 75px;
    }
    
    .ems-cards-medium .ems-prod-float-card {
        width: 120px;
        height: 120px;
    }
    .ems-cards-medium .ems-prod-float-card img {
        width: 90px;
        height: 90px;
    }
    
    .ems-cards-large .ems-prod-float-card {
        width: 140px;
        height: 140px;
    }
    .ems-cards-large .ems-prod-float-card img {
        width: 110px;
        height: 110px;
    }
    .ems-cards-large .ems-slide-visual {
        flex: 0 0 auto;
    }
    .ems-cards-large .ems-prod-hero-single {
        width: 280px;
        height: 300px;
    }
    
    /* Position on mobile - always column, but order changes */
    .ems-slide-inner.ems-position-right {
        flex-direction: column;
    }
    .ems-slide-inner.ems-position-right .ems-slide-text {
        order: 1;
        text-align: center;
    }
    .ems-slide-inner.ems-position-right .ems-slide-visual {
        order: 2;
    }
    
    /* Grid layouts on mobile - force 2 columns for 3+ items */
    .ems-prod-float-grid.ems-layout-3,
    .ems-prod-float-grid.ems-layout-5,
    .ems-prod-float-grid.ems-layout-6 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 280px;
    }
    
    .ems-prod-float-grid.ems-layout-3 .ems-prod-float-card,
    .ems-prod-float-grid.ems-layout-5 .ems-prod-float-card,
    .ems-prod-float-grid.ems-layout-6 .ems-prod-float-card {
        width: 110px;
        height: 110px;
    }
    
    .ems-prod-float-grid.ems-layout-3 .ems-prod-float-card img,
    .ems-prod-float-grid.ems-layout-5 .ems-prod-float-card img,
    .ems-prod-float-grid.ems-layout-6 .ems-prod-float-card img {
        width: 80px;
        height: 80px;
    }
    
    .ems-slider-arrow {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
    
    .ems-arrow-prev { left: 12px; }
    .ems-arrow-next { right: 12px; }
    
    .ems-slider-nav {
        bottom: 20px;
        gap: 12px;
    }
    
    .ems-dot {
        width: 10px;
        height: 10px;
    }
    
    .ems-slide-counter {
        top: 16px;
        right: 16px;
        font-size: 0.75rem;
        padding: 5px 12px;
    }
    
    /* Trust bar mobile */
    .ems-trust-bar { padding: 20px 0; }
    
    .ems-trust-inner {
        flex-direction: column;
        gap: 16px;
        padding: 0 20px;
    }
    
    .ems-trust-item {
        width: 100%;
        justify-content: center;
        padding: 12px 0;
        border-bottom: 1px solid #ede8e2;
    }
    
    .ems-trust-item:last-child { border-bottom: none; }
    .ems-trust-item + .ems-trust-item {
        border-left: none;
        padding-left: 0;
    }
}

/* ══════════════════════════════════════════
   RESPONSYWNOŚĆ – MAŁE TELEFONY
══════════════════════════════════════════ */

@media (max-width: 400px) {
    .ems-slide-title { font-size: 1.7rem; }
    .ems-slide-sub { font-size: 0.9rem; }
    
    .ems-prod-float-card {
        width: 100px;
        height: 100px;
    }
    
    .ems-prod-float-card img {
        width: 75px;
        height: 75px;
    }
    
    .ems-prod-hero-single {
        width: 200px;
        height: 220px;
    }
}
