/* =========================================================
   APM Logistics - Feature strip (Lacak Pengiriman & Cek Tarif)
   File: css/apm-features.css
   ========================================================= */
.features{
    position:relative;
    z-index:3;
    margin-top:-48px;          /* menimpa bagian bawah hero */
    background:transparent
}
.features__inner{
    display:flex;
    align-items:stretch;
    gap:0;                     /* menimpa gap:170px dari apm-landing.css */
    padding-top:0;
    padding-bottom:0
}

/* ---------- Kartu ---------- */
.feature{
    flex:1 1 50%;
    display:flex;
    align-items:center;
    gap:16px;
    min-height:84px;
    padding:14px 14px 14px 18px;
    border-radius:999px;
    color:inherit;
    position:relative;
    border:2px solid transparent;
    transition:border-color .2s,box-shadow .2s,background .2s,transform .2s
}
.feature--primary{
    background:var(--white);
    box-shadow:0 14px 34px rgba(19,47,94,.18);
    z-index:2
}
.feature--primary:hover{
    box-shadow:0 16px 40px rgba(19,47,94,.24)
}
.feature--primary:focus-within{
    border-color:var(--red);
    box-shadow:0 0 0 5px rgba(220,38,56,.14),0 16px 40px rgba(19,47,94,.22)
}
/* Denyut lembut 3x saat halaman dibuka agar mata langsung tertuju ke sini */
.feature--primary::after{
    content:"";
    position:absolute;
    inset:-2px;
    border-radius:inherit;
    pointer-events:none;
    animation:feature-ring 1.8s ease-out 1.2s 3
}
@keyframes feature-ring{
    0%{
        box-shadow:0 0 0 0 rgba(220,38,56,.45)
    }
    100%{
        box-shadow:0 0 0 16px rgba(220,38,56,0)
    }
}

.feature--glass{
    background:rgba(255,255,255,.9);
    -webkit-backdrop-filter:blur(10px);
    backdrop-filter:blur(10px);
    border-color:rgba(255,255,255,.6);
    box-shadow:0 10px 28px rgba(19,47,94,.12);
    margin-left:-48px;
    padding-left:66px;
    z-index:1
}
.feature--glass:hover{
    background:var(--white);
    border-color:var(--border);
    transform:translateY(-2px)
}

/* ---------- Ikon dalam lingkaran ---------- */
.feature__icon-wrap{
    flex:none;
    width:52px;
    height:52px;
    border-radius:50%;
    background:var(--bg-soft);
    display:grid;
    place-items:center
}
.feature__icon{
    width:30px;
    height:30px
}

/* ---------- Teks ---------- */
.feature__body{
    flex:1;
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:3px
}
.feature__title{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:15px;
    font-weight:700;
    color:var(--navy);
    line-height:1.3;
    cursor:pointer
}
.feature__badge{
    display:inline-flex;
    align-items:center;
    gap:5px;
    padding:2px 8px;
    border-radius:999px;
    background:#fdecee;
    color:var(--red);
    font-size:11px;
    font-weight:700;
    letter-spacing:.02em
}
.feature__badge::before{
    content:"";
    width:6px;
    height:6px;
    border-radius:50%;
    background:currentColor;
    animation:feature-blink 1.6s ease-in-out infinite
}
.feature__badge--navy{
    background:var(--bg-soft);
    color:var(--navy-btn)
}
.feature__badge--navy::before{
    display:none
}
@keyframes feature-blink{
    50%{
        opacity:.25
    }
}
.feature__input{
    width:100%;
    border:0;
    outline:0;
    background:transparent;
    padding:0;
    font:inherit;
    font-size:16px;
    color:var(--navy);
    line-height:1.4
}
.feature__input::placeholder,
.feature__input--fake{
    color:#8d9ab0
}

