:root {
    /* Brand Colors */
    --brand-green: #2E7D32;       /* 穩重的專業綠 */
    --brand-green-light: #E8F5E9; /* 淺綠色背景裝飾 */
    --action-blue: #0288D1;       /* 活力的行動藍 */
    --action-blue-dark: #01579B;  /* 深藍互動態 */
    
    /* Cart Specific Colors */
    --cart-cyan: #00ACC1;         /* Cyan color for cart controls */
    --cart-bg-gray: #F5F5F5;      /* Slightly darker background for cart contrast */
    
    /* Dashboard Colors */
    --card-bg-blue: #E1F5FE;
    --card-text-blue: #0277BD;
    --card-icon-blue: #4FC3F7;
    
    --card-bg-pink: #FFEBEE;
    --card-text-pink: #C62828;
    --card-icon-pink: #E57373;
    
    --card-bg-yellow: #FFFDE7;
    --card-text-yellow: #F9A825;
    --card-icon-yellow: #FFF59D;

    /* Neutral Colors */
    --text-primary: #1A1A1A;      /* 深黑灰，比純黑柔和 */
    --text-secondary: #666666;    /* 次要文字 */
    --text-placeholder: #B0BEC5;  /* 輸入框提示字 */
    --bg-body: #F9FAFB;           /* 極淺灰背景，增加層次 */
    --bg-white: #FFFFFF;
    --bg-input: #F0F2F5;          /* 輸入框背景色 */
    
    /* UI Variables */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-pill: 50px;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.04);
    --shadow-float: 0 4px 12px rgba(46, 125, 50, 0.15);
    --shadow-nav: 0 -4px 20px rgba(0,0,0,0.05);
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Navbar Height */
    --nav-height: 60px;
    --safe-area-bottom: env(safe-area-inset-bottom);
    --bottom-nav-offset: calc(var(--nav-height) + var(--safe-area-bottom));
    --floating-ui-page-bottom-obstruction: 0px;
    --floating-ui-blocking-bottom: max(var(--bottom-nav-offset), var(--floating-ui-page-bottom-obstruction));
    --floating-ui-gap: 16px;
    --floating-ui-bottom: calc(var(--floating-ui-blocking-bottom) + var(--floating-ui-gap));
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Roboto', 'Noto Sans TC', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    /* Use dvh (Dynamic Viewport Height) to handle mobile browser bars */
    min-height: 100dvh; 
    font-size: 16px;
    line-height: 1.5;
    /* Basic bottom padding for safe area, overridden if nav exists */
    padding-bottom: env(safe-area-inset-bottom);
}

/* On Mobile, we use Fixed position for navbar, so we need padding on body */
body.has-bottom-nav {
    padding-bottom: calc(var(--nav-height) + var(--safe-area-bottom) + 20px);
}

/* --- Layout Wrappers --- */
.main-container {
    flex: 1;
    width: 100%;
    max-width: 480px; /* Mobile constraints */
    margin: 0 auto;
    /* Reduced padding for small mobile screens */
    padding: 0px 20px; 
    background-color: var(--bg-white);
    min-height: 100%;
}

.dashboard-container {
    background-color: transparent; /* Dashboard usually sits on gray body, but here main-container is white. */
    padding-top: 10px;
}

/* On Desktop: create a card effect */
@media (min-width: 481px) {
    body.has-bottom-nav {
        /* Reset padding because we use Sticky navbar inside the container, which handles its own space */
        padding-bottom: 40px; 
    }

    .main-container {
        margin: 40px auto;
        min-height: auto;
        border-radius: 24px;
        box-shadow: var(--shadow-card);
        padding: 48px;
        /* Ensure the container is at least tall enough to look good */
        min-height: calc(100vh - 80px); 
    }
    .dashboard-container {
        padding: 48px;
    }
    body {
        justify-content: center;
        min-height: 100vh;
    }
}

/* --- Header Styles --- */
#app-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

body[data-shared-header-visibility="hidden"] #app-header {
    display: none;
}

.app-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--brand-green);
    filter: drop-shadow(0 2px 4px rgba(46, 125, 50, 0.2));
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-green);
    letter-spacing: -0.5px;
}

