:root {
    --primary-color: #f5c45e;
    --secondary-color: #cc412c;
    --primary-color-dark: #eab038;
    --secondary-color-dark: #b42915;

    --text-color: #102e50;
    --text-color-light: #656884;
    --text-success: #23b42c;
    --text-warning: #e78b48;
    --text-danger: #da452f;

    --background-color: #f6f8fa;
    --background-color-light: #ffffff;
    --background-color-dark: #f4f4f4;
    --background-color-dark2: #d4dbe2;
    --background-color-op: #fff8e8de;

    --bs-danger-bg-subtle: #ffc4ca8a;
    --bs-success-bg-subtle: #d1e7dd8a;
    --bs-warning-bg-subtle: #fff3cd8a;

    --swal2-backdrop: rgba(54, 54, 54, 0.2) !important;
    --swal2-background: rgba(255, 255, 255, 0.8) !important;
    --swal2-confirm-button-background-color: #b42915 !important;
}

div:where(.swal2-container).swal2-center > .swal2-popup {
    border: 2px solid var(--secondary-color) !important;
    backdrop-filter: blur(5px) !important;
}

div:where(.swal2-container) div:where(.swal2-popup), div:where(.swal2-container) {
    backdrop-filter: blur(2px) !important;
}

@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: 400;
    src: url(fonts/iransans/woff2/IRANSansWeb_UltraLight.woff2);
    src: format("woff2") url(fonts/iransans/eot/IRANSansWeb_UltraLight.eot) format("embedded-opentype"),
    url(fonts/iransans/woff/IRANSansWeb_UltraLight.woff) format("woff"),
    url(fonts/iransans/eot/IRANSansWeb_UltraLightd41d.eot?#iefix) format("embedded-opentype"),
    url(fonts/iransans/ttf/IRANSansWeb_UltraLight.ttf) format("truetype");
    font-display: swap;
}

