/* ==========================================================================
   AutoKirim Landing v2 — Cek Ongkir
   ========================================================================== */

/* ---------- hero ---------- */

.ak-ongkir-hero {
    position: relative;
    /* Pulls up behind the sticky navbar so the transparent bar sits on red. */
    margin-top: calc(var(--ak-nav-h) * -1);
    padding: calc(var(--ak-nav-h) + 72px) 0 72px;
    /* Anchored to the bottom so the torn-paper edge always shows under the form. */
    background: var(--ak-red) url("../images/hero/cek-ongkir.png") center bottom / cover no-repeat;
    /* Keeps the autocomplete list hanging below the section above the results
       and footer that follow. */
    z-index: 2;
}

.ak-ongkir-hero__inner {
    position: relative;
    z-index: 1;
}

.ak-ongkir-hero__title {
    color: #fff;
    font-size: clamp(1.9rem, 3.6vw, 2.8rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 14px;
}

.ak-ongkir-hero__sub {
    color: rgba(255, 255, 255, .92);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 40px;
}

/* ---------- form ---------- */

.ak-ongkir-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 190px auto;
    align-items: end;
    gap: 16px;
    padding: 28px;
    background: #fff;
    border-radius: var(--ak-radius-lg);
    box-shadow: var(--ak-shadow-lg);
}

.ak-ongkir-form__field {
    position: relative;
    min-width: 0;
}

.ak-ongkir-form__label {
    display: block;
    margin-bottom: 8px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--ak-ink);
}

.ak-ongkir-form__control {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 16px;
    border: 1.5px solid var(--ak-line);
    border-radius: 12px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.ak-ongkir-form__control:focus-within {
    border-color: var(--ak-red);
    box-shadow: 0 0 0 4px var(--ak-red-soft);
}

.ak-ongkir-form__control > i {
    color: var(--ak-muted);
    font-size: 1.15rem;
}

.ak-ongkir-form__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: .97rem;
    color: var(--ak-ink);
}

.ak-ongkir-form__input::placeholder {
    color: var(--ak-muted);
}

.ak-ongkir-form__unit {
    color: var(--ak-muted);
    font-size: .9rem;
}

.ak-ongkir-form__submit {
    height: 52px;
    white-space: nowrap;
}

.ak-ongkir-form__submit.is-loading {
    pointer-events: none;
    opacity: .75;
}

.ak-ongkir-form__submit.is-loading i {
    animation: ak-spin .8s linear infinite;
}

@keyframes ak-spin {
    to { transform: rotate(360deg); }
}

.ak-ongkir-form__error {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--ak-red);
    font-size: .9rem;
    font-weight: 500;
}

.ak-zone.is-invalid .ak-ongkir-form__control {
    border-color: var(--ak-red);
}

/* ---------- autocomplete ---------- */

.ak-zone__list {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid var(--ak-line);
    border-radius: 12px;
    box-shadow: var(--ak-shadow);
}

.ak-zone__option {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: .93rem;
    line-height: 1.4;
    cursor: pointer;
}

.ak-zone__option:hover,
.ak-zone__option.is-active {
    background: var(--ak-red-soft);
    color: var(--ak-red-dark);
}

.ak-zone__status {
    padding: 10px 12px;
    color: var(--ak-muted);
    font-size: .9rem;
}

/* ---------- result ---------- */

.ak-ongkir-result {
    padding: 48px 0 var(--ak-section-y);
}

.ak-ongkir-result__head {
    margin-bottom: 24px;
}

.ak-ongkir-result__caption {
    margin: 0 0 6px;
    color: var(--ak-body);
    font-size: .95rem;
}

.ak-ongkir-result__route {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    font-weight: 700;
}

.ak-ongkir-result__route > i {
    color: var(--ak-red);
}

.ak-ongkir-result__weight {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--ak-bg-soft);
    color: var(--ak-body);
    font-size: .85rem;
    font-weight: 600;
}

.ak-ongkir-tabs {
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

.ak-ongkir-tabs::-webkit-scrollbar {
    display: none;
}

.ak-ongkir-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1.5px solid var(--ak-line);
    border-radius: 999px;
    background: #fff;
    color: var(--ak-ink);
    font-weight: 600;
    font-size: .93rem;
    white-space: nowrap;
    transition: border-color .2s, background-color .2s, color .2s;
}

.ak-ongkir-tabs .nav-link:hover {
    border-color: var(--ak-red);
    color: var(--ak-red);
}

.ak-ongkir-tabs .nav-link.active {
    border-color: var(--ak-red);
    background: var(--ak-red);
    color: #fff;
}

.ak-ongkir-tabs__count {
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--ak-bg-soft);
    color: var(--ak-body);
    font-size: .75rem;
    text-align: center;
}

.ak-ongkir-tabs .nav-link.active .ak-ongkir-tabs__count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.ak-rates {
    display: grid;
    gap: 14px;
}

.ak-rate {
    display: grid;
    /* Logo | Layanan | Opsi Penjemputan | Estimasi Tiba | Tarif. The price column
       is only as wide as its content and sits flush right, so the spare width goes
       to the info columns instead of piling up after the price. */
    grid-template-columns: 130px minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 20px 28px;
    background: #fff;
    border: 1px solid var(--ak-line);
    border-radius: var(--ak-radius);
    transition: box-shadow .25s var(--ak-ease), border-color .25s;
}

.ak-rate:hover {
    border-color: transparent;
    box-shadow: var(--ak-shadow);
}

.ak-rate__logo img {
    display: block;
    max-width: 110px;
    max-height: 44px;
    object-fit: contain;
}

.ak-rate__meta,
.ak-rate__price {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ak-rate__price {
    align-items: flex-end;
    min-width: 130px;
    text-align: right;
}

.ak-rate__label {
    color: var(--ak-muted);
    font-size: .78rem;
}

.ak-rate__meta strong {
    font-weight: 600;
    font-size: .95rem;
}

.ak-rate__price > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
}

.ak-rate__price strong {
    color: #17a34a;
    font-size: 1.2rem;
    font-weight: 700;
    white-space: nowrap;
}

.ak-rate__price del {
    color: var(--ak-muted);
    font-size: .85rem;
    white-space: nowrap;
}

/* ---------- empty ---------- */

.ak-ongkir-empty {
    padding: 48px 0 var(--ak-section-y);
    text-align: center;
}

.ak-ongkir-empty img {
    width: 100%;
    max-width: 280px;
}

.ak-ongkir-empty__title {
    margin: 28px 0 0;
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    font-weight: 700;
}

.ak-ongkir-empty .ak-sub {
    max-width: 52ch;
    margin-inline: auto;
}

/* ---------- responsive ---------- */

@media (max-width: 991.98px) {
    .ak-ongkir-form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .ak-ongkir-form__submit {
        width: 100%;
    }

    .ak-rate {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 16px;
    }

    /* Full-width footer row: label on the left, price on the right. */
    .ak-rate__price {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-width: 0;
        padding-top: 14px;
        border-top: 1px dashed var(--ak-line);
    }
}

@media (max-width: 575.98px) {
    .ak-ongkir-hero {
        padding: calc(var(--ak-nav-h) + 40px) 0 48px;
        /* Keeps the boxes on the left in frame on a tall, narrow hero. */
        background-position: left bottom;
    }

    .ak-ongkir-hero__sub {
        margin-bottom: 28px;
    }

    .ak-ongkir-form {
        grid-template-columns: minmax(0, 1fr);
        padding: 20px;
    }

    .ak-rate {
        padding: 18px;
    }
}
