/* Package Section - Universal Reusable Component */

/* Section Container */
.package-section {
    width: 100%;
    background: #F3F3F3;
    padding-top: 0;
    padding-right: 240px;
    padding-bottom: 16px;
    padding-left: 240px;
    margin-top: 0;
    border-top: none;
}

.package-section + .package-section {
    padding-top: 0;
}

.package-container {
    width: 100%;
}

/* Section Title */
.package-title {
    font-family: 'SF Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 40px;
    text-align: center;
    color: #3D3D3D;
    margin: 0;
}

.mobile-break {
    display: none;
}

.highlight-blue {
    color: #4564ED;
}

.location-mobile {
    text-decoration: underline;
    cursor: pointer;
}

/* Slider Wrapper */
.package-slider-wrapper {
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
    isolation: isolate; /* Create stacking context */
}

/* Cards Container - White Box Wrapper */
.package-cards {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0px 4px 4px -8px rgba(0, 0, 0, 0.08),
                0px 4px 16px 10px rgba(16, 24, 40, 0.02),
                0px 2px 32px -4px rgba(16, 24, 40, 0.03);
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    position: relative; /* Make this the positioning context for arrows */
}

/* Cards Grid - Swiper Container */
.package-cards-grid {
    overflow: hidden;
    padding: 20px 24px;
    margin: -20px -24px;
}

.package-cards-grid .swiper-wrapper {
    display: flex;
}

.package-cards-grid::-webkit-scrollbar {
    display: none;
}

/* Individual Product Card */
.package-card {
    flex: 0 0 calc((100% - 72px) / 4); /* 4 cards, 3 gaps of 24px = 72px */
    width: calc((100% - 72px) / 4);
    max-width: 330px;
    height: 100%;
    background: #FFFFFF;
    border-radius: 12px;
    box-sizing: border-box;
    box-shadow: 0px 4px 4px -8px rgba(0, 0, 0, 0.03),
                0px 4px 16px 10px rgba(16, 24, 40, 0.02),
                0px 2px 32px -4px rgba(16, 24, 40, 0.04);
    overflow: visible;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Suggest Badge - Top Left Corner */
.suggest-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    width: auto;
    height: auto;
    max-width: 200px;
}

.suggest-badge img {
    display: block;
    width: 100%;
    height: auto;
}

/* Card Header - Image Banner */
.package-card-header {
    position: relative;
    width: 100%;
    aspect-ratio: 330 / 238;
    overflow: hidden;
    background: transparent;
}

/* Package Badges - Custom System */
.package-badge {
    position: absolute;
    top: 0;
    left: 0;
    padding: 2px 15px 2px 12px;
    border-radius: 12px 0 32px 0;
    display: none;
    align-items: center;
    gap: 4px;
    z-index: 10;

    /* Default values - can be overridden with CSS variables */
    background: var(--badge-bg, #4564ED);
    color: var(--badge-color, #FFFFFF);
}

/* Preset badge styles */
.package-badge.badge-new {
    --badge-bg: #F24808;
    --badge-color: #FFFFFF;
    border-radius: 12px 0 32px 0;

}

.package-badge.badge-recommended {
    --badge-bg: #FF730A;
    --badge-color: #FFFFFF;
}

.package-badge.badge-hot {
    --badge-bg: #FF2156;
    --badge-color: #FFFFFF;
}

.package-badge.badge-sale {
    --badge-bg: #00C48C;
    --badge-color: #FFFFFF;
}

/* Custom badge - use inline style or CSS variables */
.package-badge.badge-custom {
    /* Custom colors set via inline style or CSS variables */
}

.package-badge-text {
    font-family: 'SF Pro', sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    color: inherit; /* Inherit from parent badge color */
}

.package-badge-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Show badges based on data attributes or manual class */
.package-card[data-badge] .package-badge,
.package-card .package-badge.show {
    display: flex;
}

.package-header-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

.card-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #4564ED;
    border-radius: 0 0 999px 0;
    padding: 2px 12px 2px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'SF Pro', sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    color: #FFFFFF;
}

.card-title-main {
    font-family: 'SF Pro', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 32px;
    color: #FFFFFF;
    margin: 24px 0 4px;
}

.card-combo {
    font-family: 'SF Pro', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: #FFFFFF;
    margin: 0 0 16px;
}

.combo-price {
    font-weight: 700;
}

.card-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-features-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'SF Pro', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 18px;
    color: #FFFFFF;
}

.card-features-list li svg {
    flex-shrink: 0;
}

