/* HF Carousel Component CSS */

/* Prevent horizontal scroll on the page when carousel overflows */
body:has(.hf-carousel-wrapper) {
    overflow-x: hidden;
}

/* Additional safety to prevent horizontal scroll */
html {
    overflow-x: hidden;
}

/* Ensure parent containers don't cause horizontal scroll */
.hf-carousel-wrapper * {
    box-sizing: border-box;
}

.hf-carousel-wrapper {
    padding: 30px 0;
    width: 100%;
    overflow: visible;
    position: relative;
}

.hf-carousel-wrapper .container {
    margin: 0 auto;
    padding: 0;
    position: relative;
    overflow: visible;
}

/* Carousel Track Container */
.hf-carousel-track-container {
    position: relative;
    overflow: visible;
    margin-bottom: 30px;
}

.hf-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 20px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.hf-carousel-track:active {
    cursor: grabbing;
}

.hf-carousel-track .hf-carousel-button-link,
.hf-carousel-track a,
.hf-carousel-track button {
    cursor: pointer !important;
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

/* Carousel Box Styling */
.hf-carousel-box {
    flex: 0 0 330px; /* Fixed width */
    width: 330px;
    height: 280px;
    background: var(--hf-carousel-box-bg, #F1EEED);
    border-radius: 20px;
    position: relative;
    padding: 30px;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
}

/* Image styling (top right) */
.hf-carousel-box-image {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    overflow: visible;
    border-radius: 8px;
}

.hf-carousel-box-image .box-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hf-carousel-box-title {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 15px
}

.hf-carousel-box-title h4 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin: 0;
}

.hf-carousel-box-button {
    margin-top: 15px;
}

.hf-carousel-button-link {
    width: 40px;
    height: 40px;
    color: black;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 16px;
}

.hf-carousel-button-link i {
    font-size: 16px;
    font-weight: bold;
    -webkit-text-stroke: 0.5px currentColor;
}

/* Icon Thickness Variations */
.hf-carousel-wrapper.hf-icon-thickness-normal .hf-carousel-button-link i {
    -webkit-text-stroke: 0;
}

.hf-carousel-wrapper.hf-icon-thickness-medium .hf-carousel-button-link i {
    -webkit-text-stroke: 0.5px currentColor;
}

.hf-carousel-wrapper.hf-icon-thickness-thick .hf-carousel-button-link i {
    -webkit-text-stroke: 1px currentColor;
}

.hf-carousel-wrapper.hf-icon-thickness-extra-thick .hf-carousel-button-link i {
    -webkit-text-stroke: 1.5px currentColor;
}

.hf-carousel-button-link:hover {
    transform: scale(1.1);
}

/* Navigation Styling */
.hf-carousel-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.hf-carousel-btn {
    width: 39px;
    height: 39px;
    border: 2px solid #3E3E3E;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #3E3E3E;
    transition: all 0.3s ease;
}


.hf-carousel-btn i {
    font-size: 18px;
    line-height: 1;
    display: block;
}

.hf-carousel-btn:hover {
    border-color: #D8D8D8;
    color: #D8D8D8;
    background: transparent;
}

.hf-carousel-btn:disabled {
    background: #D8D8D8;
    border: none;
    color: white;
    cursor: not-allowed;
}

.hf-carousel-btn:disabled i {
    color: white;
}

.hf-carousel-btn:disabled:hover {
    background: #D8D8D8;
    border: none;
    color: white;
}

/* Pagination Dots */
.hf-carousel-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hf-carousel-dot {
    width: 7.5px;
    height: 7.5px;
    border-radius: 50%;
    border: none;
    background: #C4C4C4;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hf-carousel-dot:hover {
    background: #bbb;
}

.hf-carousel-dot.active {
    width: 21px;
    height: 7.5px;
    border-radius: 6px;
    background: #898989;
}

@media (max-width: 834px) {
    .hf-carousel-box {
        flex: 0 0 240px;
        width: 240px;
    }
}

@media (max-width: 480px) {
    /* Extra protection for mobile devices */
    body {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .hf-carousel-wrapper .container {
        padding: 0 15px;
    }
    
    .hf-carousel-box {
        flex: 0 0 280px;
        width: 280px;
        min-height: 250px;
        padding: 15px;
    }
    
    .hf-carousel-track {
        gap: 15px;
    }
    
    .hf-carousel-navigation {
        gap: 20px;
    }
    
    .hf-carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .hf-carousel-box-title {
        padding-right: 80px;
        margin-top: 80px;
    }
    
    .hf-carousel-box-image {
        width: 60px;
        height: 60px;
    }
    
    .hf-carousel-box-title h3 {
        font-size: 1.2rem;
    }
    
    .hf-carousel-button-link {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

@media (max-width: 393px) {
    .hf-carousel-box {
        flex: 0 0 260px;
        width: 260px;
    }
}

/* Animation for autoplay */
.hf-carousel-wrapper[data-autoplay="true"] .hf-carousel-track {
    transition: transform 0.8s ease-in-out;
}