/* Widget Banner — layout per banner type (Fixed vs Carousel) */
/* wrapper ของ slider ต้องมี position */
.owl-carousel {
    position: relative;
}

.owl-nav {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none; /* ให้คลิกทะลุ ยกเว้นปุ่ม */
}

/* ปุ่มพื้นฐาน */
.owl-nav button {
    position: relative;
}

/* ซ่อนตัวอักษรเดิม */
.owl-nav button span {
    display: none;
}

/* ใส่รูปแทน */
.owl-prev::before,
.owl-next::before {
    content: "";
    width: 30px;
    height: 30px;
    display: block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: auto;
}

/* รูปซ้าย */
.owl-prev::before {
    background-image: url("../media/wckidsya/arrowleft_white.png");
    position: absolute;
    left: 120px;
}

/* รูปขวา */
.owl-next::before {
    background-image: url("../media/5dybyi0t/arrowright_white.png");
    position: absolute;
    left: -120px;
}

/* hover */
.owl-nav button:hover {
    background-color: rgba(0, 0, 0, 0) !important;
}

.owl-nav button {
    pointer-events: all;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-banner__nav {
    font-size: 40px;
    line-height: 1;
}

.owl-nav button:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.1);
}

.owl-prev {
    margin-left: 20px;
}

.owl-next {
    margin-right: 20px;
}