.card-devices-img {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.card-devices-img img {
    max-width: 100%;
    height: auto;
}

/* Card Body - White */
.package-card-body {
    padding: 16px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #FFFFFF;
    overflow: visible;
}

.card-body-content {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
}

.card-info-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
}

.card-product-name {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 23px;
    color: #3D3D3D;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-price-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: visible;
}

.price-main {
    display: flex;
    align-items: center;
    gap: 4px;
}

.price-value {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
    color: #4564ED;
}

.price-period {
    font-family: 'SF Pro', sans-serif;
    font-size: 12px;
    font-style: normal;
    line-height: 1;
    color: #3D3D3D;
}

.price-main {
    position: relative;
}

/* VAT Icon Wrapper - Positioning Context */
.vat-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.price-vat-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
    display: inline-block;
}

.price-vat-icon:hover {
    opacity: 0.7;
}

/* VAT Tooltip - Anchored to icon via wrapper */
.vat-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #3D3D3D;
    color: #FFFFFF;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'SF Pro', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    white-space: normal;
    max-width: 280px;
    width: max-content;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1001;
    pointer-events: auto;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
}

.vat-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #3D3D3D;
}

.vat-tooltip.active,
.price-vat-icon:hover + .vat-tooltip,
.vat-tooltip:hover {
    opacity: 1;
    visibility: visible;
}

.price-vat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'SF Pro', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    color: #888888;
}

/* Speed Box */
.card-speed-box {
    background: #F7F7F8;
    border: 1px solid #E7E7E7;
    border-radius: 12px;
    padding: 12px 13px 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
}

.speed-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.speed-label {
    font-family: 'SF Pro', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    color: #3D3D3D;
}

.speed-values {
    display: flex;
    align-items: center;
    gap: 4px;
}

.speed-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'SF Pro', sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: -0.075px;
    color: #3D3D3D;
}

.speed-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.speed-meter {
    width: 62px;
    height: 32px;
    flex-shrink: 0;
    position: relative;
}

.speed-meter svg {
    width: 100%;
    height: 100%;
}