/* --- Typography & Titles --- */
.page-title {
    margin-top: 20px;
    margin-bottom: 40px;
    text-align: left;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
    letter-spacing: -0.5px;
}

/* --- Form Elements --- */
.registration-form { display: flex; flex-direction: column; gap: 24px; }
.input-group { position: relative; }

input[type="text"], input[type="number"], input[type="tel"], textarea {
    width: 100%;
    font-size: 16px;
    border: 2px solid transparent;
    background-color: var(--bg-input);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: var(--transition-smooth);
    font-weight: 500;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}
input::placeholder, textarea::placeholder { color: var(--text-placeholder); font-weight: 400; }
input:focus, textarea:focus, select:focus {
    background-color: var(--bg-white);
    border-color: var(--action-blue);
    box-shadow: 0 0 0 4px rgba(2, 136, 209, 0.1);
    outline: none;
}

/* Error Message */
.error-message {
    display: block;
    color: #d32f2f;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

.error-message:empty {
    display: none;
}

/* Select Style */
.select-wrapper { position: relative; }
select {
    width: 100%;
    padding: 18px 40px 18px 20px;
    font-size: 16px;
    border: 2px solid transparent;
    background-color: var(--bg-input);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    -webkit-appearance: none;
    appearance: none;
    font-weight: 500;
    cursor: pointer;
}
.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #9E9E9E;
}

.input-action-group { display: flex; gap: 12px, align-items: stretch; }
.input-action-group input { flex: 1; min-width: 0; }

.btn-action-side {
    padding: 0 20px;
    font-size: 15px;
    font-weight: 500;
    color: white;
    background-color: var(--action-blue);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
}
.btn-action-side:hover { background-color: var(--action-blue-dark); }
.btn-action-side:active { transform: scale(0.96); }