/* ---------- Tombol aksi ---------- */
.feature__search{
    flex:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    height:52px;
    min-width:52px;
    padding:0 22px;
    border:0;
    border-radius:999px;
    background:var(--red);
    color:var(--white);
    font:inherit;
    font-size:15px;
    font-weight:600;
    cursor:pointer;
    box-shadow:0 6px 16px rgba(220,38,56,.3);
    transition:background .2s,transform .2s
}
.feature__search:hover{
    background:var(--red-dark);
    transform:translateY(-1px)
}
.feature__search svg{
    width:20px;
    height:20px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.2;
    stroke-linecap:round
}
.feature--glass .feature__search{
    background:var(--navy-btn);
    box-shadow:0 6px 16px rgba(26,58,124,.25)
}
.feature--glass:hover .feature__search{
    background:var(--navy-dark)
}

/* ---------- Responsive ---------- */
@media (max-width:991px){
    .features{
        margin-top:-28px
    }
    .features__inner{
        flex-direction:column;
        gap:12px
    }
    .feature--glass{
        margin-left:0;
        padding-left:18px;
        background:var(--white);
        border-color:var(--border)
    }
}
@media (max-width:575px){
    .features__inner{
        gap:10px;
        padding:0 18px           /* menimpa padding:24px 0 dari apm-landing.css */
    }
    .feature{
        min-height:72px;
        padding:10px 10px 10px 12px;
        gap:12px
    }
    .feature__icon-wrap{
        width:44px;
        height:44px
    }
    .feature__icon{
        width:26px;
        height:26px
    }
    .feature__title{
        font-size:14px
    }
    .feature__input--fake{
        font-size:15px
    }
    .feature__input,
    .feature__input--fake{
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis
    }
    .feature__search{
        height:46px;
        min-width:46px;
        padding:0
    }
    .feature__search-label{
        display:none        /* di HP cukup ikon */
    }
}
@media (prefers-reduced-motion:reduce){
    .feature--primary::after,
    .feature__badge::before{
        animation:none
    }
}

/* Loading saat melacak (menimpa warna dari apm-track.css) */
.feature__search.is-loading{
    pointer-events:none;
    opacity:.85
}
.feature__search.is-loading svg{
    stroke:var(--white)
}

/* =========================================================
   Panel Cek Tarif (muncul di atas kartu Cek Tarif)
   ========================================================= */
.features__inner{
    position:relative
}
button.feature{
    font:inherit;
    text-align:left;
    cursor:pointer;
    width:auto
}
button.feature .feature__body{
    display:flex
}
.feature--glass[aria-expanded="true"]{
    background:var(--white);
    border-color:var(--navy-btn)
}

.tarif-panel{
    position:absolute;
    right:24px;                       /* sejajar padding .container */
    bottom:calc(100% + 14px);
    width:min(560px, calc(50% + 24px));
    background:var(--white);
    border-radius:24px;
    padding:22px 26px 20px;
    box-shadow:0 20px 50px rgba(12,37,80,.25);
    z-index:5;
    animation:tarif-in .22s ease-out
}
.tarif-panel[hidden]{
    display:none
}
@keyframes tarif-in{
    from{
        opacity:0;
        transform:translateY(10px)
    }
}
.tarif-panel::after{
    /* panah kecil ke kartu Cek Tarif */
    content:"";
    position:absolute;
    right:56px;
    bottom:-8px;
    width:16px;
    height:16px;
    background:var(--white);
    transform:rotate(45deg);
    border-radius:3px
}
.tarif-panel__close{
    position:absolute;
    top:10px;
    right:12px;
    width:32px;
    height:32px;
    border:0;
    border-radius:50%;
    background:var(--bg-chip);
    color:var(--navy);
    font-size:20px;
    line-height:1;
    cursor:pointer
}
.tarif-panel__close:hover{
    background:var(--border)
}

