/* ==================== 基本設定 ==================== */
:root {
    --brand-blue: #2756B8;
    --brand-dark-blue: #1A3F8A;
    --brand-orange: #EE6B2B;
    --brand-light-blue: #EAF0FA;
    --brand-bg-gray: #f5f5f5;
    --brand-border-gray: #e5e5e5;
    --brand-text-gray: #555;
    --brand-footer-dark: #fbfbfb;
    --bottom-background-color: #1F4FBA;
}

html {
  font-size: 16px;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-top: calc(env(safe-area-inset-top, 0px));
    padding-bottom: calc(env(safe-area-inset-bottom, 0px));
}

.main-container {
    flex: 1 1 auto; /* ⭐ 自動填滿剩餘高度，不用 calc(height) */
    overflow-y: auto;
    padding-bottom: calc( var(--bottom-action-height) + env(safe-area-inset-bottom) );
    padding-top: 56px;
}

/* ==================== 導覽列 ==================== */
.main-header {
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 1000;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.brand-logo {
    color: var(--brand-blue) !important;
    font-weight: 700;
    font-size: 1.125rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
    margin-right: 0;
}

    .brand-logo:hover {
        transform: scale(1.05);
    }

    .brand-logo .logo-image {
        height: 25px;
        width: auto;
        object-fit: contain;
        flex-shrink: 0;
    }

    .brand-logo .brand-name {
        line-height: 1;
        letter-spacing: 0.5px;
        white-space: nowrap;
    }

@media (max-width: 360px) {
    .brand-logo {
        font-size: 1rem;
        gap: 6px;
    }

        .brand-logo .logo-image {
            height: 22px;
        }
}

/* 返回按鈕 */
.back-btn {
    color: var(--brand-blue);
    font-size: 1.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: opacity 0.2s;
    z-index: 10; /* 確保按鈕在 header-title 上層 */
}

    .back-btn:hover {
        opacity: 0.8;
        color: var(--brand-blue);
    }

/* Header 標題 */
.header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--brand-dark-blue);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%; /* 確保標題不會與左右按鈕重疊 */
}

/* 當 header 有標題時，調整 container-fluid 的佈局 */
.main-navbar .container-fluid {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 購物車圖示按鈕 */
.cart-icon-btn {
    color: var(--brand-blue);
    font-size: 1.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: opacity 0.2s;
}

    .cart-icon-btn:hover {
        opacity: 0.8;
    }

    .cart-icon-btn .cart-icon-image {
        width: 20px;
        height: 20px;
        object-fit: contain;
        position: relative;
    }

/* 購物車 Badge 點點 */
.cart-badge-dot {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 10px;
    height: 10px;
    background-color: var(--brand-orange);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.top-navbar {
    background: var(--brand-blue);
    font-size: 0.85rem;
}

    .top-navbar a {
        font-size: 0.85rem;
        transition: opacity 0.2s;
    }

        .top-navbar a:hover {
            opacity: 0.8;
        }


/* ==================== 置底功能列 ==================== */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px));
    background: white;
}

    .bottom-action-bar .container-fluid {
        padding: 8px 0;
        background: var(--brand-blue);
        background: var(--bottom-background-color);
    }

.bottom-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: white !important;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0px 12px;
    transition: opacity 0.2s;
    flex: 1;
    text-align: center;
}

    .bottom-action-item:hover {
        opacity: 0.8;
        color: white !important;
    }

    .bottom-action-item:visited {
        color: white !important;
    }

    .bottom-action-item:active {
        color: white !important;
    }

    .bottom-action-item i {
        font-size: 1rem;
    }

    .bottom-action-item span {
        white-space: nowrap;
    }

    .bottom-action-item.disabled {
        opacity: 0.4;
        pointer-events: none;
        cursor: not-allowed;
    }

/* 購物車按鈕停權樣式 */
.cart-disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

/* Footer �]�ݭn�վ� margin */
.brand-footer {
    margin-bottom: 70px;
}