/* ux-builder/package-slider/style.css */

/* =========================================
   1. SLIDER CONTAINER
   ========================================= */
.htdev-package-slider-wrapper {
    margin-bottom: 30px;
    padding-bottom: 10px;
}

/* Base fallback for Builder and before JS loads */
:where(.htdev-package-slider):not(.slick-initialized) {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    margin: 0 calc(var(--gap, 15px) / -2) !important;
    opacity: 1;
    /* Hiển thị trong builder */
    scrollbar-width: none;
}

:where(.htdev-package-slider):not(.slick-initialized)::-webkit-scrollbar {
    display: none;
}

@media (max-width: 549px) {
    /* không cần chỉnh grid fallback cột ở đây vì flex width giải quyết được */
}

@media (min-width: 550px) and (max-width: 849px) {}

/* Explicit Width + Snap Fallback cho các thẻ con */
:where(.htdev-package-slider):not(.slick-initialized)>* {
    margin: 0 !important;
    flex-shrink: 0 !important;
    width: calc(100% / var(--cols-desktop, 4)) !important;
    padding: 0 calc(var(--gap, 15px) / 2) !important;
    scroll-snap-align: start !important;
}

@media (max-width: 549px) {
    :where(.htdev-package-slider):not(.slick-initialized)>* {
        width: calc(100% / var(--cols-mobile, 1.2)) !important;
    }
}

@media (min-width: 550px) and (max-width: 849px) {
    :where(.htdev-package-slider):not(.slick-initialized)>* {
        width: calc(100% / var(--cols-tablet, 2)) !important;
    }
}

/* Khi Slick đã ready */
.htdev-package-slider.slick-initialized {
    opacity: 1;
    display: block;
    position: relative;
    /* Giữ chân tuyệt đối cho các mũi tên Absolute (Next/Prev) */
}

/* Slick Gap System: Margin on slide and negative margin on list */
.htdev-slick-slider .slick-slide {
    margin: 0 calc(var(--gap, 15px) / 2);
}

.htdev-slick-slider .slick-list {
    margin: 0 calc(var(--gap, 15px) / -2);
    padding-bottom: 15px;
    /* Giữ chỗ cho shadow hover */
}

/* Nút Nav Slick SVG (chèn cố định bằng PHP ngoài slider) */
.htdev-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    padding: 0;
    /* Mặc định ẩn, Slick JS sẽ nhồi thêm display: block khi cần */
}

.htdev-slider-nav svg {
    margin: auto;
}

.htdev-slider-prev:hover,
.htdev-slider-next:hover {
    background: #f8f9fa;
}

.htdev-slider-prev {
    left: -15px;
}

.htdev-slider-next {
    right: -15px;
}

/* Ẩn thủ công nếu Slick quyết định thêm class .slick-hidden */
.htdev-slider-nav.slick-hidden {
    display: none !important;
}

/* =========================================
   2. PACKAGE ITEM
   ========================================= */
.htdev-package-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    position: relative;
    border: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.htdev-package-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.htdev-package-item.htdev-is-popular {
    border: 2px solid #0056b3;
    transform: scale(1.02);
}

@media (max-width: 849px) {
    .htdev-package-item.htdev-is-popular {
        transform: none;
    }
}

.htdev-package-item__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* =========================================
   3. BANNER AREA
   ========================================= */
.htdev-package-item__banner {
    position: relative;
    width: 100%;
    background: #007bff;
    padding: 0;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.htdev-theme-blue .htdev-package-item__banner {
    background: #006aff;
}

.htdev-theme-dark_blue .htdev-package-item__banner {
    background: #1a428a;
}

.htdev-theme-green .htdev-package-item__banner {
    background: #18a93e;
}

.htdev-package-item__badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #3700ff;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-bottom-right-radius: 8px;
    z-index: 2;
}

.htdev-package-item__img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.htdev-package-item__img-placeholder {
    width: 100%;
    height: 140px;
}

/* =========================================
   4. CONTENT AREA & TOOLTIP
   ========================================= */
.htdev-package-item__content {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.htdev-package-item__name {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.htdev-package-item__price-wrap {
    display: flex;
    align-items: baseline;
    margin-bottom: 15px;
    position: relative;
}

.htdev-theme-blue .htdev-package-item__price {
    color: #006aff;
}

.htdev-theme-dark_blue .htdev-package-item__price {
    color: #1a428a;
}

.htdev-theme-green .htdev-package-item__price {
    color: #18a93e;
}

.htdev-package-item__price {
    font-size: 24px;
    font-weight: 800;
}

.htdev-package-item__price-unit {
    font-size: 13px;
    color: #666;
    margin-left: 2px;
}

.htdev-package-item__tooltip-wrap {
    position: relative;
    margin-left: 8px;
    cursor: help;
    color: #999;
}

.htdev-package-item__tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 200px;
    background: #333;
    color: #fff;
    font-size: 12px;
    padding: 8px;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: none;
    text-align: center;
}

.htdev-package-item__tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.htdev-package-item__tooltip-wrap:hover .htdev-package-item__tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* =========================================
   5. TỐC ĐỘ (SPEED BOX)
   ========================================= */
.htdev-package-item__speed-box {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.htdev-package-item__speed-title {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.htdev-package-item__speed-values {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    display: flex;
    gap: 8px;
}

.htdev-package-item__speed-icon {
    width: 50px;
    flex-shrink: 0;
}

.htdev-package-item__speed-icon img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   6. TÍNH NĂNG (FEATURES LIST)
   ========================================= */
.htdev-package-item__features {
    font-size: 13px;
    color: #555;
    margin-bottom: 20px;
    max-height: 110px;
    overflow-y: auto;
    padding-right: 5px;
}

.htdev-package-item__features ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.htdev-package-item__features li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.htdev-package-item__features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: #18a93e;
    font-weight: bold;
}

.htdev-package-item__features::-webkit-scrollbar {
    width: 4px;
}

.htdev-package-item__features::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.htdev-package-item__features::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.htdev-package-item__features::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* =========================================
   7. ACTIONS (NÚT BẤM)
   ========================================= */
.htdev-package-item__actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.htdev-btn {
    display: inline-block;
    text-align: center;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.htdev-btn-primary {
    background: #006aff;
    color: #fff;
}

.htdev-theme-blue .htdev-btn-primary {
    background: #4a6ee0;
}

.htdev-theme-dark_blue .htdev-btn-primary {
    background: #4a6ee0;
}

.htdev-theme-green .htdev-btn-primary {
    background: #4a6ee0;
}

.htdev-btn-primary:hover {
    background: #3850d6;
    opacity: 0.9;
}

a.htdev-btn-primary:hover {
    color: #fff;
}

.htdev-btn-secondary {
    background: #f5f5f5;
    color: #006aff;
}

.htdev-btn-secondary:hover {
    background: #ececec;
}