.tarif-row{
    position:relative;
    display:flex;
    align-items:center;
    gap:16px;
    min-height:58px
}
.tarif-row__ico{
    flex:none;
    width:26px;
    display:grid;
    place-items:center
}
.tarif-row__ico svg{
    width:22px;
    height:22px
}
.tarif-row--origin::after{
    /* garis titik penghubung asal -> tujuan */
    content:"";
    position:absolute;
    left:12px;
    top:42px;
    height:18px;
    border-left:3px dotted #c3ccd9
}
.tarif-row__input{
    flex:1;
    min-width:0;
    height:58px;
    border:0;
    border-bottom:1px solid var(--border);
    outline:0;
    background:transparent;
    font:inherit;
    font-size:16px;
    color:var(--navy);
    transition:border-color .2s
}
.tarif-row--weight .tarif-row__input{
    border-bottom:0
}
.tarif-row__input::placeholder{
    color:#9aa6b8
}
.tarif-row__input:focus{
    border-bottom-color:var(--navy-btn)
}
.tarif-row__input.is-invalid,
.tarif-row__input.is-invalid:focus{
    border-bottom:2px solid var(--red)
}
.tarif-row__input::-webkit-outer-spin-button,
.tarif-row__input::-webkit-inner-spin-button{
    -webkit-appearance:none;
    margin:0
}
.tarif-row__input[type=number]{
    -moz-appearance:textfield
}
.tarif-row__unit{
    flex:none;
    padding:10px 16px;
    border-radius:10px;
    background:var(--bg-chip);
    color:var(--navy);
    font-weight:600
}

.tarif-panel__msg{
    display:block;
    min-height:18px;
    margin-left:42px;
    font-size:13px;
    color:var(--red)
}
.tarif-panel__foot{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-top:6px
}
.tarif-panel__note{
    font-size:12.5px;
    color:var(--muted)
}
.tarif-panel__btn{
    flex:none;
    height:48px;
    padding:0 30px;
    border-radius:999px;
    border:2px solid var(--red);
    background:var(--white);
    color:var(--red);
    font:inherit;
    font-weight:700;
    cursor:pointer;
    transition:background .2s,color .2s
}
.tarif-panel__btn:hover{
    background:var(--red);
    color:var(--white)
}

@media (max-width:991px){
    .tarif-panel{
        position:relative;
        right:auto;
        bottom:auto;
        width:auto;
        order:3;
        margin-top:2px
    }
    .tarif-panel::after{
        top:-8px;
        bottom:auto
    }
}
@media (max-width:575px){
    .tarif-panel{
        padding:18px 18px 16px;
        border-radius:20px
    }
    .tarif-panel__foot{
        flex-direction:column-reverse;
        align-items:stretch;
        text-align:center
    }
    .tarif-panel__btn{
        width:100%
    }
}
@media (prefers-reduced-motion:reduce){
    .tarif-panel{
        animation:none
    }
}

/* ---------- Dropdown saran kota ---------- */
.tarif-ac{
    position:absolute;
    left:42px;
    right:0;
    top:calc(100% - 2px);
    z-index:10;
    list-style:none;
    margin:0;
    padding:6px;
    max-height:240px;
    overflow-y:auto;
    background:var(--white);
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:0 14px 32px rgba(12,37,80,.18)
}
.tarif-ac[hidden]{
    display:none
}
.tarif-ac__item{
    padding:10px 12px;
    border-radius:10px;
    color:var(--navy);
    font-size:14.5px;
    cursor:pointer
}
.tarif-ac__item:hover,
.tarif-ac__item.is-active{
    background:var(--bg-soft)
}
.tarif-ac__info{
    padding:10px 12px;
    color:var(--muted);
    font-size:14px
}
.tarif-form[hidden],
.tarif-result[hidden]{
    display:none
}
.tarif-panel__btn.is-loading{
    opacity:.75;
    cursor:wait
}

