/* =============================================
   A4W CAROUSEL — Base
   ============================================= */
#a4wcarousel {
    max-width: 100% !important;
    margin: auto !important;
    padding: 0px !important;
    width: 100% !important;
    position: relative;
}

#a4wcarousel.carousel--contained {
    max-width: min(calc(100% - var(--a4w-container-gutter, 2rem)), var(--a4w-container-xxl-max-width, 1320px)) !important;
}

#a4wcarousel .inner-carousel {
    display: block;
    position: relative;
    width: 100%;
    height: 950px;
    overflow: hidden;
}

#a4wcarousel .carousel-item {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

#a4wcarousel .carousel-item.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

/* =============================================
   Navigation arrows
   ============================================= */
#a4wcarousel > .product-prev,
#a4wcarousel > .product-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 999 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.85 !important;
    transition: opacity 0.3s ease !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    visibility: visible !important;
    width: 50px !important;
    height: 50px !important;
}

#a4wcarousel > .product-prev:hover,
#a4wcarousel > .product-next:hover {
    opacity: 1 !important;
}

#a4wcarousel > .product-prev {
    left: 20px !important;
    right: auto !important;
}

#a4wcarousel > .product-next {
    right: 20px !important;
    left: auto !important;
}

#a4wcarousel > .product-prev svg,
#a4wcarousel > .product-next svg {
    width: 50px !important;
    height: 50px !important;
    display: block !important;
}

#a4wcarousel > .product-prev .arrow-bg,
#a4wcarousel > .product-next .arrow-bg {
    fill: #ffffff;
    transition: fill 0.3s ease;
}

#a4wcarousel > .product-prev .arrow-icon,
#a4wcarousel > .product-next .arrow-icon {
    fill: #1a1a1a;
    transition: fill 0.3s ease;
}

#a4wcarousel > .product-prev:hover .arrow-bg,
#a4wcarousel > .product-next:hover .arrow-bg {
    fill: #1a1a1a;
}

#a4wcarousel > .product-prev:hover .arrow-icon,
#a4wcarousel > .product-next:hover .arrow-icon {
    fill: #ffffff;
}

/* =============================================
   Common content elements (shared by all layouts)
   ============================================= */
#a4wcarousel .carousel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

#a4wcarousel .carousel-tag {
    display: block;
    width: fit-content;
    font-size: var(--a4w-carousel-tag-size, 14px);
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 50px;
    background-color: var(--a4w-carousel-tag-bg, #f0f0f0);
    color: var(--background-color, #333);
    line-height: 1;
}

#a4wcarousel .carousel-prefix {
    display: block;
    font-size: var(--a4w-carousel-prefix-size, 24px);
    font-style: italic;
    font-weight: 400;
    color: var(--background-color, #1a1a1a);
    margin-bottom: 8px;
    max-width: var(--a4w-carousel-text-max-width, 840px);
}

#a4wcarousel h2 {
    font-size: var(--a4w-carousel-title-size, 50px);
    font-weight: 800;
    margin: 0 0 20px 0;
    max-width: var(--a4w-carousel-text-max-width, 840px);
    color: var(--background-color, #1a1a1a);
    text-align: left;
    line-height: 1.05;
}

#a4wcarousel .carousel-description {
    font-size: var(--a4w-carousel-desc-size, 18px);
    font-weight: 400;
    line-height: 28px;
    color: var(--a4w-carousel-text-muted, #555);
    margin-bottom: 30px;
    max-width: var(--a4w-carousel-text-max-width, 840px);
    width: 100%;
}

#a4wcarousel .carousel-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* =============================================
   LAYOUT: Background (image behind, content overlay)
   ============================================= */
#a4wcarousel .carousel-layout-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#a4wcarousel .carousel-layout-background picture {
    display: block;
    width: 100%;
    height: 100%;
}

#a4wcarousel .carousel-layout-background picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dark overlay */
#a4wcarousel .carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35); /* fallback, overridden by inline style */
    z-index: 5;
    pointer-events: none;
}

#a4wcarousel .carousel-layout-background .carousel-caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: left;
    z-index: 10;
    padding: 0;
    width: min(calc(100% - var(--a4w-container-gutter, 2rem)), var(--a4w-container-xxl-max-width, 1320px));
}

/* When overlay is present, switch all text to white */
#a4wcarousel .carousel-layout-background .carousel-overlay ~ .carousel-caption {
    --background-color: #fff;
    --a4w-carousel-text-muted: rgba(255, 255, 255, 0.9);
    --a4w-carousel-tag-bg: rgba(255, 255, 255, 0.2);
    --background-color: #fff;
}

/* =============================================
   LAYOUT: Split (content-left / content-right)
   ============================================= */
#a4wcarousel .carousel-split {
    display: flex;
    width: 100%;
    height: 100%;
    border-radius: var(--a4w-carousel-border-radius, 16px);
    overflow: hidden;
    background: var(--a4w-carousel-split-bg, #f5f5f5);
}

#a4wcarousel .carousel-split__content {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 70px;
    box-sizing: border-box;
}

