:root {
    --dyli-red: #8B0000;
    --dyli-blue: #0066B3;
    --dyli-light-blue: #e7f1ff;
    --dyli-white: #ffffff;
    --dyli-gray: #F2F4F7;
    --dyli-dark: #333333;
}
html, body {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

    /* 2. Webkit 核心瀏覽器 (Chrome, Safari, 新版 Edge) 的隱藏語法 */
    html::-webkit-scrollbar,
    body::-webkit-scrollbar {
        display: none !important;
    }

/* 3. 您原本的 body 其他樣式保持不變 */
body {
    background-color: var(--dyli-gray);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--dyli-dark);
    padding-top: 65px;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ===== Top Bar ===== */
.fami-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 0 12px;
    z-index: 1100;
}

.fami-icon-topbar {
    color: var(--dyli-red);
    font-size: 1.25rem;
    vertical-align: middle;
}

.fami-login-btn {
    color: var(--dyli-red) !important;
}

.topbar-divider {
    width: 1px;
    height: 22px; /* 控制線條高度 */
    background-color: #ccc; /* 淺灰色線條 */
    margin: 0 10px; /* 左右留白間距 */
    align-self: center;
}

/* 清除 Bootstrap 按鈕外框干擾 */
.fami-topbar .btn-link:focus,
.fami-topbar .btn-link:active {
    box-shadow: none;
}

.fami-container {
    margin-bottom: 12px;
    padding: 0 15px;
}

/* ===== 五宮格 Drawer (橫向捲軸版) ===== */
.fami-drawer {
    display: flex;
    background: #ffffff;
    gap: 10px;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    /* 隱藏預設的醜捲軸 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.fami-drawer::-webkit-scrollbar {
        display: none;
}

.fami-drawer .nav-item {
    flex: 0 0 calc(20% - 8px);
    min-width: 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    text-decoration: none;
    color: #666;
    padding: 5px 0;
}

.fami-drawer .nav-item svg,

.fami-drawer .nav-item i {
    font-size: 2.1rem;
    color: #8B0000;
    display: block;
    margin-bottom: 8px;
}

.fami-drawer .nav-item span {
    font-size: 12px;
    line-height: 1.2;
    color: #333;
    white-space: normal; /* 允許換行解決印尼文問題 */
    word-break: break-word; /* 防止長單字撐開 */
    min-height: 2.4em; /* 確保 1-2 行文字時對齊一致 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 捲軸指示器 */
.fami-scroll-indicator-container {
    width: 40px;
    height: 4px;
    background-color: #E0E0E0;
    border-radius: 2px;
    margin: 0 auto 15px;
    position: relative;
    overflow: hidden;
}

.fami-scroll-indicator-bar {
    width: 20px;
    height: 100%;
    background-color: #8B0000;
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: left 0.1s ease-out;
}

.fami-drawer .nav-item:active {
    opacity: 0.6;
}

/* 統一管理 SVG 顯示/隱藏 */
.fami-tab-item svg:nth-of-type(2) {
    display: none;
}

.fami-tab-item.active svg:nth-of-type(1) {
    display: none;
}

.fami-tab-item.active svg:nth-of-type(2) {
    display: block;
}

.fami-tab-item.active .fami-tab-label {
    color: #0078C8;
    font-weight: bold;
}

.custom-carousel-img {
    height: 200px;
    object-position: center;
    width: 100%;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 0.6rem 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--dyli-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 179, 0.1);
}

.readonly-field {
    background-color: #f8f9fa !important;
    border-color: #eee !important;
    color: #888 !important;
    cursor: not-allowed;
}

.btn-dyli-primary {
    background-color: var(--dyli-red);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-dyli-primary:hover {
    background-color: #004d87;
    color: white;
    transform: translateY(-1px);
}

.btn-dyli-outline {
    border: 1px solid var(--dyli-red);
    color: var(--dyli-red);
    background: transparent;
    border-radius: 10px;
    font-weight: 600;
}

.btn-dyli-outline:hover {
    background: var(--dyli-red);
    color: white;
}

.btn-dyli-danger {
    color: var(--dyli-red);
    font-weight: 600;
    border: none;
    background: transparent;
}

.addr-card {
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    background: #fff;
    transition: transform 0.2s;
}

.addr-card:hover {
    border-color: var(--dyli-light-blue);
    background: var(--dyli-light-blue);
}

.addr-badge {
    font-size: 0.7rem;
    background: var(--dyli-red);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    display: inline-block;
}

.addr-count-pill {
    font-size: 0.75rem;
    background: var(--dyli-gray);
    padding: 4px 10px;
    border-radius: 50px;
    font-weight: 600;
}