@import url('../css/fonts.css');

:root {
    --red: #ff0041;
    --red-dark: #c20041;
    --red-light: #FDE8EF;
    --text: #1A1A1A;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #E5E5E5;
    --border-light: #F0F0F0;
    --bg: #FFFFFF;
    --bg-gray: #F7F7F7;
    --bg-accordion: #F5F5F5;
    --header-h: 48px;
    --nav-h: 56px;
    --radius: 4px;
    --radius-lg: 8px;
    --shadow: 0 2px 16px rgba(0,0,0,0.08);
    --font: 'Noto-Sans-Rg', Verdana, Geneva, Tahoma, sans-serif;
    --font-heading: 'AA-Heading-Rg', 'Noto-Sans-Rg', sans-serif;
    --font-bold: 'Noto-Sans-Bd', 'AA-Heading-Bd', sans-serif;
    --font-semibold: 'Noto-Sans-SmBd', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
    font-size: 16px;
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.4;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-height: 100dvh;
    position: relative;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button, input, select { font-family: inherit; font-size: inherit; border: none; outline: none; background: none; }
svg { display: block; }

/* ===== SPLASH ===== */
.splash-page {
    background: #ff0041;
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    overflow: hidden;
}
.splash-screen {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #ff0041;
}
.splash-full-img {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    object-fit: cover;
    object-position: center center;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* 折扣提交后的加载进度：贴在图中右下方 AirArabia 文字正下方 */
.loading-page .splash-screen {
    position: fixed;
}
.loading-page .splash-full-img {
    object-position: center center;
}
.loading-progress {
    position: absolute;
    /* 与图中偏右下的 AirArabia 对齐 */
    left: 63%;
    top: auto;
    bottom: 9%;
    transform: translateX(-50%);
    width: min(40vw, 150px);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.loading-progress-track {
    width: 100%;
    height: 8px;
    border: 1.5px solid #fff;
    border-radius: 999px;
    box-sizing: border-box;
    overflow: hidden;
    background: transparent;
}
.loading-progress-fill {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 999px;
    will-change: width;
}
.loading-progress-pct {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.02em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (max-height: 700px) {
    .loading-progress { bottom: 7%; left: 62%; }
}
@media (min-height: 850px) {
    .loading-progress { bottom: 11%; left: 62%; width: min(38vw, 160px); }
}

/* ===== DOWNLOAD BANNER ===== */
.download-bar {
    background: var(--red);
    color: #fff;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    line-height: 1.3;
}
.download-bar-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
.download-bar-text { flex: 1; }
.download-bar-text strong { display: block; font-weight: 600; }
.download-bar-close {
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* ===== HEADER ===== */
.header {
    background: var(--red);
    min-height: var(--header-h);
    height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 12px;
    padding-right: 12px;
    position: sticky;
    top: 0;
    z-index: 200;
    box-sizing: border-box;
}
.header-white {
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-spacer { width: 28px; flex-shrink: 0; }
.menu-btn {
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}
.header-white .menu-btn span { background: var(--text); }
.header-logo {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: normal;
    letter-spacing: -0.3px;
}
.header-logo-img { height: 28px; width: auto; display: block; }
.header-logo-ar-img {
    height: 28px;
    width: auto;
    max-width: 160px;
    display: block;
    margin-left: auto;
    object-fit: contain;
    mix-blend-mode: lighten;
}
.app-page .header { direction: ltr; }
.app-page .header-logo-ar {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin-left: auto;
    text-align: right;
    padding-right: 4px;
}
.header-login {
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    white-space: nowrap;
}
.header-title {
    color: var(--red);
    font-size: 16px;
    font-family: var(--font-semibold);
    font-weight: normal;
    flex: 1;
    text-align: center;
}
.header-white .header-title { color: var(--red); }
.header-back {
    color: var(--red);
    cursor: pointer;
    padding: 6px;
    transform: scaleX(-1);
}
.app-page .header-back { transform: none; }

/* ===== HERO ===== */
.hero-section {
    position: relative;
    height: 220px;
    overflow: hidden;
}
.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.45) 100%);
    display: flex;
    align-items: flex-end;
    padding: 20px 16px;
}
.hero-title {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ===== BOOKING WIDGET ===== */
.booking-wrap {
    margin: -40px 12px 0;
    position: relative;
    z-index: 10;
}
.booking-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.rewards-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}
.rewards-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 14px;
}
.rewards-brand .r-logo {
    width: 24px;
    height: 24px;
    background: var(--red);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
}
.rewards-links {
    font-size: 12px;
    color: var(--text-secondary);
}
.rewards-links a { color: var(--red); font-weight: 500; }

.booking-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light);
}
.booking-tab {
    flex: 1;
    padding: 12px 4px;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}