/* Speed meter gauge colors - All Orange (no red) */
.speed-gauge-0 { stroke: #E7E7E7; } /* 0% - Grey */
.speed-gauge-25 { stroke: #FF8C00; } /* 25% - Orange */
.speed-gauge-50 { stroke: #FF8C00; } /* 50% - Orange */
.speed-gauge-75 { stroke: #FF8C00; } /* 75% - Orange */
.speed-gauge-100 { stroke: #FF8C00; } /* 100% - Orange */

.speed-needle {
    fill: #C4C4C4;
    transform-origin: 31px 26px;
    transition: transform 0.3s ease;
}

/* Features List Container - Fixed height for uniform cards */
.card-features-container {
    padding: 0 20px;
    height: 108px; /* Fixed height instead of max-height */
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 16px;
    margin-bottom: 16px;
}

.card-features-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-feature-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.card-feature-item .check-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.card-feature-item p {
    flex: 1;
    font-family: 'SF Pro', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    color: #3D3D3D;
    margin: 0;
}

/* Custom Scrollbar - Beautiful jQuery-inspired style */
.card-features-container::-webkit-scrollbar {
    width: 6px;
}

.card-features-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.card-features-container::-webkit-scrollbar-thumb {
    background: #D1D1D1;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.card-features-container::-webkit-scrollbar-thumb:hover {
    background: #B0B0B0;
}

/* Firefox scrollbar */
.card-features-container {
    scrollbar-width: thin;
    scrollbar-color: #D1D1D1 transparent;
}

/* Card Footer - Buttons */
.package-card-footer {
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-primary-speedx,
.btn-primary-internet,
.btn-primary {
    background: #4564ED;
    border: none;
    border-radius: 8px;
    padding: 13px 24px;
    font-family: 'SF Pro', sans-serif;
    font-size: 16px;
    font-weight: 510;
    line-height: 22px;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-primary-speedx:hover,
.btn-primary-internet:hover,
.btn-primary:hover {
    background: #3850d6;
}

.btn-secondary-speedx,
.btn-secondary-internet,
.btn-secondary {
    background: #F3F3F3;
    border: none;
    border-radius: 8px;
    padding: 13px 24px;
    font-family: 'SF Pro', sans-serif;
    font-size: 16px;
    font-weight: 510;
    line-height: 22px;
    color: #4564ED;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-secondary-speedx:hover,
.btn-secondary-internet:hover,
.btn-secondary:hover {
    background: #E7E7E7;
}

/* Navigation Arrows - Positioned relative to .package-cards (white box) */
.package-arrow {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #E7E7E7;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0px 4px 4px -8px rgba(0, 0, 0, 0.08),
                0px 4px 16px 10px rgba(16, 24, 40, 0.02),
                0px 2px 32px -4px rgba(16, 24, 40, 0.03);
    /* Vertical centering relative to .package-cards-grid */
    top: 50%;
    transform: translateY(-50%);
}

/* Position arrows to overlap 50% with white box edge */
.package-arrow-prev {
    left: -24px; /* Half of 48px arrow width - overlaps white box by 24px */
}

.package-arrow-next {
    right: -24px; /* Half of 48px arrow width - overlaps white box by 24px */
}

.package-arrow:hover {
    background: #FFFFFF;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
}

/* View All Link - Desktop: inside white box, Mobile: outside */
.package-view-all {
    display: none;
}

.package-cards .package-view-all {
    display: flex;
    justify-content: center;
}

.view-all-link {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    font-family: 'SF Pro', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    color: #4564ED;
    text-decoration: none;
    padding: 8px 16px;
    pointer-events: auto;
}

.view-all-link:hover {
    text-decoration: none;
    color: #4564ED;
}

/* Responsive Design */
@media (max-width: 1680px) {
    .package-section {
        padding: 40px 120px;
    }
}

@media (max-width: 1440px) {
    .package-section {
        padding: 40px 80px;
    }
}

@media (max-width: 1200px) {
    .package-section {
        padding: 40px 40px;
    }

    .package-card {
        flex: 0 0 calc((100% - 72px) / 4); /* Keep 4 cards */
        width: calc((100% - 72px) / 4);
        max-width: none;
    }
}

/* iPad Pro 12.9" */
@media (min-width: 1024px) and (max-width: 1366px) {
    .package-section {
        padding: 40px 60px;
    }

    .package-cards-grid {
        gap: 20px;
    }

    .package-card {
        flex: 0 0 calc((100% - 60px) / 4); /* 4 cards, 3 gaps of 20px = 60px */
        width: calc((100% - 60px) / 4);
        max-width: none;
    }

    /* Hide navigation arrows on iPad */
    .package-arrow,
    .package-arrow-prev,
    .package-arrow-next {
        display: none;
    }
}

/* iPad Landscape (11" and 10.9") and larger screens below 1024px */
@media (min-width: 835px) and (max-width: 1023px) {
    .package-section {
        padding: 40px 50px;
    }

    .package-cards {
        padding: 20px;
        gap: 20px;
    }

    .package-cards-grid {
        gap: 18px;
    }

    .package-card {
        flex: 0 0 calc((100% - 54px) / 4); /* 4 cards, 3 gaps of 18px = 54px */
        width: calc((100% - 54px) / 4);
        max-width: none;
    }

    /* Hide navigation arrows on iPad */
    .package-arrow,
    .package-arrow-prev,
    .package-arrow-next {
        display: none;
    }
}

/* iPad Portrait */
@media (min-width: 768px) and (max-width: 834px) and (orientation: portrait) {
    .package-section {
        padding: 32px 40px;
    }

    .package-title {
        font-size: 24px;
        line-height: 32px;
    }

    .package-cards {
        padding: 20px;
        gap: 20px;
    }

    .package-cards-grid {
        gap: 16px;
    }

    .package-card {
        flex: 0 0 calc((100% - 48px) / 4); /* 4 cards, 3 gaps of 16px = 48px */
        width: calc((100% - 48px) / 4);
        max-width: none;
    }

    /* Hide navigation arrows on iPad */
    .package-arrow,
    .package-arrow-prev,
    .package-arrow-next {
        display: none;
    }

    .card-product-name {
        font-size: 16px;
        line-height: 22px;
    }

    .price-value {
        font-size: 22px;
    }
}

@media (max-width: 991px) {
    .package-section {
        padding: 40px 20px;
    }

    .package-title {
        font-size: 24px;
        line-height: 32px;
    }

    .package-card {
        flex: 0 0 calc((100% - 48px) / 3); /* 3 cards on smaller tablets */
        width: calc((100% - 48px) / 3);
        max-width: none;
    }

    /* Hide navigation arrows on tablet and mobile */
    .package-arrow,
    .package-arrow-prev,
    .package-arrow-next {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .package-section {
        padding: 16px;
    }

    .package-title {
        font-size: 20px;
        line-height: 28px;
        text-align: center;
    }

    .mobile-break {
        display: inline;
    }

    .package-arrow,
    .package-arrow-prev,
    .package-arrow-next {
        display: none !important;
    }

    .package-slider-wrapper {
        gap: 0;
    }

    .package-cards {
        background: transparent;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 16px;
        position: static; /* Remove positioning context on mobile */
    }

    .package-cards-grid {
        overflow-x: auto; /* Enable scroll on mobile */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .package-card {
        scroll-snap-align: start;
        flex: 0 0 280px;
        width: 280px;
        max-width: none;
    }

    /* Mobile: hide view-all inside white box, show outside */
    .package-cards .package-view-all {
        display: none;
    }

    .package-container > .package-view-all {
        display: flex;
        justify-content: center;
        padding: 8px 0;
    }
}

@media (max-width: 480px) {
    .package-title {
        font-size: 20px;
        line-height: 28px;
        font-weight: 700;
    }

    .package-card {
        min-width: 260px;
    }

    .card-title-main {
        font-size: 20px;
        line-height: 28px;
    }

    .card-combo {
        font-size: 10px;
    }

    .price-vat {
        font-size: 10px;
    }

    .card-features-list li {
        font-size: 10px;
        line-height: 14px;
    }


    /* Mobile: Adjust card-speed-box */
    .card-speed-box {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 8px;
    }

    .speed-info {
        flex: 1;
        gap: 4px;
    }

    .speed-label {
        font-size: 10px;
        font-weight: 400;
        line-height: 14px;
    }

    .speed-values {
        gap: 4px;
    }

    .speed-item {
        font-size: 10px;
        font-weight: 700;
        line-height: 14px;
    }

    .speed-meter {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .speed-meter img {
        max-width: 60px;
        width: 60px;
        height: auto;
    }

    /* Mobile: Adjust internet-speed-box (same as card-speed-box) */
    .card-speed-box {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 8px;
    }

    .card-speed-box .speed-info {
        flex: 1;
        gap: 4px;
    }

    .card-speed-box .speed-label {
        font-size: 10px;
        font-weight: 400;
        line-height: 14px;
    }

    .card-speed-box .speed-values {
        gap: 4px;
    }

    .card-speed-box .speed-item {
        font-size: 10px;
        font-weight: 700;
        line-height: 14px;
    }

    .card-speed-box .speed-meter {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 60px;
        height: auto;
    }

    .card-speed-box .speed-meter img {
        max-width: 60px;
        width: 60px;
        height: auto;
    }
}

/* ========================================
   Internet Card Styles (Featured Products)
   ======================================== */

/* Tabs Navigation */
.package-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.package-tab {
    background: #FFFFFF;
    border: 1.5px solid #E7E7E7;
    border-radius: 999px;
    padding: 10px 16px;
    font-family: 'SF Pro', sans-serif;
    font-size: 14px;
    font-weight: 510;
    line-height: 20px;
    color: #606060;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.package-tab.active {
    background: #F0F3FE;
    border-color: #4564ED;
    color: #4564ED;
}

.package-tab:hover {
    border-color: #4564ED;
}

/* Internet Card - sử dụng chung .package-card từ phần SpeedX Card ở trên */
/* Internet Card Header - sử dụng chung .package-card-header từ phần SpeedX Card ở trên */
/* Internet Card Body - sử dụng chung .package-card-body từ phần SpeedX Card ở trên */

/* Internet Speed Box - sử dụng chung .card-speed-box từ phần SpeedX Card ở trên */

/* Internet Card Footer */
.internet-card-footer {
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* btn-primary-internet và btn-secondary-internet đã gộp chung với btn-primary-speedx và btn-secondary-speedx ở trên */

/* iPad Pro 12.9" - Package Tabs */
@media (min-width: 1024px) and (max-width: 1366px) {
    .package-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .package-tabs::-webkit-scrollbar {
        display: none;
    }

    .package-tab {
        flex-shrink: 0;
    }
}

/* iPad Landscape - Package Tabs */
@media (min-width: 835px) and (max-width: 1194px) {
    .package-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .package-tabs::-webkit-scrollbar {
        display: none;
    }

    .package-tab {
        flex-shrink: 0;
    }
}

/* iPad Portrait - Package Tabs */
@media (min-width: 768px) and (max-width: 834px) and (orientation: portrait) {
    .package-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .package-tabs::-webkit-scrollbar {
        display: none;
    }

    .package-tab {
        flex-shrink: 0;
    }
}

/* Responsive for Internet Cards */
@media (max-width: 768px) {
    .package-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .package-tabs::-webkit-scrollbar {
        display: none;
    }

    .package-tab {
        flex-shrink: 0;
    }

    .internet-card-image {
        height: 200px;
    }
}