/* رنگ متن */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-primary-dark { color: var(--primery-color-dark) !important; }
.text-secondary-dark { color: var(--secondary-color-dark) !important; }
.text-base { color: var(--text-color) !important; }
.text-light { color: var(--text-color-light) !important; }
.text-success-custom { color: var(--text-success) !important; }
.text-warning-custom { color: var(--text-warning) !important; }
.text-danger-custom { color: var(--text-danger) !important; }
.text-in_progress { color: #f5c45e; }
.text-delivered { color: #23b42c; }
.text-cancelled { color: #da452f; }

/* رنگ پس‌زمینه */
.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-primary-dark { background-color: var(--primery-color-dark) !important; }
.bg-secondary-dark { background-color: var(--secondary-color-dark) !important; }
.bg-base {
    background-color: #ffffffc2 !important;
    backdrop-filter: blur(5px);
    box-shadow: rgba(17, 17, 26, 0.05) 0px 1px 0px,
    rgba(17, 17, 26, 0.1) 0px 0px 6px, inset #ffffff75 1px 1px 4px 1px;
    border: 1px #ffffffc7 solid;
}
.bg-light { background-color: var(--background-color-light) !important; }
.bg-dark { background-color: var(--background-color-dark) !important; }
.bg-dark2 { background-color: var(--background-color-dark2) !important; }

body,
html {
    margin: 0;
    color: var(--text-color);
    font-family: IRANSans, sans-serif;
    font-weight: 600;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff38;
    backdrop-filter: blur(10px);
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}
.bottom-nav a { color: #333; text-decoration: none; font-size: 1.5rem; }
.bottom-nav a.active { color: var(--primary-color); font-size: 2rem; }
.cursor-pointer { cursor: pointer; }
.custom-list-item { display: flex; align-items: center; justify-content: space-between; border-radius: 1rem; margin-bottom: 0.75rem; transition: background 0.3s; text-decoration: none; }
.custom-list-item .item-left { display: flex; align-items: center; gap: 0.75rem; }
.custom-list-item:hover, .custom-list-item:active { background: rgba(191, 191, 191, 0.49); }
.item-icon { width: 40px; min-width: 40px; height: 40px; background-color: var(--background-color-light); display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 20px; color: var(--primary-color); }
.custom-list-item .item-title { font-size: 1rem; color: var(--text-color); }
.custom-list-item .item-subtitle { font-size: 0.875rem; color: var(--text-color-light); }
.custom-list-item .item-action { font-size: 1.2rem; color: var(--text-color-light); }
.blur-circle { filter: blur(120px); width: 140px; height: 140px; background: var(--bs-orange); border-radius: 40%; position: fixed; top: 4rem; left: 2rem; z-index: -1; }
a { text-decoration: none; color: var(--text-color); }
.btn { border-radius: 1rem; --bs-btn-padding-y: 0.5rem; font-weight: 600; }
.btn-circle { width: 42px; height: 42px; display: inline-flex; align-items: anchor-center; justify-content: center; }
.btn-outline-primary { --bs-btn-color: var(--primary-color); --bs-btn-border-color: var(--primary-color); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--primary-color); --bs-btn-hover-border-color: var(--primary-color); --bs-btn-focus-shadow-rgb: 13, 110, 253; --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--primary-color); --bs-btn-active-border-color: var(--primary-color); --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); --bs-btn-disabled-color: var(--primary-color); --bs-btn-disabled-bg: transparent; --bs-btn-disabled-border-color: var(--primary-color); --bs-gradient: none; }
.btn-primary { --bs-btn-color: #fff; --bs-btn-bg: var(--primary-color); --bs-btn-border-color: var(--primary-color); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--primary-color-dark); --bs-btn-hover-border-color: var(--primary-color-dark); --bs-btn-focus-shadow-rgb: 49, 132, 253; --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--primary-color-dark); --bs-btn-active-border-color: var(--primary-color-dark); --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--primary-color); --bs-btn-disabled-border-color: var(--primary-color); }
.btn-secondary { --bs-btn-color: #fff; --bs-btn-bg: var(--secondary-color); --bs-btn-border-color: var(--secondary-color); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--secondary-color-dark); --bs-btn-hover-border-color: var(--secondary-color-dark); --bs-btn-focus-shadow-rgb: 49, 132, 253; --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--secondary-color-dark); --bs-btn-active-border-color: var(--secondary-color-dark); --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--secondary-color); --bs-btn-disabled-border-color: var(--secondary-color); }
.fs-larg { font-size: calc(3rem + 1.6vw) !important; }
.fs-7 { font-size: 0.83rem !important; }
.fs-8 { font-size: 0.7rem !important; }
.form-control { background-color: var(--background-color-op); padding: 0.5rem 0.75rem; }
.form-control:focus { border-color: var(--primary-color); outline: 0; box-shadow: 0 0 5px 1px var(--primary-color); }
.img-fluid { width: 70px; height: 70px; }
.img-fluid-min { width: 48px; height: 48px; }
.full-size-1 { margin: -6rem -0.75rem -2rem -0.75rem; }
.full-size-2 { margin: 0 -0.75rem -2rem -0.75rem; }
.rotate { animation: rotate 1.5s linear infinite; }
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.img-profile { width: 90px; height: 90px; margin: 0; display: block; border-radius: 50%; background-color: var(--background-color-light); }
h1 { color: var(--text-color); }
h2 { color: var(--text-color-light); }
.more-btn { width: 60px; height: 4px; background-color: var(--background-color-dark2); border-radius: 2px; margin: -4px auto 8px; }
.bi:before { vertical-align: -0.28em; }
.alert { backdrop-filter: blur(5px); }
.badge { line-height: unset; }
.tab-content .tab-pane { padding-bottom: 3.5rem; }

.live-map { bottom: 0; left: 8px; right: 8px; transition: all 300ms ease-in-out; transform: translateY(0); }
.live-map.close { transform: translateY(calc(100% - 6rem)); }
.live-map-close { margin: 0 auto; padding: 0 0 8px 0; }
.live-map-close div { width: 100px; height: 6px; background: #fff; border-radius: 3px; box-shadow: 0 0 2px 0 #00000030; margin: 0 auto; }

/* Driver authentication: intentionally scoped so the app's custom layout stays untouched. */
.driver-auth-shell { max-width: 430px; margin: 1.25rem auto 0; padding: 0 .35rem 1.25rem; }
.driver-auth-card { background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.9); border-radius: 2rem; padding: 1.4rem 1.2rem; box-shadow: 0 18px 44px rgba(16,46,80,.08); backdrop-filter: blur(12px); }
.driver-auth-logo { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(16,46,80,.08)); }
.driver-auth-title { font-size: 1.08rem; margin: .9rem 0 .25rem; }
.driver-auth-subtitle { font-size: .78rem; color: var(--text-color-light); line-height: 1.8; margin: 0 0 1rem; }
.driver-auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.driver-auth-actions .btn { min-height: 46px; }
.driver-auth-credit { margin-top: 1rem; text-align: center; font-size: .66rem; color: var(--text-color-light); line-height: 1.8; }
.driver-auth-credit a { color: var(--text-color-light); }
.driver-auth-credit .raayasun-mark { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-inline-end: .3rem; border-radius: 50%; background: #fff; border: 1px solid #eee; vertical-align: middle; overflow: hidden; }
.driver-auth-credit .raayasun-mark img { width: 18px; height: 18px; object-fit: contain; }
@media (max-width: 380px) { .driver-auth-actions { grid-template-columns: 1fr; } }

/* Map actions for the AJAX receive-package sheet are moved to body at runtime. */
.receive-package-map-actions { position: fixed; top: 15px; left: 14px; z-index: 1105; display: flex; gap: .45rem; direction: ltr; }
.receive-package-map-actions .btn { background-color: rgba(255,255,255,.9); backdrop-filter: blur(7px); }
.receive-package-map-actions .btn-primary { background-color: var(--primary-color); }

/* Order details keeps the custom map-behind/bottom-sheet architecture, only its interior is modernized. */
.order-details-sheet { background: #fff !important; }
.order-details-sheet .card-body { padding-bottom: 3.25rem !important; }
.order-details-hero { display: flex; align-items: center; gap: .75rem; padding: .2rem 0 .8rem; }
.order-details-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: 0 0 52px; }
.order-details-avatar-fallback { width: 48px; height: 48px; flex: 0 0 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff8e8; color: var(--primary-color-dark); border: 1px solid #f5c45e66; font-size: 1.35rem; }
.order-details-summary { min-width: 0; flex: 1; }
.order-details-name { font-size: 1rem; color: var(--text-color); margin-bottom: .15rem; }
.order-details-date { font-size: .72rem; color: var(--text-color-light); }
.order-details-route { padding: .75rem .85rem; border-radius: 1.15rem; background: #f7f8fa; font-size: .77rem; line-height: 1.9; }
.order-details-route .route-line { display: flex; gap: .45rem; align-items: flex-start; }
.order-details-route i { color: var(--primary-color-dark); margin-top: .1rem; }
.order-details-action { margin: .75rem 0; }
.order-details-section { border-top: 1px solid #e8ebef; padding-top: .85rem; margin-top: .85rem; }
.order-details-section-title { font-size: .76rem; color: var(--text-color-light); margin-bottom: .55rem; }
.order-details-contact { display: flex; align-items: center; gap: .7rem; min-height: 52px; }
.order-details-contact-main { min-width: 0; flex: 1; }
.order-details-contact-title { font-size: .86rem; color: var(--text-color); }
.order-details-contact-subtitle { font-size: .68rem; color: var(--text-color-light); margin-top: .1rem; }
.order-details-contact-actions { display: flex; gap: .4rem; direction: ltr; }

/* MAP Warning Styles */
.map-warning { position: absolute; top: 67px; right: 13px; background: rgb(195 0 18 / 41%); color: white; padding: 15px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.3); z-index: 1000; font-family: 'IranSans', sans-serif; font-weight: 600; max-width: 300px; font-size: 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px #ff000047 solid; }
.map-warning-content { display: flex; align-items: center; gap: 15px; }
.map-warning-close { position: absolute; top: 5px; left: 5px; background: none; border: none; font-size: 18px; cursor: pointer; color: white; padding: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; transition: color .2s; }
.map-warning-close:hover { color: rgba(255,255,255,.7); }
.map-warning-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.map-warning-icon { font-size: 16px; }
.map-warning p { margin: 0; line-height: 1.6; font-weight: normal; font-size: 12px; color: rgba(255,255,255,.9); }
.border-primary { --bs-border-opacity: 1; border-color: rgba(var(--primary-color-dark), var(--bs-border-opacity)) !important; }