/* Checkbox */
.checkbox-group { margin-top: 8px; display: flex; align-items: center; }
.custom-checkbox {
    display: flex; align-items: center; cursor: pointer; user-select: none;
    font-size: 14px; color: var(--text-secondary); line-height: 1.4;
}
.custom-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark {
    height: 22px; width: 22px; background-color: var(--bg-white);
    border: 2px solid #CFD8DC; border-radius: 6px; margin-right: 12px;
    position: relative; transition: var(--transition-fast); flex-shrink: 0;
}
.custom-checkbox:hover input ~ .checkmark { border-color: var(--text-secondary); }
.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--brand-green); border-color: var(--brand-green);
    box-shadow: 0 2px 5px rgba(46, 125, 50, 0.3);
}
.checkmark:after { content: ""; position: absolute; display: none; }
.custom-checkbox input:checked ~ .checkmark:after { display: block; }
.custom-checkbox .checkmark:after {
    left: 7px; top: 3px; width: 5px; height: 10px; border: solid white;
    border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.label-text a { color: var(--action-blue); text-decoration: none; font-weight: 700; position: relative; padding: 4px 0; }

/* Buttons */
.btn {
    width: 100%; padding: 18px; font-size: 18px; font-weight: 700;
    border: none; border-radius: var(--radius-pill); cursor: pointer;
    transition: all 0.3s ease; margin-top: 32px; letter-spacing: 0.5px;
    position: relative; overflow: hidden; user-select: none;
}
.btn-disabled { background-color: #E0E0E0; color: #9E9E9E; cursor: not-allowed; }
.btn-active {
    background: linear-gradient(135deg, var(--action-blue) 0%, #0277BD 100%);
    color: white; box-shadow: 0 8px 20px rgba(2, 136, 209, 0.3); transform: translateY(0);
    flex-shrink: 0;
}
.btn-active:hover { box-shadow: 0 10px 25px rgba(2, 136, 209, 0.4); transform: translateY(-2px); }
.btn-active:active { transform: translateY(1px); box-shadow: 0 4px 10px rgba(2, 136, 209, 0.2); }
.btn-danger {
    background: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
    color: white; box-shadow: 0 8px 20px rgba(229, 57, 53, 0.3); transform: translateY(0);
    flex-shrink: 0;
}
.btn-danger:hover { box-shadow: 0 10px 25px rgba(229, 57, 53, 0.4); transform: translateY(-2px); }
.btn-danger:active { transform: translateY(1px); box-shadow: 0 4px 10px rgba(229, 57, 53, 0.2); }

/* Helper Text */
.helper-text { text-align: center; color: var(--text-placeholder); font-size: 13px; margin-top: 16px; font-weight: 400; }
.helper-text-start { color: var(--text-secondary); font-size: 14px; margin-bottom: -12px; }
/* Footer */
.app-footer { padding: 32px; text-align: center; color: var(--text-placeholder); font-size: 12px; background: transparent; }
/* --- HOME PAGE SECTIONS --- */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 32px 0 16px 0;
}

.first-section {
    margin-top: 10px;
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-group-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.info-row {
    padding: 20px 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.info-divider {
    height: 1px;
    background-color: #F0F0F0;
    margin-left: 72px;
    margin-right: 0;
}

.info-icon {
    background-color: #F5F5F5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-content h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.info-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.info-content strong {
    color: var(--text-primary);
    font-weight: 700;
}

.trend-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.trend-card {
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.card-blue { background-color: var(--card-bg-blue); }
.card-pink { background-color: var(--card-bg-pink); }
.card-yellow { background-color: var(--card-bg-yellow); }

.card-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: rgba(255,255,255,0.6);
}

.box-blue { color: var(--card-text-blue); }
.box-red { color: var(--card-text-pink); }
.box-yellow { color: #FBC02D; }

.card-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-sub {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-price {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.badge-dark-blue { background-color: #0288D1; color: white; }
.badge-red { background-color: #E53935; color: white; }
.badge-white-red { background-color: #fff; color: #E53935; border: 1px solid rgba(229, 57, 53, 0.2); font-size: 11px; }

.card-arrow { opacity: 0.5; }

/* --- Bottom Navigation --- */
.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--nav-height) + var(--safe-area-bottom));
    background-color: #fff;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    justify-items: center;
    align-items: center;
    padding-bottom: var(--safe-area-bottom);
    box-shadow: var(--shadow-nav);
    z-index: 1000;
}

@media (min-width: 481px) {
    .bottom-navbar {
        position: sticky;
        bottom: 0;
        left: auto;
        right: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 24px 24px 0 0;
        border-top: none;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    }
}

.nav-item {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #9E9E9E;
    gap: 4px;
    transition: color 0.2s ease;
}

.nav-item:active { background-color: rgba(0,0,0,0.02); }
.nav-item.active { color: var(--action-blue); }

.nav-icon { width: 24px; height: 24px; }
.nav-label { font-size: 10px; font-weight: 500; }

.nav-icon-wrapper { position: relative; display: inline-block; }
.nav-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background-color: #D32F2F;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- UTILITY CLASSES --- */
.hidden {
    display: none !important;
}

.form-grid-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.form-grid-row .input-group,
.form-grid-row .select-wrapper {
    flex: 1;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.radio-option-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    cursor: pointer;
    user-select: none;
}

.radio-option-row input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-circle {
    width: 22px;
    height: 22px;
    border: 2px solid #B0BEC5;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.radio-option-row input:checked + .radio-circle {
    border-color: var(--action-blue);
}

.radio-option-row input:checked + .radio-circle::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 12px; height: 12px;
    background-color: var(--action-blue);
    border-radius: 50%;
}

.radio-label {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.payment-hint-icon {
    margin-right: 6px;
    color: #00c300;
}

/* --- POPOVER API STYLES --- */
[popover] {
    margin: 0;
    padding: 0;
    border: none;
    background: #fff;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
    
    /* Mobile Bottom Sheet Style */
    width: 100%;
    max-width: 480px;
    inset: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    
    border-radius: 24px 24px 0 0;
    
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), display 0.3s allow-discrete;
    
    padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 481px) {
    [popover] {
        position: fixed;
    }
}

[popover]:popover-open {
    transform: translateX(-50%) translateY(0);
    @starting-style {
        transform: translateX(-50%) translateY(100%);
    }
}

[popover]::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
    /* Keep dim overlay but remove blur so SFNotify remains readable */
    backdrop-filter: none;
    opacity: 0;
    transition: opacity 0.3s;
}

[popover]:popover-open::backdrop {
    opacity: 1;
    @starting-style {
        opacity: 0;
    }
}

.popover-header {
    padding: 20px 24px;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.popover-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.popover-close {
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.popover-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.popover-content {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Location List Styles */
.location-group-title {
    font-size: 16px;
    font-weight: 700;
    color: #8D1717; /* Dark Red from design */
    margin: 24px 0 12px 0;
    padding-left: 8px;
    border-left: 4px solid #8D1717;
    line-height: 1;
}

.location-group-title:first-child {
    margin-top: 0;
}

.location-card {
    display: flex;
    align-items: center;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;
}

.location-card:hover {
    border-color: #ddd;
}

.location-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.location-info {
    flex: 1;
}

.loc-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.loc-addr {
    font-size: 13px;
    color: var(--text-secondary);
}

.radio-indicator {
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-left: 12px;
    position: relative;
}

/* Checked State */
.location-card input:checked ~ .radio-indicator {
    border-color: #ccc; 
}

.location-card input:checked ~ .radio-indicator::after {
    content: '';
    position: absolute;
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background-color: #ddd; /* Gray circle per design */
    border-radius: 50%;
}

.popover-footer-simple {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 16px;
    background: transparent;
}

/* --- ACCOUNT PAGE SPECIFIC --- */
.account-profile-section {
    background: #fff;
    padding: 24px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.profile-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 16px;
    gap: 8px;
}

.profile-row:last-child {
    margin-bottom: 0;
}

.profile-label {
    width: 90px;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
}

.wallet-row, .profile-row > div, .wallet-row > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-row > div {
    flex: 1;
    min-width: 0;
}

/* === Inline-edit：姓名列 view / edit 切換 === */
.name-view {
    display: flex;
    align-items: center;
    gap: 6px;
}

.name-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.btn-inline-edit {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #999;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.15s;
}

.btn-inline-edit:hover {
    color: var(--action-blue);
}

.btn-cancel-name {
    background: none;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-cancel-name:hover {
    border-color: #BDBDBD;
    color: #333;
}

.profile-value-input {
    flex: 1;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 16px;
    color: var(--text-primary);
    min-width: 0;
}

.btn-update-name {
    background-color: #E0E0E0;
    color: #9E9E9E;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: not-allowed;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-update-name:not(:disabled) {
    background-color: var(--action-blue);
    color: white;
    cursor: pointer;
}

.btn-update-name:not(:disabled):hover {
    background-color: var(--action-blue-dark);
}

.btn-update-name:not(:disabled):active {
    transform: scale(0.96);
}

.wallet-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.wallet-row:last-child {
    margin-bottom: 0;
}

.wallet-detail-link {
    font-size: 13px;
    color: #B0BEC5;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.cc-pill {
    display: flex;
    align-items: center;
    background: #FAFAFA;
    border: 1px solid #EEEEEE;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 14px;
    color: #333;
    width: fit-content;
    gap: 8px;
}

.cc-delete-btn {
    background: #0288D1;
    border: none;
    border-radius: 4px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    font-size: 12px;
}

.cc-add-btn {
    background: #0288D1;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
}

.btn-referral {
    background-color: #00C853;
    color: white;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    cursor: pointer;
}

.store-selector-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.store-select-btn {
    flex: 1;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    color: #333;
}

.store-add-btn-square {
    width: 44px;
    height: 44px;
    background: #0288D1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
}

.btn-mini-add {
    width: 24px;
    height: 24px;
    background: #00A3D9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
}

.manager-tag {
    background: #F5F5F5;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-primary);
}

.btn-remove-manager {
    color: #999;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    display: flex;
    align-items: center;
}

.btn-remove-manager:hover {
    color: #F44336;
}

.restaurant-manage-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    position: relative;
    border: 1px solid #F5F5F5;
}

.edit-icon-abs {
    position: absolute;
    top: 16px;
    right: 16px;
    color: #B0BEC5;
    cursor: pointer;
}

.store-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-right: 24px;
}

.store-info-row {
    font-size: 15px;
    color: #555;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.label-gray {
    color: #999;
    margin-right: 4px;
    min-width: 70px;
}

.upload-box {
    width: 60px;
    height: 40px;
    background: #E0E0E0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-left: 8px;
    cursor: pointer;
}

.contact-person-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #E0E0E0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.coupon-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 16px;
}

.coupon-header-row {
    display: flex;
    padding: 0 20px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #999;
    font-weight: 700;
}

.coupon-card {
    display: flex;
    align-items: center;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    padding: 24px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    background: #fff;
}

.coupon-left {
    flex: 1;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    border-right: 1px solid #E0E0E0;
}

.coupon-right {
    flex: 1;
    text-align: center;
    font-size: 14px;
    color: #666;
    letter-spacing: 0.5px;
}

.funds-balance-card {
    background: linear-gradient(135deg, #039BE5 0%, #0288D1 100%);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(2, 136, 209, 0.3);
}

.funds-balance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.funds-balance-amount {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 1px;
}

.funds-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #999;
    margin-bottom: 12px;
}

.funds-record-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #F0F0F0;
}

.funds-record-item:last-child {
    border-bottom: none;
}

.funds-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.funds-icon.debit {
    background-color: #F5F5F5;
    color: #757575;
}

.funds-icon.credit {
    background-color: #FFF8E1;
    color: #FBC02D;
}

.funds-info {
    flex: 1;
}

.funds-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.funds-date {
    font-size: 12px;
    color: #999;
}

.funds-amount {
    font-size: 18px;
    font-weight: 700;
}

.funds-amount.debit {
    color: var(--text-primary);
}

.funds-amount.credit {
    color: #0288D1;
}

.funds-view-more {
    text-align: center;
    padding-top: 24px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

/* --- SHOP PAGE STYLES --- */
.shop-action-group { margin-bottom: 24px; }
.shop-main-btn {
    width: 100%; background: linear-gradient(90deg, #00A3D9 0%, #0288D1 100%);
    border: none; border-radius: 12px; padding: 16px 20px;
    display: flex; justify-content: space-between; align-items: center;
    color: white; font-size: 18px; font-weight: 500; cursor: pointer;
    box-shadow: 0 4px 15px rgba(2, 136, 209, 0.3); transition: transform 0.2s, box-shadow 0.2s;
}
.shop-main-btn:active { transform: scale(0.98); }
.btn-content { display: flex; align-items: center; gap: 12px; }
.btn-icon { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; }
.btn-arrow { display: flex; align-items: center; }
.shop-display-box {
    margin-top: 12px; border: 1px solid #E0E0E0; border-radius: 12px;
    padding: 16px 20px; font-size: 16px; color: var(--text-placeholder);
    background-color: #fff; min-height: 54px; display: flex; align-items: center;
}
.shop-display-box.selected { color: var(--text-primary); font-weight: 500; }

/* Radio List for Shop */
.radio-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-item {
    display: flex;
    align-items: center;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    gap: 12px;
}

.radio-item:hover {
    background-color: #F9F9F9;
    border-color: #D0D0D0;
}

.radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-content {
    flex: 1;
}

.radio-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: color 0.2s;
}

.radio-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Check icon (hidden by default) */
.radio-check-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
    color: var(--action-blue);
}

/* Selected state */
.radio-item:has(input[type="radio"]:checked) {
    border-color: var(--action-blue);
    background-color: rgba(2, 136, 209, 0.04);
}

.radio-item:has(input[type="radio"]:checked) .radio-title {
    color: var(--action-blue);
}

.radio-item:has(input[type="radio"]:checked) .radio-check-icon {
    opacity: 1;
}

/* Calendar Styles */
.calendar {
    padding-bottom: 20px;
}

.calendar-header {
    margin-bottom: 20px;
}

.calendar-month {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 500;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 20px;
    text-align: center;
}

.cal-day {
    font-size: 16px;
    color: var(--text-primary);
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    border-radius: 50%;
    width: 40px;
    margin: 0 auto;
    transition: background-color 0.2s;
}

.cal-day.active {
    background-color: #FFC107; /* Yellow */
    color: white;
    font-weight: 700;
}

.cal-day.closed {
    color: #E53935; /* Red */
    cursor: default;
}

.cal-day.closed .sub-text {
    font-size: 9px;
    line-height: 1;
    margin-top: 2px;
}

@media (hover: hover) {
    .cal-day:not(.closed):not(.active):hover {
        background-color: #f5f5f5;
    }
}

.popover-close-btn {
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.popover-close-btn:hover {
    background-color: #e0e0e0;
}

.popover-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

/* --- Credit Card Input Grid --- */
.cc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.cc-input {
    width: 100%;
    padding: 14px 10px !important;
    font-size: 18px !important;
    font-weight: 600;
    text-align: center;
    letter-spacing: 2px;
    border: 2px solid transparent !important;
    background-color: var(--bg-input) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
    transition: var(--transition-smooth) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.cc-input::placeholder {
    color: var(--text-placeholder);
    font-weight: 400;
}

.cc-input:focus {
    background-color: var(--bg-white) !important;
    border-color: var(--action-blue) !important;
    box-shadow: 0 0 0 4px rgba(2, 136, 209, 0.1) !important;
    outline: none !important;
}

/* --- LINE Share Button --- */
.line-share-button {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-pill);
    background-color: #00B900;
    color: white;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(0, 185, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.5px;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.line-share-button:hover {
    background-color: #009600;
    box-shadow: 0 6px 16px rgba(0, 185, 0, 0.4);
    transform: translateY(-2px);
}

.line-share-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 185, 0, 0.2);
}

.line-share-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.line-share-button:active::before {
    left: 100%;
}

/* --- Popover Form Note Text --- */
.popover-note-text {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
    margin-bottom: 0;
    line-height: 1.5;
    font-weight: 400;
}

/* --- Popover Form Spacing Override --- */
.popover-content .registration-form {
    gap: 12px;
}

.popover-content .form-label {
    margin-bottom: 6px;
}

.popover-content .input-group {
    margin-bottom: 0;
}

/* Reduce padding for inputs in popovers to ensure consistent spacing */
.popover-content input[type="text"],
.popover-content input[type="tel"],
.popover-content select {
    padding: 14px 16px !important;
}

.popover-content select {
    padding: 14px 36px 14px 16px !important;
}

/* --- Inline Confirm Dialog --- */
.inline-confirm {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: stretch;
    gap: 6px;
    margin-top: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    box-sizing: border-box;
    cursor: default;
}

.inline-confirm-text {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    text-align: left;
    font-weight: 500;
}

.inline-confirm-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.inline-confirm-yes,
.inline-confirm-no {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    height: 36px;
    margin-top: 0;
    transition: var(--transition-fast);
}

.inline-confirm-yes {
    background: #dc3545;
    color: #fff;
    border: none;
}

.inline-confirm-yes:hover {
    background: #c82333;
}

.inline-confirm-yes:active {
    background: #bd2130;
}

.inline-confirm-no {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.inline-confirm-no:hover {
    background: #e9ecef;
}

.inline-confirm-no:active {
    background: #dde0e3;
}

/* --- PRODUCTS PAGE STYLES --- */

/* Lock body & html scroll when Products page is active */
html:has(.products-page-layout),
body:has(.products-page-layout) {
    overflow: hidden;
    height: 100dvh;
}

/* Products page: outer container is NOT scrollable — keeps navbar outside the scroll context */
.products-page-layout {
    --products-page-bottom-gap: 16px;
    --products-view-cart-reserved-space: 0px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Inner scroll area: header + product list scroll together */
.products-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    overscroll-behavior: contain;
    padding-bottom: var(--products-view-cart-reserved-space);
    scroll-padding-bottom: var(--products-view-cart-reserved-space);
}

.sticky-header-container {
    flex-shrink: 0;
    z-index: 90;
    background-color: var(--bg-body);
    margin-left: -20px;
    margin-right: -20px;
    padding: 16px 20px 8px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

@media (min-width: 481px) {
    .sticky-header-container {
        margin-left: -48px;
        margin-right: -48px;
        padding: 24px 48px 16px 48px;
    }
}

.filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-btn {
    flex: 1;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.filter-btn:active {
    background-color: #F5F5F5;
}

.filter-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.product-search {
    position: relative;
    margin-bottom: 16px;
}

.product-search input {
    width: 100%;
    background: #fff;
    border: 1px solid #E0E0E0;
    padding: 12px 40px 12px 42px; /* Right padding increased for clear button */
    border-radius: 12px;
    font-size: 15px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9E9E9E;
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9E9E9E;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-clear-btn.is-visible {
    display: flex;
}

.search-clear-btn:hover {
    color: #666;
}

.search-clear-btn:active {
    transform: translateY(-50%) scale(0.9);
}

.products-page-layout .product-search-wrapper.floating-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--bg-body, #e9ecef);
    padding: 12px 20px;
    margin: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    animation: slideDownProductSearch 0.3s ease-out;
}

.products-page-layout .product-search-wrapper.floating-top .product-search {
    margin-bottom: 0;
}

@media (min-width: 481px) {
    .products-page-layout .product-search-wrapper.floating-top {
        padding: 16px 48px;
    }
}

@keyframes slideDownProductSearch {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
}

.category-tabs.dragging {
    cursor: grabbing;
    user-select: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.cat-tab {
    padding: 8px 16px;
    border-radius: 20px;
    background-color: #F0F2F5;
    color: #666;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-tab.active {
    background-color: var(--brand-green);
    color: white;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.2);
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 16px;
    margin-top: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
    /* let the parent .products-scroll-area handle scrolling so header scrolls together */
    overflow: visible;
    overflow-x: hidden;
    flex: 0 0 auto;
    min-height: 0;
}

.view-cart-btn {
    position: fixed;
    bottom: var(--floating-ui-bottom);
    left: 50%;
    transform: translateX(-50%);
    background-color: #000;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 999;
    white-space: nowrap;
}

.view-cart-btn.is-visible {
    display: flex;
}

.view-cart-btn:hover,
.view-cart-btn:active {
    background-color: #333;
    color: #fff;
    text-decoration: none;
}

.product-card {
    padding: 16px;
    border-bottom: 1px solid #F0F0F0;
    background-color: #fff;
}

.product-card:last-child {
    border-bottom: none;
}

.product-card-inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.prod-image-box {
    width: 80px;
    height: 80px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 0;
    cursor: pointer;
}

.prod-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.prod-image-box:focus-visible {
    outline: 2px solid rgba(0, 121, 107, 0.25);
    outline-offset: 2px;
}

.prod-details-box {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prod-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0;
}

.prod-name-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    min-width: 0;
}

.prod-name {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.prod-name-btn {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    line-height: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prod-name-btn:focus-visible {
    outline: 2px solid rgba(0, 121, 107, 0.25);
    outline-offset: 2px;
}

.favorite-toggle-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #d64545;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.favorite-toggle-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: fill 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.favorite-toggle-btn.is-active svg {
    fill: currentColor;
}

.favorite-toggle-btn:hover {
    background-color: rgba(214, 69, 69, 0.08);
}

.favorite-toggle-btn:focus-visible {
    outline: 2px solid rgba(214, 69, 69, 0.28);
    outline-offset: 2px;
}

.favorite-toggle-btn.is-pending,
.favorite-toggle-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.favorite-toggle-btn.is-pending svg {
    transform: scale(0.94);
}

.price-container {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    width: 100%;
}

.prod-sales-unit {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.prod-total-price {
    font-size: 18px;
    font-weight: 700;
    color: #00796B;
}

.price-value-pair {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.price-value-strikethrough {
    color: #9E9E9E;
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

.price-value-highlight {
    color: #D32F2F;
}

.prod-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.prod-unit-price {
    font-family: 'Roboto', sans-serif;
    color: var(--text-secondary);
    font-size: 14px;
}

.tag-promo {
    background-color: #F3E5F5;
    color: #7B1FA2;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    font-weight: 700;
}

.prod-name-wrapper .tag-promo {
    margin-left: 0;
}

/* Base Qty Control */
.qty-control {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    height: 30px;
    min-width: 90px;
    justify-content: space-between;
    padding: 0 4px;
    margin-top: 0;
    align-self: auto;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
}

.qty-btn:active {
    background-color: #f5f5f5;
}

.qty-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    width: 30px;
    text-align: center;
}

/* Cart Quantity Control (Cyan Theme) */
.qty-control.cart-cyan-theme {
    border: 1px solid var(--cart-cyan);
    color: var(--cart-cyan);
}

.qty-control.cart-cyan-theme .qty-btn {
    color: var(--cart-cyan);
}

.qty-control.cart-cyan-theme .qty-val {
    color: var(--cart-cyan);
}

/* --- CART PAGE STYLES --- */

/* Lock body & html scroll when Cart page is active */
html:has(.cart-page-layout),
body:has(.cart-page-layout) {
    overflow: hidden;
    height: 100dvh;
}

/* Cart page: keep header and footer fixed while list + summary scroll */
.cart-page-layout {
    --cart-page-bottom-gap: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.cart-scroll-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.cart-scroll-area .product-list {
    margin-top: 0;
    overflow: visible;
    flex: 0 0 auto;
}

.cart-scroll-area .cart-summary {
    margin-top: 0;
}

/* Delivery Info Box */
.delivery-info-box {
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    padding: 16px 20px;
    background-color: #F9FAFB;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.delivery-info-box-compact {
    padding: 8px 12px;
}

.delivery-info-box-compact .delivery-info-row {
    font-size: 14px;
}

.delivery-info-row {
    display: flex;
    align-items: center;
    font-size: 15px;
    line-height: 1.5;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 90px;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Cart Summary */
.cart-summary {
    background-color: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-top: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
    border: 1px solid #F0F0F0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 20px;
    color: #666;
    font-weight: 700;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-row.discount {
    color: var(--brand-green);
}

.summary-label-group,
.summary-value-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-hint {
    font-size: 16px;
    color: #999;
}

input.discount-input {
    width: 55px;
    max-width: 55px;
    flex: 0 0 55px;
    text-align: right;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.95em;
    line-height: 1.2;
}

.summary-action-btn {
    font-size: 0.75em;
    color: #4CAF50;
    background: none;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
}

.cart-checkout-action {
    flex: 0 0 auto;
    padding-bottom: calc(var(--bottom-nav-offset) + var(--cart-page-bottom-gap));
}

.cart-checkout-btn {
    margin-top: 0;
}

@media (min-width: 481px) {
    .cart-checkout-action {
        padding-bottom: var(--cart-page-bottom-gap);
    }
}

.summary-divider {
    height: 1px;
    background-color: #E0E0E0;
    margin: 16px 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    color: #9E9E9E; /* Label color */
}

.total-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Empty State */
.no-products {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 15px;
}

/* Field Validation Error Highlight */
.input-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15) !important;
}

.select-error select {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15) !important;
}

/* Floating action buttons */
.floating-actions-container {
    position: fixed;
    left: var(--floating-ui-gap);
    right: auto;
    bottom: var(--floating-ui-bottom);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.floating-actions-container.dragging {
    cursor: grabbing;
}

.floating-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #eee;
    border-radius: 50%;
    background: linear-gradient(135deg, #009688 0%, #00796B 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.floating-actions-container.dragging .floating-btn {
    cursor: grabbing;
    transition: none;
}

.floating-btn:active {
    transform: scale(0.9);
    background-color: #f5f5f5;
}

.floating-btn svg {
    width: 20px;
    height: 20px;
}

.floating-btn#btn-back-to-top {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.floating-btn#btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

html.font-size-sm body {
    zoom: 0.95;
}

html.font-size-lg body {
    zoom: 1.1;
}

@supports not (zoom: 1) {
    html.font-size-sm {
        font-size: 95%;
    }

    html.font-size-lg {
        font-size: 110%;
    }
}

.font-size-btn {
    position: relative;
}

.font-size-btn .font-indicator {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    color: #00796B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
}