.booking-tab svg { width: 18px; height: 18px; color: var(--text-muted); }
.booking-tab.active {
    color: var(--red);
    border-bottom-color: var(--red);
    font-weight: 600;
}
.booking-tab.active svg { color: var(--red); }

.booking-body { padding: 16px; }
.trip-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text);
}
.radio-label input { display: none; }
.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.radio-label input:checked + .radio-custom {
    background: var(--red);
    border-color: var(--red);
}
.radio-label input:checked + .radio-custom::after {
    content: '';
    width: 6px;
    height: 3px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}
.multi-link {
    margin-left: auto;
    color: var(--red);
    font-size: 12px;
    font-weight: 500;
}

.field-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    width: 100%;
    text-align: left;
    background: #fff;
    transition: border-color 0.15s;
}
.field-box:active { border-color: var(--red); }

.btn-red {
    background: var(--red);
    color: #fff;
    border-radius: var(--radius);
    padding: 14px;
    width: 100%;
    font-size: 15px;
    font-family: var(--font-semibold);
    font-weight: normal;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.15s;
}
.btn-red:active { background: var(--red-dark); }

/* ===== SECTIONS ===== */
.section { padding: 24px 16px; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-title {
    font-size: 18px;
    font-family: var(--font-bold);
    font-weight: normal;
    color: var(--text);
}
.section-link {
    color: var(--red);
    font-size: 13px;
    font-weight: 500;
}

.filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.filter-select {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23999' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    cursor: pointer;
}

.deals-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}
.deals-scroll::-webkit-scrollbar { display: none; }
.deal-item {
    flex: 0 0 260px;
    scroll-snap-align: start;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}
.deal-img { height: 130px; object-fit: cover; width: 100%; }
.deal-body { padding: 12px; }
.deal-route { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.deal-price { font-size: 14px; color: var(--red); font-weight: 700; }

/* ===== MANAGE GRID ===== */
.manage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.manage-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 14px;
    cursor: pointer;
    position: relative;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s;
}
.manage-item:active { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.manage-item svg { width: 28px; height: 28px; color: var(--text); margin-bottom: 10px; }
.manage-item span { font-size: 13px; font-weight: 600; line-height: 1.3; flex: 1; }
.manage-arrow {
    position: absolute;
    bottom: 14px;
    right: 14px;
    color: var(--red);
    font-size: 14px;
    font-weight: 700;
}

/* ===== DISCOVER ===== */
.discover-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
    height: 150px;
    cursor: pointer;
}
.discover-card img { width: 100%; height: 100%; object-fit: cover; }
.discover-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.55));
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

/* ===== NEWS ===== */
.news-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}
.news-date { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.news-headline { font-size: 14px; font-weight: 600; line-height: 1.4; }
.news-arrows { display: flex; gap: 8px; }
.news-arrows button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== APP STORE BANNER ===== */
.app-store-banner {
    background: var(--bg-gray);
    padding: 24px 16px;
    text-align: center;
}
.app-store-banner h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.app-store-banner p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px; }
.store-badges { display: flex; gap: 12px; justify-content: center; }
.store-badge {
    background: #000;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 11px;
    text-align: left;
}
.store-badge strong { display: block; font-size: 14px; }

