
:root {
    --merah: #c9141c;
    --merah-gelap: #9e0e14;
    --hitam: #171717;
    --putih: #ffffff;
    --abu-latar: #f1f2f4;
    --abu-border: #cfcfcf;
    --abu-teks: #666666;
    --kuning: #f5c400;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--hitam);
    background: var(--abu-latar);
    font-family: Arial, sans-serif;
    overflow-wrap: break-word;
}

body.modal-open {
    overflow: hidden;
}

img,
svg {
    max-width: 100%;
}

/* =========================
   NAVBAR
========================= */

.navbar {
    min-height: 76px;
}

.navbar-brand {
    min-width: 0;
    margin-right: 0;
    white-space: nowrap;
}

.navbar-brand img {
    width: auto;
    height: 58px;
    flex: 0 0 auto;
}

.navbar-brand h2 {
    margin: 0 !important;
    overflow: hidden;
    font-size: clamp(16px, 2.4vw, 28px);
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-toggler {
    flex: 0 0 auto;
    border: 0;
    box-shadow: none !important;
}

.navbar .dropdown-menu {
    border: none;
    border-radius: 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.navbar .dropdown-item {
    padding: 10px 18px;
    font-weight: 500;
}

.navbar .dropdown-item:hover {
    color: #ff3e41;
    background: #f8f9fa;
}

.lang-flag-img {
    width: 22px;
    height: 15px;
    margin-right: 8px;
    object-fit: cover;
    border-radius: 2px;
}

/* =========================
   HALAMAN UTAMA
========================= */

main.container {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding-top: 36px;
    padding-bottom: 36px;
}

.brand {
    margin: 0 0 7px;
    color: var(--merah);
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    letter-spacing: 1.5px;
}

h1 {
    margin: 0 0 8px;
    font-size: 30px;
    text-align: center;
}

.description {
    max-width: 620px;
    margin: 0 auto 26px;
    color: var(--abu-teks);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.card {
    padding: 28px;
    background: var(--putih);
    border: 1px solid #dddddd;
    border-top: 6px solid var(--merah);
    border-radius: 9px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.section-title {
    margin: 0 0 18px;
    font-size: 18px;
}

.section-title::after {
    display: block;
    width: 52px;
    height: 4px;
    margin-top: 7px;
    content: "";
    background: var(--kuning);
    border-radius: 10px;
}

/* =========================
   FORM
========================= */

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-row-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.location-row {
    grid-template-columns:
        minmax(0, 1fr)
        54px
        minmax(0, 1fr);
    align-items: end;
}

.form-group {
    position: relative;
    min-width: 0;
}

label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: bold;
}

.required {
    color: var(--merah);
}

input[type="text"],
input[type="tel"],
select,
textarea {
    width: 100%;
    color: var(--hitam);
    background: var(--putih);
    border: 1px solid var(--abu-border);
    border-radius: 6px;
    outline: none;
    font: inherit;
}

input[type="text"],
input[type="tel"],
select {
    height: 48px;
    padding: 10px 13px;
    font-size: 14px;
}

textarea {
    min-height: 95px;
    padding: 11px 13px;
    resize: vertical;
}

select {
    cursor: pointer;
}

input[type="text"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    border-color: var(--merah);
    box-shadow: 0 0 0 3px rgba(201, 20, 28, 0.12);
}

select:disabled {
    color: #999999;
    background: #eeeeee;
    cursor: not-allowed;
}

.truck-section {
    margin-top: 26px;
    padding-top: 23px;
    border-top: 1px solid #e5e5e5;
}

/* =========================
   TUKAR LOKASI
========================= */

.swap-location-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1px;
}

.swap-location-button {
    width: 48px;
    height: 48px;
    padding: 0;
    color: var(--putih);
    background: var(--merah);
    border: none;
    border-radius: 50%;
    font-size: 23px;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.swap-location-button:hover {
    background: var(--merah-gelap);
    transform: rotate(180deg);
}

.swap-location-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 20, 28, 0.18);
}

/* =========================
   SARAN ALAMAT
========================= */

.suggestions {
    position: absolute;
    z-index: 100;
    top: 75px;
    right: 0;
    left: 0;
    display: none;
    max-height: 260px;
    overflow-y: auto;
    background: var(--putih);
    border: 1px solid #cccccc;
    border-radius: 6px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.suggestion-item {
    padding: 11px 12px;
    border-bottom: 1px solid #eeeeee;
    cursor: pointer;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: #fff1f1;
}

.suggestion-title {
    display: block;
    color: var(--merah);
    font-size: 13px;
    font-weight: bold;
}

.suggestion-subtitle {
    display: block;
    margin-top: 4px;
    color: var(--hitam);
    font-size: 13px;
    line-height: 1.4;
}

.suggestion-message {
    padding: 13px;
    color: var(--abu-teks);
    font-size: 13px;
    text-align: center;
}

/* =========================
   ALERT DAN TOMBOL
========================= */

.alert {
    display: none;
    margin-top: 20px;
    padding: 12px;
    color: #830000;
    background: #ffe4e4;
    border: 1px solid #efa8a8;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}

.button-wrapper,
.order-button-wrapper {
    margin-top: 25px;
    text-align: center;
}

.order-button-wrapper {
    margin-top: 22px;
}

.submit-button {
    min-width: 210px;
    height: 48px;
    padding: 0 24px;
    color: var(--putih);
    background: var(--merah);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.submit-button:hover {
    background: var(--merah-gelap);
}

.submit-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.order-button {
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    color: var(--hitam);
    background: var(--kuning);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

/* =========================
   MODAL
========================= */

.modal-overlay {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.62);
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--putih);
    border-radius: 9px;
}

/*
 * Wrapper ini tidak menjadi area scroll.
 * Area scroll tetap modal-box.
 */
.modal-scroll {
    position: relative;
    display: block;
    overflow: visible;
}

.modal-header {
    position: relative;
    z-index: 60;
    padding: 19px 55px 19px 21px;
    color: var(--putih);
    background: var(--merah);
    border-bottom: 5px solid var(--kuning);
}

.modal-header h2 {
    margin: 0;
    color: var(--putih) !important;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--putih) !important;
    background: transparent;
    border: none;
    font-size: 27px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

/* =========================
   VIDEO STICKY
========================= */

/*
 * Video berada di dalam modal-scroll,
 * tetapi mengikuti area scroll modal-box.
 */
.truck-video-sticky {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 22px 22px 12px;
    background: #181818;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.truck-video-sticky video {
    display: block;
    width: 100%;
    max-width: 420px;
    height: 240px;
    margin: 0 auto;
    object-fit: contain;
    background: #000000;
    border-radius: 7px;
}

.truck-video-error {
    display: none;
    max-width: 420px;
    margin: 12px auto 0;
    padding: 14px;
    color: var(--putih);
    background: #8b0000;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.5;
}

/*
 * Nama armada dan harga tidak sticky.
 */
.truck-result {
    position: relative;
    z-index: 1;
    padding: 8px 22px 22px;
    text-align: center;
    background: #181818;
}

.truck-result-name {
    margin-top: 8px;
    color: var(--kuning);
    font-size: 19px;
    font-weight: bold;
    line-height: 1.4;
}

.truck-result-price {
    margin-top: 10px;
    color: var(--putih);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.25;
}

/* =========================
   HASIL PENGIRIMAN
========================= */

.modal-body {
    padding: 22px;
}

.result-row {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eeeeee;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    color: var(--abu-teks);
    font-size: 13px;
    font-weight: bold;
}

.result-value {
    color: var(--hitam);
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.result-distance {
    color: var(--merah);
    font-size: 22px;
    font-weight: bold;
}

.booking-note {
    margin-top: 20px;
    padding: 16px;
    color: #463b00;
    background: #fff8d8;
    border: 1px solid #ead56f;
    border-left: 5px solid var(--kuning);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
}

.booking-note ul {
    margin: 0;
    padding-left: 19px;
}

.booking-note li + li {
    margin-top: 7px;
}

/* =========================
   FORM PEMESANAN
========================= */

.order-form {
    padding: 22px;
}

.order-section {
    margin-bottom: 22px;
}

.order-section-title {
    margin: 0 0 14px;
    font-size: 16px;
}

.order-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.full-width {
    grid-column: 1 / -1;
}

.insurance-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.insurance-option {
    display: flex;
    gap: 9px;
    padding: 12px;
    background: #fafafa;
    border: 1px solid var(--abu-border);
    border-radius: 6px;
    cursor: pointer;
}

.insurance-detail {
    display: none;
    margin-top: 14px;
    padding: 14px;
    background: #fff8d9;
    border: 1px solid #ead56f;
    border-radius: 6px;
}

.insurance-detail.show {
    display: block;
}

.insurance-cost {
    margin-top: 10px;
    color: var(--merah);
    font-size: 14px;
    font-weight: 800;
}

/* =========================
   WHATSAPP
========================= */

.whatsapp-floating {
    position: fixed;
    z-index: 12000;
    right: 22px;
    bottom: 22px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 9px 16px 9px 10px;
    color: var(--putih);
    background: #25d366;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.whatsapp-floating:hover {
    color: var(--putih);
    background: #1ebe5d;
    transform: translateY(-2px);
}

.whatsapp-floating-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    background: var(--putih);
    border-radius: 50%;
}

.whatsapp-floating-icon svg {
    width: 23px;
    height: 23px;
    fill: #25d366;
}

.whatsapp-floating-text {
    white-space: nowrap;
}

.whatsapp-floating-hidden {
    display: none !important;
}

.whatsapp-floating-show {
    display: flex !important;
    animation: tampilTombolWhatsapp 0.35s ease;
}

@keyframes tampilTombolWhatsapp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================
   TABLET
========================= */

@media (max-width: 991.98px) {
    .navbar {
        min-height: auto;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 0 !important;
    }

    .navbar-brand {
        width: auto;
        max-width: calc(100% - 58px);
        flex: 1 1 0;
        padding: 9px 10px !important;
        gap: 8px;
    }

    .navbar-brand img {
        height: 42px;
    }

    .navbar-brand h2 {
        font-size: 15px;
    }

    .navbar-toggler {
        margin: 0 8px 0 0 !important;
        padding: 6px 8px;
    }

    .navbar-collapse {
        width: 100%;
        flex-basis: 100%;
        border-top: 1px solid #eeeeee;
    }

    .navbar-nav {
        padding: 14px 18px !important;
    }

    .navbar .nav-link {
        padding: 10px 0 !important;
    }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 760px) {
    main.container {
        padding-top: 25px;
        padding-bottom: 25px;
    }

    .form-row,
    .form-row-three,
    .location-row,
    .order-grid,
    .insurance-options {
        grid-template-columns: 1fr;
    }

    .swap-location-wrapper {
        align-items: center;
        padding: 0;
    }

    .swap-location-button {
        transform: rotate(90deg);
    }

    .swap-location-button:hover {
        transform: rotate(270deg);
    }

    .card {
        padding: 21px 15px;
    }

    h1 {
        font-size: 25px;
    }

    .submit-button {
        width: 100%;
    }

    .result-row {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .modal-overlay {
        padding: 10px;
    }

    .modal-box {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .truck-video-sticky {
        padding: 14px 14px 10px;
    }

    .truck-video-sticky video {
        height: 165px;
    }

    .truck-result {
        padding: 6px 14px 18px;
    }

    .truck-result-name {
        margin-top: 8px;
        font-size: 16px;
    }

    .truck-result-price {
        margin-top: 7px;
        font-size: 24px;
    }

    .whatsapp-floating {
        right: 14px;
        bottom: 14px;
        min-height: 50px;
        padding: 7px 12px 7px 8px;
        font-size: 12px;
    }

    .whatsapp-floating-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .whatsapp-floating-icon svg {
        width: 21px;
        height: 21px;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        max-width: calc(100% - 52px);
        padding: 8px !important;
        gap: 6px;
    }

    .navbar-brand img {
        height: 34px;
    }

    .navbar-brand h2 {
        font-size: 12px;
        letter-spacing: 0;
    }

    .navbar-toggler {
        margin-right: 6px !important;
        padding: 5px 7px;
    }
}
/* =========================================
   NAVBAR MOBILE
========================================= */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1050;
}

.navbar-brand {
    min-height: 70px;
}

.navbar-brand img {
    width: auto;
    max-width: 52px;
    height: 52px;
    object-fit: contain;
}

.navbar-toggler {
    position: relative;
    z-index: 1060;
    width: 46px;
    height: 42px;
    padding: 6px 8px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    box-shadow: none;
    cursor: pointer;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.navbar-toggler-icon {
    display: inline-block;
    width: 26px;
    height: 26px;
}

.navbar-collapse {
    position: relative;
    z-index: 1055;
}

@media (max-width: 991.98px) {
    .navbar {
        flex-wrap: wrap;
    }

    .navbar-brand {
        width: auto;
        max-width: calc(100% - 75px);
        min-height: 64px;
        padding: 8px 12px !important;
    }

    .navbar-brand img {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .navbar-brand h2 {
        max-width: 190px;
        overflow: hidden;
        font-size: 17px;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        background: #ffffff;
        border-top: 1px solid #eeeeee;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    }

    .navbar-collapse.show {
        display: block !important;
    }

    .navbar-nav {
        width: 100%;
        padding: 10px 16px !important;
    }

    .navbar-nav .nav-link {
        display: block;
        width: 100%;
        padding: 12px 4px;
        border-bottom: 1px solid #eeeeee;
    }

    .navbar-nav .dropdown-menu {
        position: static !important;
        width: 100%;
        margin-top: 0 !important;
        border: 0;
        box-shadow: none;
    }
}

/* =========================================
   NAVBAR MOBILE HALUS
========================================= */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1050;
}

.navbar-toggler {
    position: relative;
    z-index: 1060;
    flex: 0 0 auto;
    border: 0;
    box-shadow: none !important;
}

.navbar-toggler:focus {
    box-shadow: none !important;
}

/*
 * Jangan memberi display:block pada .collapse,
 * karena akan merusak animasi Bootstrap.
 */
.navbar-collapse {
    position: relative;
    z-index: 1055;
}

/*
 * Class ini dibuat sementara oleh Bootstrap
 * ketika menu sedang membuka atau menutup.
 */
.navbar-collapse.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

@media (max-width: 991.98px) {
    .navbar {
        min-height: auto;
        padding: 0 !important;
        flex-wrap: wrap;
        align-items: center;
    }

    .navbar-brand {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: calc(100% - 62px);
        min-height: auto;
        margin-right: 0;
        padding: 9px 12px !important;
        gap: 7px;
        overflow: hidden;
    }

    .navbar-brand img {
        width: auto;
        height: 42px;
        flex-shrink: 0;
        object-fit: contain;
    }

    .navbar-brand h2 {
        min-width: 0;
        margin: 0 !important;
        overflow: hidden;
        font-size: 14px;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .navbar-toggler {
        margin-right: 10px !important;
        padding: 5px 7px;
    }

    .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        background-color: #ffffff;
        border-top: 1px solid #eeeeee;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    }

    .navbar-collapse.collapsing {
        transition:
            height 0.35s ease,
            opacity 0.25s ease;
        opacity: 0;
    }

    .navbar-collapse.show {
        opacity: 1;
    }

    .navbar-nav {
        width: 100%;
        padding: 12px 16px 16px !important;
    }

    .navbar .nav-link {
        display: flex;
        align-items: center;
        width: 100%;
        height: auto;
        padding: 11px 4px !important;
        border-bottom: 1px solid #eeeeee;
        transition:
            padding-left 0.2s ease,
            color 0.2s ease,
            background-color 0.2s ease;
    }

    .navbar .nav-link:hover,
    .navbar .nav-link:focus {
        padding-left: 10px !important;
        background-color: #f8f9fa;
    }

    .navbar-nav > .nav-item:last-child > .nav-link {
        border-bottom: 0;
    }

    .navbar .dropdown-menu {
        position: static !important;
        width: 100%;
        margin: 0 !important;
        padding: 4px 0 8px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .navbar .dropdown-item {
        padding: 10px 15px;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        max-width: calc(100% - 55px);
        padding: 8px 10px !important;
    }

    .navbar-brand img {
        height: 35px;
    }

    .navbar-brand h2 {
        max-width: 185px;
        font-size: 12px;
    }

    .navbar-toggler {
        margin-right: 7px !important;
        padding: 4px 6px;
    }
}