#a4wcarousel .carousel-split__image {
    flex: 0 0 50%;
    overflow: hidden;
    background: var(--a4w-carousel-image-bg, #e8e8e8);
    border-radius: var(--a4w-carousel-border-radius, 16px);
}

#a4wcarousel .carousel-split__image picture {
    display: block;
    width: 100%;
    height: 100%;
}

#a4wcarousel .carousel-split__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =============================================
   Content alignment (left/center/right)
   Applied at tablet & desktop only — mobile keeps centered overrides.
   ============================================= */
@media (min-width: 602px) {
    #a4wcarousel .carousel-item.carousel-align-center .carousel-tags,
    #a4wcarousel .carousel-item.carousel-align-center .carousel-cta {
        justify-content: center;
    }

    #a4wcarousel .carousel-item.carousel-align-center .carousel-prefix,
    #a4wcarousel .carousel-item.carousel-align-center h2,
    #a4wcarousel .carousel-item.carousel-align-center .carousel-description {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    #a4wcarousel .carousel-item.carousel-align-right .carousel-tags,
    #a4wcarousel .carousel-item.carousel-align-right .carousel-cta {
        justify-content: flex-end;
    }

    #a4wcarousel .carousel-item.carousel-align-right .carousel-prefix,
    #a4wcarousel .carousel-item.carousel-align-right h2,
    #a4wcarousel .carousel-item.carousel-align-right .carousel-description {
        text-align: right;
        margin-left: auto;
    }
}

/* =============================================
   Responsive — 1440px
   ============================================= */
@media (max-width: 1440px) {
    #a4wcarousel .inner-carousel {
        height: 800px;
    }

    #a4wcarousel .carousel-split__content {
        padding: 50px 50px;
    }
}

/* =============================================
   Responsive — Tablet (1024px)
   ============================================= */
@media (max-width: 1024px) {
    #a4wcarousel .inner-carousel {
        height: 500px;
    }

    #a4wcarousel h2 {
        font-size: 36px;
    }

    #a4wcarousel .carousel-description {
        font-size: 16px;
        line-height: 24px;
    }

    #a4wcarousel .carousel-split__content {
        padding: 30px 40px;
    }

    #a4wcarousel .carousel-layout-background .carousel-caption {
        padding: 0 40px;
    }

    #a4wcarousel > .product-prev {
        left: 10px !important;
    }

    #a4wcarousel > .product-next {
        right: 10px !important;
    }

    #a4wcarousel > .product-prev,
    #a4wcarousel > .product-next {
        width: 40px !important;
        height: 40px !important;
    }

    #a4wcarousel > .product-prev svg,
    #a4wcarousel > .product-next svg {
        width: 40px !important;
        height: 40px !important;
    }

    .carousel {
        left: 0px !important;
    }
}

/* =============================================
   Responsive — Mobile (601px)
   ============================================= */
@media (max-width: 601px) {
    #a4wcarousel .inner-carousel {
        height: auto;
        min-height: 500px;
    }

    /* Background layout mobile */
    #a4wcarousel .carousel-layout-background {
        position: relative;
        min-height: 500px;
    }

    #a4wcarousel .carousel-layout-background picture img {
        min-height: 500px;
    }

    #a4wcarousel .carousel-layout-background .carousel-caption {
        text-align: center;
        padding: 0 20px;
    }

    #a4wcarousel .carousel-layout-background .carousel-caption h2 {
        text-align: center;
    }

    #a4wcarousel .carousel-layout-background .carousel-cta {
        justify-content: center;
    }

    /* Split layouts stack on mobile */
    #a4wcarousel .carousel-split {
        flex-direction: column;
    }

    #a4wcarousel .carousel-split__content,
    #a4wcarousel .carousel-split__image {
        flex: 0 0 auto;
    }

    #a4wcarousel .carousel-split__image {
        height: 280px;
        order: 1;
    }

    #a4wcarousel .carousel-split__content {
        padding: 30px 20px;
        text-align: center;
        order: 2;
    }

    #a4wcarousel .carousel-split__content h2 {
        text-align: center;
    }

    #a4wcarousel .carousel-split__content .carousel-cta {
        justify-content: center;
    }

    /* Typography mobile */
    #a4wcarousel h2 {
        font-size: 28px;
        line-height: 33px;
    }

    #a4wcarousel .carousel-description {
        font-size: 16px;
        line-height: 22px;
    }

    #a4wcarousel .carousel-prefix {
        font-size: 18px;
    }

    #a4wcarousel > .product-prev,
    #a4wcarousel > .product-next {
        width: 36px !important;
        height: 36px !important;
    }

    #a4wcarousel > .product-prev svg,
    #a4wcarousel > .product-next svg {
        width: 36px !important;
        height: 36px !important;
    }

    #a4wcarousel > .product-prev {
        left: 8px !important;
    }

    #a4wcarousel > .product-next {
        right: 8px !important;
    }
}

/* =============================================
   Responsive — Small mobile
   ============================================= */
@media (max-width: 376px) {
    #a4wcarousel .carousel-layout-background .carousel-caption {
        padding: 0 16px;
    }

    #a4wcarousel .carousel-split__content {
        padding: 24px 16px;
    }
}