.widget-banner__editor-title {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.widget-banner__content-before,
.widget-banner__content-after {
    margin-bottom: 1rem;
}

.widget-banner__content-article {
    margin-top: 1rem;
}

.widget-banner__disclaimer {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* --- Fixed Banner --- */
.widget-banner__panel--fixed {
    border: var(--wb-border);
    border-radius: var(--wb-radius);
    box-shadow: var(--wb-shadow);
    overflow: hidden;
    background: #fff;
}

.widget-banner__fixed {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

/* Fixed — รูปเดียวเต็มความกว้าง */
.widget-banner__fixed--image-only {
    padding: 0;
    position: relative;
}

.widget-banner__fixed--image-only .widget-banner__picture {
    border-radius: var(--wb-radius);
}

.widget-banner__hero-title {
    width: 100%;
}

.widget-banner__title-banner {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
}

.widget-banner__description,
.widget-banner__prospectus {
    line-height: 1.6;
}

.widget-banner__picture {
    margin: 0;
    border-radius: calc(var(--wb-radius) - 4px);
    overflow: hidden;
    background: #f4f4f4;
}

.widget-banner__image {
    display: block;
    width: 100%;
    height: auto;
}

.widget-banner__actions {
    margin: 0;
}

.widget-banner__button {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    background: #c61f26;
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    transition:
        background 0.2s ease,
        transform 0.15s ease;
}

.widget-banner__button:hover {
    background: #a0181e;
    color: #fff !important;
    transform: translateY(-1px);
}

/* --- Carousel --- */
.widget-banner__panel--carousel {
    position: relative;
}

.widget-banner__carousel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: #6c757d;
}

.widget-banner__carousel {
    border-radius: var(--wb-radius);
    overflow: hidden;
}

.widget-banner__slide {
    height: 100%;
    border: var(--wb-border);
    border-radius: var(--wb-radius);
    box-shadow: var(--wb-shadow);
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.widget-banner__slide-title {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.75rem 1rem 0;
    line-height: 1.35;
}

.widget-banner__slide-desc {
    padding: 0.35rem 1rem 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #444;
    flex: 1;
}

.widget-banner__slide-picture {
    margin: 0;
    order: -1;
    /* aspect-ratio: 16 / 9; */
    background: #eee;
}

.widget-banner__slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.widget-banner__slide-actions {
    margin: 0;
    padding: 0.75rem 1rem 1rem;
}

.widget-banner__slide-link {
    font-weight: 600;
    color: #c61f26;
    text-decoration: none;
}

.widget-banner__slide-link:hover {
    text-decoration: underline;
}

.widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav button::before,
.widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-prev::before,
.widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-next::before {
    content: none !important;
    display: none !important;
    background: none !important;
}

.widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav button img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* รูปลูกศรน้ำเงิน: ไม่ใช้ flex บน carousel — ใช้ position ยึด <img> ซ้าย/ขวา กึ่งกลางแนวสไลด์ (เว้นโซน dots) */
.widget-banner__carousel[data-widget-banner-nav="images"] {
    position: relative;
    box-sizing: border-box;
    padding: 0 0.5rem;
    overflow: visible;
}

.widget-banner__carousel[data-widget-banner-nav="images"] .owl-stage-outer {
    border-radius: var(--wb-radius);
    overflow: hidden;
}

.widget-banner__carousel[data-widget-banner-nav="images"] .owl-stage {
    border-radius: var(--wb-radius);
}

/* พื้นที่ overlap เฉพาะบนสไลด์: bottom กันทับ .owl-dots; คลิกลูกศรเท่านั้น */
.widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 1.75rem;
    z-index: 2;
    margin: 0;
    padding: 0;
    width: auto;
    max-width: none;
    display: block;
    pointer-events: none;
    transform: none;
    background: transparent;
    border: none;
}

.widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-prev,
.widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-next {
    position: absolute;
    top: 50%;
    left: auto;
    right: auto;
    margin: 0 !important;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    cursor: pointer;
    transform: translateY(-50%);
    pointer-events: auto;
    background: transparent;
    border: none;
    box-sizing: border-box;
}

.widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-prev {
    left: -50px !important;
    opacity: 0.5;
    right: auto;
}

.widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-next {
    right: -35px !important;
    opacity: 0.5;
    left: auto;
}

.widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-prev:hover,
.widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-next:hover {
    border-color: transparent;
    background: transparent;
    transform: translateY(-50%);
    opacity: 1;
}

.widget-banner__carousel[data-widget-banner-nav="images"] .owl-dots {
    position: relative;
    z-index: 3;
    margin-top: 0.25rem;
    margin-bottom: 0;
    text-align: center;
    pointer-events: auto;
}

/* nav แบบ ::before รูปขาว (items = 1 บนจอใหญ่) — ใช้กฎ .owl-nav / .owl-prev::before บนสุดไฟล์; แค่ยกชั้นลูกศร */
.widget-banner__carousel[data-widget-banner-nav="pseudo"] .owl-nav {
    z-index: 2;
}

/* ครอบ .promotion รอบแบนเนอร์: รากชั้น stacking ให้ nav (z-index) ทำงานสม่ำเสมอ */
.widget-banner .promotion {
    position: relative;
    display: block;
    border-radius: var(--wb-radius, 0.5rem);
}

.widget-banner .promotion .widget-banner__panel--carousel,
.widget-banner .promotion .widget-banner__carousel {
    position: relative;
    z-index: 0;
}

.widget-banner__carousel .owl-dots {
    margin-top: 0.5rem;
    text-align: center;
}

.widget-banner__carousel .owl-dots .owl-dot span {
    width: 10px;
    height: 10px;
    margin: 4px;
}

.widget-banner__carousel .owl-dots .owl-dot.active span {
    background: #28aae4;
}
.widget-banner__carousel .owl-dots .owl-dot:hover span {
    background: #dc4637;
}

.widget-banner__nav {
    display: inline-block;
    line-height: 1;
}

@media (max-width: 1200px) {
    /* [data-widget="customerService"] .service-carousel img {
        display: unset;
        width: 50%;
    } */

    [data-widget="customerService"] .owl-prev::before {
        left: -70px !important;
        top: -100% !important;
    }
    [data-widget="customerService"] .owl-next::before {
        left: 90px !important;
        top: -100% !important;
    }
}
@media (max-width: 1100px) {
     /* [data-widget="customerService"] .service-carousel img {
        display: unset;
        width: 50%;
    } */
        [data-widget="customerService"] .owl-prev::before {
        left: -15px !important;
        top: -100% !important;
    }
        [data-widget="customerService"] .owl-next::before {
        left: 20px !important;
        top: -100% !important;
    }
}
@media (max-width: 991px) {
    .widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-prev {
        left: 0px;
        opacity: 0.5;
        right: auto;
    }

    .widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-next {
        right: 0px;
        opacity: 0.5;
        left: auto;
    }
    [data-widget="customerService"] .owl-prev::before {
        left: -40px !important;
        top: -0% !important;
    }
    [data-widget="customerService"] .owl-next::before {
        left: 60px !important;
        top: 0% !important;
    }
}

@media (max-width: 980px) {
    /* [data-widget="customerService"] .service-carousel img {
        display: unset;
        width: 70%;
    } */
}

@media (max-width: 979px) {
    /* [data-widget="customerService"] .service-carousel img {
        display: unset;
        width: 100%;
    } */
}

@media (max-width: 785px) {
    .products .product__service {
        padding: 0px;
    }
    /* [data-widget="customerService"] .service-carousel img {
        display: unset;
        width: 35%;
    } */
    
    .widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-next {
        right: 0px !important;
        opacity: 0.5;
        left: auto;
    }
    .widget-banner__carousel[data-widget-banner-nav="images"] .owl-nav .owl-prev {
        left: 0px !important;
        opacity: 0.5;
        right: auto;
    }
}

@media (max-width: 784px) {
[data-widget="customerService"] .owl-prev::before {
        left: 130px !important;
        top: -100% !important;;
    }
    [data-widget="customerService"] .owl-next::before {
        left: -110px !important;
        top: -100% !important;;
    }
}

@media (max-width: 576px) {
    .products .product__service {
        padding: 30px;
    }
    [data-widget="customerService"] .owl-prev::before {
        left: -20px !important;
        top: -100%;
    }
    [data-widget="customerService"] .owl-next::before {
        left: 35px !important;
        top: -100%;
    }
    /* รูปซ้าย */
    .owl-prev::before {
        display: none;
    }

    /* รูปขวา */
    .owl-next::before {
        display: none;
    }
}

[data-widget="customerService"] .owl-prev::before {
    display: block;
    background-image: url("/media/y4vjy2u0/arrowleft_blue.png");
    left: -50px;
    top: -100%;
}

[data-widget="customerService"] .owl-next::before {
    display: block;
    background-image: url("/media/55rhnnzd/arrowright_blue.png");
    left: 60px;
    top: -100%;
}

[data-widget="customerService"] .service-carousel img {
    cursor: pointer;
}

.service-carousel.owl-carousel .owl-item img {
    display: inline !important;
    width: max-content !important;
}