/* ===== FOOTER ACCORDION ===== */
.site-footer { margin-top: 8px; }
.acc-item { border-top: 1px solid var(--border); }
.acc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    background: var(--bg-accordion);
    color: var(--text);
}
.acc-head svg { width: 16px; height: 16px; color: var(--text-muted); transition: transform 0.2s; }
.acc-item.open .acc-head svg { transform: rotate(180deg); }
.acc-body { display: none; padding: 8px 16px 12px; background: #fff; }
.acc-item.open .acc-body { display: block; }
.acc-body a {
    display: block;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}
.footer-copy {
    text-align: center;
    padding: 20px 16px 28px;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ===== ARABIC APP ===== */
.app-page { direction: rtl; font-family: var(--font), 'Segoe UI', Tahoma, sans-serif; width: 100%; }
.app-page-home {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    background: #7eb8d4;
    overscroll-behavior: none;
}
html:has(.app-page-home) {
    overflow: hidden;
    height: 100%;
    background: #7eb8d4;
}
.app-page-home.page-with-nav {
    padding-bottom: 0;
}
.app-page-home.page-with-nav .app-home-shell {
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
.app-page-home.page-with-nav .app-home-bottom {
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
.app-page-home .header {
    flex-shrink: 0;
    width: 100%;
}
.app-home-shell {
    flex: 1;
    min-height: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #7eb8d4;
}
.app-home-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center top;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.app-home-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: clamp(220px, 48dvh, 52%);
    min-height: 220px;
    max-height: calc(100% - 80px);
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 clamp(4px, 1.5vw, 8px) clamp(4px, 1.2vh, 8px);
    box-sizing: border-box;
}
.app-grid-home,
.app-grid.app-grid-home {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr;
    grid-auto-flow: row;
    direction: rtl;
    gap: 6px;
    padding: 0;
    margin: 0;
    background: transparent !important;
    border-top: none;
}
.app-grid-home .app-grid-item {
    aspect-ratio: unset;
    height: 100%;
    min-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 3px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    background: #fff;
    padding: clamp(6px, 1.8vh, 12px) clamp(4px, 1.5vw, 8px) clamp(4px, 1.5vh, 10px);
    gap: clamp(4px, 1vh, 8px);
}
.app-grid-home .app-grid-item:nth-child(3n) { border-left: 1px solid rgba(255, 255, 255, 0.95); }
.app-grid-home .app-grid-item:active {
    background: #fafafa;
    transform: scale(0.98);
}
.app-grid-home .app-grid-label {
    font-size: clamp(9px, 2.6vw, 11px);
    line-height: 1.35;
    color: #444;
    text-align: center;
    padding: 0 2px;
    font-family: var(--font-semibold);
}
.app-grid-home .grid-icon {
    width: clamp(26px, 7.5vw, 36px);
    height: clamp(26px, 7.5vw, 36px);
    object-fit: contain;
}
.app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #f5f5f5;
    border-top: none;
    position: relative;
    z-index: 1;
}
.app-grid-2col {
    grid-template-columns: repeat(2, 1fr);
}
.app-grid-item {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    cursor: pointer;
    border-left: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
    transition: background 0.15s;
    gap: 10px;
    min-height: 120px;
}
.app-grid-2col .app-grid-item:nth-child(2n) { border-left: none; }
.app-grid-item:nth-child(3n) { border-left: none; }
.app-grid-item:active { background: var(--bg-gray); }
.app-grid-item img.grid-icon { width: 38px; height: 38px; object-fit: contain; }
.app-grid-item .rewards-icon-img { width: 38px; height: 38px; object-fit: contain; }
.app-grid-home .app-grid-item img { image-rendering: auto; }
.bottom-nav-item img.nav-icon-img { width: 22px; height: 22px; object-fit: contain; }
.bottom-nav-item:not(.active) img.nav-icon-img { opacity: 0.45; filter: grayscale(1); }
.bottom-nav-item.active img.nav-icon-img { opacity: 1; filter: none; }
.bottom-nav-item.active { color: var(--red); font-family: var(--font-semibold); }
.menu-list-item img { width: 22px; height: 22px; object-fit: contain; }
.logo-big img { height: 32px; width: auto; }
.splash-logo-img { height: 36px; width: auto; filter: brightness(0) invert(1); }
.app-grid-label {
    font-size: 12px;
    color: #444;
    text-align: center;
    line-height: 1.4;
    font-weight: 500;
    padding: 0 4px;
}
.app-grid-item .rewards-icon {
    width: 36px;
    height: 36px;
    background: var(--red);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 9px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 0;
}
.bottom-nav-item .nav-svg { color: var(--text-muted); }
.bottom-nav-item.active { color: var(--red); }
.bottom-nav-item.active .nav-svg { color: var(--red); }
.page-with-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.discount-page.page-with-nav { padding-bottom: 0; }
body.discount-page > .bottom-nav { z-index: 900; }

/* ===== MENU PAGE ===== */
.menu-content { padding: 20px 0; }
.menu-rewards-header {
    text-align: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 8px;
}
.menu-rewards-header .logo-big {
    font-size: 22px;
    font-weight: 800;
    color: var(--red);
    margin-bottom: 4px;
}
.menu-rewards-header .sub { font-size: 12px; color: var(--text-muted); }
.menu-login-btn {
    display: block;
    text-align: center;
    color: var(--red);
    font-weight: 600;
    font-size: 14px;
    padding: 12px;
    margin-bottom: 8px;
}
.menu-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    cursor: pointer;
}
.menu-list-item:active { background: var(--bg-gray); }
.menu-list-item .left { display: flex; align-items: center; gap: 12px; }
.menu-list-item svg { width: 20px; height: 20px; color: var(--text-secondary); }
.menu-list-item .chev { color: var(--text-muted); font-size: 18px; }

/* ===== FORMS ===== */
.form-page { padding: 0; }
.form-intro-centered {
    text-align: center;
    padding: 20px 24px 8px;
    font-size: 14px;
    color: #333;
    line-height: 1.7;
}
.register-offer-page {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: env(safe-area-inset-bottom);
}
.register-offer-page .form-row input { color: #999; }
.register-offer-page .form-row input:focus { color: #333; }
.register-offer-page .form-row input {
    font-size: 16px;
}
.register-offer-page .form-row input.pin-input {
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
}
.register-offer-page .form-row input.pin-input-short {
    letter-spacing: 0.18em;
}
.register-offer-page .form-intro-centered {
    padding-left: clamp(16px, 5vw, 28px);
    padding-right: clamp(16px, 5vw, 28px);
    font-size: clamp(13px, 3.6vw, 15px);
}
.register-offer-page .form-fields,
.register-offer-page .form-submit-wrap {
    padding-left: clamp(12px, 4vw, 20px);
    padding-right: clamp(12px, 4vw, 20px);
}
.register-offer-page .btn-red {
    width: 100%;
    min-height: 48px;
    font-size: clamp(14px, 3.8vw, 16px);
}
.btn-rounded { border-radius: 8px !important; }

/* ===== Manage Bookings Empty ===== */
.bookings-empty {
    text-align: center;
    padding: 24px 20px 40px;
    min-height: 55vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.bookings-illustration {
    width: 100%;
    max-width: 280px;
    margin-bottom: 24px;
}
.bookings-illustration svg { width: 100%; height: auto; }
.bookings-msg {
    font-size: 15px;
    color: #333;
    margin-bottom: 28px;
    font-family: var(--font-semibold);
}
.bookings-login-hint {
    margin-top: 20px;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    padding: 0 16px;
}
.bookings-login-hint a {
    color: #333;
    text-decoration: underline;
    font-family: var(--font-semibold);
}

/* ===== Retrieve Booking Modal ===== */
.retrieve-modal {
    text-align: right;
    max-width: 360px;
    padding: 24px 20px 20px;
}
.retrieve-title {
    color: var(--red);
    font-size: 16px;
    font-family: var(--font-semibold);
    margin-bottom: 20px;
    text-align: right;
}
.retrieve-modal .modal-close-btn { left: 12px; right: auto; }
.retrieve-field { margin-bottom: 16px; }
.retrieve-field label {
    display: block;
    font-size: 13px;
    color: #333;
    margin-bottom: 8px;
    font-family: var(--font-semibold);
}
.retrieve-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    min-height: 48px;
    gap: 8px;
}
.retrieve-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    text-align: right;
    background: transparent;
    color: #333;
}
.retrieve-input-wrap input::placeholder { color: #bbb; }
.field-icon-right { color: #999; font-size: 18px; flex-shrink: 0; }
.field-icon-left { color: #999; font-size: 16px; flex-shrink: 0; }
.retrieve-form .btn-red { margin-top: 8px; }

.form-fields { padding: 0 16px; }
.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}
.form-row svg { width: 22px; height: 22px; color: var(--text-muted); flex-shrink: 0; }
.form-row input {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    text-align: right;
    background: transparent;
}
.form-row input::placeholder { color: var(--text-muted); }
.form-row.ar-date-field {
    align-items: flex-start;
    flex-wrap: wrap;
}
.form-row-date-body {
    flex: 1;
    min-width: 0;
}
.form-row .ar-date-trigger {
    width: 100%;
    cursor: pointer;
}
.form-row .ar-date-display {
    width: 100%;
    flex: 1;
    font-size: 16px;
    color: var(--text);
    text-align: right;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    pointer-events: none;
    padding: 0;
}
.form-row .ar-date-display::placeholder {
    color: var(--text-muted);
}
.form-row.ar-date-field.is-picker-open {
    border-bottom-color: transparent;
}
.form-row .ar-date-picker {
    margin-top: 8px;
}
.form-submit-wrap { padding: 24px 16px; }
.form-message {
    margin: 12px 16px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    display: none;
}
.form-message.success { display: block; background: #E8F5E9; color: #2E7D32; }
.form-message.error { display: block; background: #FFEBEE; color: #C62828; }

/* ===== DISCOUNT PAGE ===== */
.discount-page {
    background: #fff;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
html:has(.discount-page) {
    background: #fff;
    height: 100%;
    overflow: hidden;
}
.discount-page .header {
    flex-shrink: 0;
    width: 100%;
}
.discount-page-wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
.discount-visual {
    flex: 0 0 auto;
    width: 100%;
    height: clamp(200px, 48vh, 420px);
    max-height: 52%;
    position: relative;
    overflow: hidden;
    background: #fff;
}
.discount-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: top center;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.discount-content {
    flex: 1 1 auto;
    min-height: 120px;
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: center;
    padding: clamp(20px, 5vh, 32px) clamp(16px, 5vw, 28px) clamp(12px, 3vh, 20px);
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(20px, 5vh, 28px);
    background: #fff;
    box-sizing: border-box;
}
.discount-msg {
    font-size: clamp(14px, 3.8vw, 16px);
    font-family: var(--font-semibold);
    font-weight: 600;
    margin: 0;
    color: #333;
    letter-spacing: 0;
    line-height: 1.45;
}
.discount-add-btn {
    width: min(320px, calc(100% - 32px));
    max-width: 360px;
    padding: clamp(12px, 3vh, 15px) clamp(20px, 5vw, 24px);
    font-size: clamp(14px, 3.6vw, 15px);
    border-radius: 6px;
    margin-top: 0;
    box-shadow: none;
    flex-shrink: 0;
}

/* ===== Discount Modal (كود الخصم) ===== */
.discount-modal .modal-close-left {
    left: 12px;
    right: auto !important;
    top: 10px;
    font-size: 24px;
    color: #666;
    font-weight: 300;
    line-height: 1;
}
.modal-box.discount-modal {
    max-width: min(340px, calc(100vw - 32px));
    width: calc(100% - 32px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: clamp(18px, 4vh, 24px) clamp(16px, 4vw, 20px) clamp(16px, 3vh, 22px);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
    text-align: right;
    box-sizing: border-box;
    margin: 0 auto;
}
.discount-form {
    overflow: visible;
}
.discount-form .discount-field {
    overflow: visible;
    margin-bottom: clamp(14px, 3vh, 22px);
}
.discount-form .discount-date-field,
.ar-date-field.is-picker-open {
    overflow: visible;
}
.discount-form .discount-date-field.is-picker-open {
    margin-bottom: clamp(8px, 2vh, 12px);
}
.discount-form .discount-field:last-of-type {
    margin-bottom: clamp(20px, 4vh, 28px);
}
.discount-form .discount-date-field.is-picker-open:last-of-type {
    margin-bottom: clamp(12px, 3vh, 16px);
}
.discount-modal-title {
    color: var(--red);
    font-size: clamp(15px, 4vw, 17px);
    font-family: var(--font-semibold);
    font-weight: 600;
    margin: 0 0 clamp(16px, 4vh, 24px);
    padding: 2px 0 0;
    text-align: right;
}
.discount-field label {
    display: block;
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
    font-family: var(--font-semibold);
    font-weight: 600;
    text-align: right;
    line-height: 1.35;
}
.discount-input-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    direction: rtl;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 clamp(10px, 3vw, 12px);
    background: #fff;
    min-height: clamp(44px, 11vw, 48px);
    height: clamp(44px, 11vw, 48px);
    gap: 8px;
    box-sizing: border-box;
}
.discount-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    text-align: right;
    background: transparent;
    color: #333;
    min-width: 0;
    height: 46px;
    padding: 0;
    margin: 0;
}
.discount-input-wrap input::placeholder { color: #bbb; }
.discount-input-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.discount-input-wrap .field-icon-right,
.discount-input-wrap .field-icon-left {
    flex-shrink: 0;
    display: block;
}
.discount-date-field {
    position: relative;
}
.discount-date-wrap {
    direction: rtl;
    position: relative;
    cursor: pointer;
}
.discount-date-display {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    text-align: right;
    color: #333;
    height: 46px;
    padding: 0;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
    pointer-events: none;
}
.discount-date-display::placeholder {
    color: #bbb;
    text-align: right;
}
.discount-date-wrap .field-icon-right {
    flex-shrink: 0;
    pointer-events: none;
}

/* Arabic calendar popup — in-flow below input (avoids clipping) */
.ar-date-picker {
    width: 100%;
    margin-top: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 12px 12px 10px;
    direction: rtl;
    box-sizing: border-box;
}
.ar-date-picker[hidden] {
    display: none !important;
}
.ar-date-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}
.ar-date-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-semibold);
    font-size: 15px;
    color: #222;
}
.ar-date-nav {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.ar-date-nav:active {
    background: #f3f3f3;
}
.ar-date-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
}
.ar-date-weekday {
    text-align: center;
    font-size: 12px;
    color: #888;
    padding: 4px 0;
    font-family: var(--font-semibold);
}
.ar-date-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.ar-date-day,
.ar-date-empty {
    aspect-ratio: 1;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: none;
    background: transparent;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.ar-date-empty {
    cursor: default;
    pointer-events: none;
}
.ar-date-day.is-disabled {
    color: #ccc;
    cursor: not-allowed;
}
.ar-date-day.is-selected {
    background: #1976d2;
    color: #fff;
    font-family: var(--font-semibold);
}
.ar-date-day:not(.is-disabled):not(.is-selected):active {
    background: #eef4fc;
}
.ar-date-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
.ar-date-action {
    border: none;
    background: transparent;
    color: #1976d2;
    font-size: 14px;
    font-family: var(--font-semibold);
    cursor: pointer;
    padding: 6px 8px;
}
.ar-date-action:active {
    opacity: 0.7;
}
.discount-submit-btn,
.discount-form .btn-red {
    width: 100%;
    margin-top: 4px;
    min-height: 48px;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    border-radius: 8px;
    box-shadow: none;
}

/* ===== BOOKING PAGE (APP) ===== */
.book-page { padding: 16px; }
.book-page .profile-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}
.book-header-wrap { position: relative; }
.trip-switch {
    display: flex;
    border: 1.5px solid var(--red);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}
.trip-switch-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--red);
    cursor: pointer;
    transition: all 0.15s;
}
.trip-switch-btn.active {
    background: var(--red);
    color: #fff;
}
.book-field {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
}
.book-field .label { color: var(--text-secondary); font-size: 12px; }
.book-field svg { width: 20px; height: 20px; color: var(--text-muted); }
.date-pair { display: flex; gap: 10px; margin-bottom: 10px; }
.date-cell {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    font-size: 13px;
}
.date-cell.disabled { opacity: 0.35; color: var(--text-muted); }
.date-cell .sub { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.passenger-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
}
.passenger-box .label { font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.passenger-row { display: flex; justify-content: space-around; }
.passenger-col { text-align: center; }
.passenger-col svg { width: 24px; height: 24px; color: var(--text-muted); margin: 0 auto 4px; }
.passenger-col .num { font-size: 18px; font-weight: 700; margin: 4px 0; }
.passenger-col .type { font-size: 11px; color: var(--text-secondary); }
.promo-text { color: #1976D2; font-size: 13px; margin: 12px 0 20px; display: block; }

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}
.modal-overlay-dark {
    background: rgba(0, 0, 0, 0.62);
    padding: max(20px, env(safe-area-inset-top)) clamp(12px, 4vw, 16px) max(20px, env(safe-area-inset-bottom));
    align-items: center;
}
.app-page .modal-overlay {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
}

.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 28px 20px 20px;
    max-width: 320px;
    width: calc(100% - 32px);
    text-align: center;
    position: relative;
    flex-shrink: 0;
}
.modal-box.rtl { direction: rtl; text-align: right; }
.modal-close-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
}
.modal-box.rtl .modal-close-btn { left: auto; right: 12px; }
.modal-box.rtl .modal-close-btn.modal-close-left,
.discount-modal .modal-close-left {
    left: 14px !important;
    right: auto !important;
}
.modal-box h3 { color: var(--red); font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.modal-box p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.modal-form .form-row { padding: 12px 0; }
.modal-form .form-row input { text-align: right; }

/* ===== SUCCESS ===== */
.success-wrap {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}
.success-icon {
    width: 64px;
    height: 64px;
    background: #4CAF50;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 20px;
}
.success-wrap h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.success-wrap p { font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; line-height: 1.5; }

/* ===== STATIC PAGE ===== */
.static-wrap {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}
.static-wrap svg { width: 64px; height: 64px; color: var(--text-muted); margin-bottom: 16px; opacity: 0.4; }
.static-wrap h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.static-wrap p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }

/* ===== ADMIN ===== */
.admin-body { max-width: none; background: var(--bg-gray); }
.admin-header {
    background: var(--red);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-header h1 { font-size: 18px; }
.admin-header a { color: #fff; font-size: 13px; }
.admin-header-links { display: flex; gap: 16px; align-items: center; }
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 20px; }
.admin-login {
    max-width: 400px;
    margin: 80px auto;
    background: #fff;
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.admin-login h2 { text-align: center; color: var(--red); margin-bottom: 24px; }
.admin-settings-card {
    max-width: 480px;
    background: #fff;
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.admin-settings-card h2 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.admin-settings-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.admin-settings-form label { display: block; margin-bottom: 14px; }
.admin-settings-form label span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.admin-settings-form .field-box { color: var(--text); width: 100%; }
.admin-settings-form .btn-red { margin-top: 8px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-box { background: #fff; padding: 20px; border-radius: var(--radius-lg); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.stat-box .num { font-size: 32px; font-weight: 700; color: var(--red); }
.stat-box .lbl { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.table-wrap { background: #fff; border-radius: var(--radius-lg); overflow-x: auto; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 600px; }
.data-table th { background: var(--bg-gray); padding: 12px 16px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.data-table tr:hover { background: #FAFAFA; }
.empty-state { text-align: center; padding: 48px; color: var(--text-muted); }

/* ===== Responsive: short / tall / landscape phones ===== */
@media (max-height: 640px) {
    .app-home-bottom {
        height: clamp(200px, 44dvh, 48%);
        min-height: 200px;
    }
    .app-grid-home .app-grid-item {
        padding: clamp(4px, 1.2vh, 8px) clamp(3px, 1.2vw, 6px);
        gap: clamp(2px, 0.8vh, 6px);
    }
    .discount-content {
        gap: clamp(12px, 2.5vh, 18px);
        padding-bottom: clamp(8px, 2vh, 16px);
        min-height: 100px;
    }
    .discount-modal-title { margin-bottom: 16px; }
    .discount-form .discount-field { margin-bottom: 14px; }
    .discount-form .discount-field:last-of-type { margin-bottom: 20px; }
}

@media (max-height: 520px), (orientation: landscape) and (max-height: 500px) {
    .discount-visual {
        height: clamp(160px, 40vh, 320px);
        max-height: 45%;
    }
    .discount-content {
        margin-top: 0;
        gap: 10px;
        min-height: 90px;
    }
    .app-home-bottom {
        height: clamp(180px, 42dvh, 46%);
        min-height: 180px;
    }
}

@media (min-width: 768px) {
    body {
        max-width: 430px;
        margin: 0 auto;
        box-shadow: 0 0 40px rgba(0,0,0,0.12);
    }
    .bottom-nav {
        left: 50%;
        right: auto;
        width: 100%;
        max-width: 430px;
        transform: translateX(-50%);
    }
    html { background: #d8d8d8; }
    html:has(.app-page-home) { background: #7eb8d4; }
    html:has(.discount-page) { background: #fff; }
}