/* ---------- Hasil tarif ---------- */
.tarif-result{
    padding-top:6px
}
.tarif-result__route{
    display:flex;
    align-items:center;
    gap:10px;
    padding-right:40px;
    color:var(--navy);
    font-weight:600;
    font-size:15px
}
.tarif-result__route span{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap
}
.tarif-result__route svg{
    flex:none;
    width:20px;
    height:20px;
    fill:none;
    stroke:var(--red);
    stroke-width:2.2;
    stroke-linecap:round;
    stroke-linejoin:round
}
.tarif-result__total{
    margin-top:14px;
    padding:16px 18px;
    border-radius:16px;
    background:var(--bg-soft)
}
.tarif-result__total small{
    display:block;
    color:var(--muted);
    font-size:12.5px
}
.tarif-result__total strong{
    display:block;
    color:var(--red);
    font-size:30px;
    line-height:1.2;
    letter-spacing:-.01em
}
.tarif-result__grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:10px;
    margin:14px 0 0
}
.tarif-result__grid dt{
    font-size:11.5px;
    color:var(--muted)
}
.tarif-result__grid dd{
    margin:2px 0 0;
    color:var(--navy);
    font-weight:600;
    font-size:14.5px
}
.tarif-result__note{
    margin-top:12px;
    font-size:12.5px;
    color:var(--muted)
}
.tarif-result__empty strong{
    display:block;
    color:var(--navy);
    font-size:17px;
    margin-bottom:6px;
    padding-right:40px
}
.tarif-result__empty p{
    font-size:14.5px
}
.tarif-result__actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:16px
}
.tarif-result__btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    height:46px;
    padding:0 22px;
    border-radius:999px;
    border:0;
    font:inherit;
    font-size:14.5px;
    font-weight:600;
    cursor:pointer;
    transition:background .2s
}
.tarif-result__btn svg{
    width:18px;
    height:18px
}
.tarif-result__btn--ghost{
    background:var(--bg-chip);
    color:var(--navy)
}
.tarif-result__btn--ghost:hover{
    background:var(--border)
}
.tarif-result__btn--wa{
    background:#1fa855;
    color:var(--white)
}
.tarif-result__btn--wa:hover{
    background:#178a45;
    color:var(--white)
}
@media (max-width:575px){
    .tarif-ac{
        left:0
    }
    .tarif-result__grid{
        grid-template-columns:repeat(2,1fr)
    }
    .tarif-result__total strong{
        font-size:26px
    }
    .tarif-result__actions{
        flex-direction:column-reverse
    }
    .tarif-result__btn{
        width:100%
    }
}

/* Item saran kota 2 baris: Kecamatan [KODE] / Kab-Kota, Provinsi */
.tarif-ac__item{
    display:grid;
    grid-template-columns:1fr auto;
    column-gap:10px;
    row-gap:1px;
    align-items:center
}
.tarif-ac__main{
    font-weight:600;
    color:var(--navy);
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap
}
.tarif-ac__code{
    grid-row:1;
    grid-column:2;
    padding:1px 7px;
    border-radius:6px;
    background:var(--bg-chip);
    color:var(--muted);
    font-size:11px;
    font-weight:700;
    letter-spacing:.04em
}
.tarif-ac__sub{
    grid-column:1 / -1;
    font-size:12.5px;
    color:var(--muted);
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap
}
.tarif-ac__item mark{
    background:none;
    color:var(--red);
    font-weight:700
}
.tarif-ac__item.is-active .tarif-ac__code{
    background:var(--white)
}
.tarif-row__input{
    text-overflow:ellipsis
}

/* Pilihan layanan lain di hasil tarif */
.tarif-result__others{
    margin-top:14px;
    padding-top:12px;
    border-top:1px dashed var(--border)
}
.tarif-result__others small{
    display:block;
    font-size:12px;
    color:var(--muted);
    margin-bottom:6px
}
.tarif-result__opt{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:8px 12px;
    border-radius:10px;
    background:var(--bg-chip);
    font-size:14px;
    color:var(--navy)
}
.tarif-result__opt + .tarif-result__opt{
    margin-top:6px
}
.tarif-result__opt em{
    font-style:normal;
    color:var(--muted);
    font-size:12.5px
}

/* Panel hasil: batasi tinggi agar tidak keluar layar, isi bisa di-scroll */
.tarif-panel.has-result{
    max-height:calc(100vh - 110px);
    overflow-y:auto;
    overscroll-behavior:contain
}

/* Panel membuka ke bawah kartu jika ruang di atas tidak cukup */
.tarif-panel.is-below{
    bottom:auto;
    top:calc(100% + 14px)
}
.tarif-panel.is-below::after{
    bottom:auto;
    top:-8px
}