/**
 * ReoReo Common CSS
 * Common styles - used on all pages
 */

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary Colors */
    --primary: #FF6B35;
    --primary-light: #FF8F65;
    --primary-dark: #E85A2D;
    --primary-bg: #FFF5EE;
    
    /* Secondary Colors */
    --secondary: #1E3A5F;
    --service-primary: #7C3AED;
    --service-primary-dark: #6D28D9;
    --service-bg: #F3E8FF;
    
    /* Accent Colors */
    --accent: #00D4AA;
    --accent-bg: #E6FBF6;
    
    /* Status Colors */
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --live-red: #EF4444;
    
    /* Neutral Colors */
    --bg-white: #FFFFFF;
    --bg-gray: #F5F5F5;
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-muted: #9E9E9E;
    --border-color: #EEEEEE;
    
    /* Effects */
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
    
    /* Border Radius */
    --radius: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Layout */
    --nav-height: 56px;
    --bottom-nav-height: 60px;
}

/* ===== RESET & BASE ===== */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

html {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans Thai', 'Noto Sans KR', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
    background: linear-gradient(180deg, #7ECFB3 0%, #6BC4A6 100%); background-attachment: fixed;
    color: #1B4332;
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Language-specific fonts */
body.lang-ko { font-family: 'Noto Sans KR', 'Noto Sans Thai', sans-serif; }
body.lang-th { font-family: 'Noto Sans Thai', 'Noto Sans KR', sans-serif; }
body.lang-zh { font-family: 'Noto Sans SC', 'Noto Sans Thai', sans-serif; }
body.lang-ja { font-family: 'Noto Sans JP', 'Noto Sans Thai', sans-serif; }

a { 
    color: inherit; 
    text-decoration: none; 
}

img { 
    max-width: 100%; 
    display: block; 
}

button { 
    font-family: inherit; 
    cursor: pointer; 
    border: none; 
    background: none; 
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: #7ECFB3;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    border-bottom: none;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header__logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header__logo-icon span {
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
}

.header__logo-icon::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 6px;
    width: 5px;
    height: 18px;
    background: linear-gradient(to bottom,
        rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.9) 15%,
        transparent 15%, transparent 40%,
        rgba(255,255,255,0.6) 40%, rgba(255,255,255,0.6) 55%,
        transparent 55%, transparent 75%,
        rgba(255,255,255,0.4) 75%, rgba(255,255,255,0.4) 90%,
        transparent 90%
    );
    border-radius: 2px;
}

.header__logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1B4332;

    -webkit-text-fill-color: #1B4332;

}

.header__logo-sub {
    font-size: 0.55rem;
    color: rgba(27,67,50,0.6);
    font-weight: 400;
    margin-left: -2px;
}

.header__location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    background: linear-gradient(180deg, #7ECFB3 0%, #6BC4A6 100%); background-attachment: fixed;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    color: #1B4332;
}

.header__location i {
    font-size: 0.65rem;
    color: #FF6B35;
    flex-shrink: 0;
}

.header__location span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header__btn {
    font-size: 1rem;
    color: #1B4332;
    position: relative;
}

.header__btn .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: white;
    font-size: 0.625rem;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== MAIN CONTENT ===== */
.main {
    padding-top: var(--nav-height);
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: #7ECFB3;
    border-top: none;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: rgba(27,67,50,0.6);
    position: relative;
    transition: color 0.2s;
}

.bottom-nav__item.active {
    color: #FF6B35;
}

.bottom-nav__item.active.service-active {
    color: #1B4332;
}

.bottom-nav__icon {
    font-size: 1.25rem;
}

.bottom-nav__label {
    font-size: 0.5625rem;
    font-weight: 500;
}

.bottom-nav__badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: var(--danger);
    color: white;
    font-size: 0.5rem;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Live indicator in nav */
.bottom-nav__live {
    position: relative;
}

.bottom-nav__live-ring {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--live-red);
    border-radius: 50%;
    animation: live-pulse 1.5s infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.5; transform: translateX(-50%) scale(1.2); }
}

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 12px;
}

.section-header__title {
    font-size: 1rem;
    font-weight: 700;
}

.section-header__more {
    font-size: 0.75rem;
    color: rgba(27,67,50,0.6);
}

/* ===== STRIP BANNER ===== */
.strip-banner {
    background: var(--secondary);
    color: white;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}

.strip-banner__icon {
    font-size: 1rem;
}

.strip-banner__text {
    flex: 1;
    font-weight: 500;
}

.strip-banner__link {
    color: #FCD34D;
    font-weight: 600;
    font-size: 0.6875rem;
}

.strip-banner__close {
    color: rgba(255,255,255,0.6);
    padding: 4px;
}

/* ===== QUICK ACTIONS (FAB) ===== */
.quick-actions {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 999;
}

.quick-action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
}

.quick-action-btn:active {
    transform: scale(0.95);
}

.quick-action-btn.primary {
    background: var(--primary);
    color: white;
}

.quick-action-btn.secondary {
    background: #7ECFB3;
    color: #1B4332;
}

.quick-action-btn.service {
    background: var(--service-primary);
    color: white;
}

/* ===== MODAL BASE ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal__overlay {
    position: absolute;
    inset: 0;
}

.modal__content {
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s;
    position: relative;
}

.modal.show .modal__content {
    transform: translateY(0);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: none;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modal__title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(180deg, #7ECFB3 0%, #6BC4A6 100%); background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.modal__body {
    padding: 16px;
}

/* ===== FORM ELEMENTS ===== */
.input-group {
    margin-bottom: 16px;
}

.input-group__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1B4332;
}

.input-group__field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: #7ECFB3;
    transition: border-color 0.2s;
}

.input-group__field:focus {
    outline: none;
    border-color: var(--primary);
}

.input-group__field::placeholder {
    color: rgba(27,67,50,0.6);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn--primary {
    background: var(--primary);
    color: white;
}

.btn--primary:hover {
    background: var(--primary-dark);
}

.btn--secondary {
    background: linear-gradient(180deg, #7ECFB3 0%, #6BC4A6 100%); background-attachment: fixed;
    color: #1B4332;
}

.btn--outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: #1B4332;
}

.btn--full {
    width: 100%;
}

.btn--sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

.btn--lg {
    padding: 16px 32px;
    font-size: 1rem;
}

/* ===== CARDS ===== */
.card {
    background: #7ECFB3;
    border-radius: var(--radius);
    overflow: hidden;
}

.card--shadow {
    box-shadow: var(--shadow);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
}

.badge--primary {
    background: var(--primary-bg);
    color: #FF6B35;
}

.badge--service {
    background: var(--service-bg);
    color: var(--service-primary);
}

.badge--success {
    background: #DCFCE7;
    color: var(--success);
}

.badge--warning {
    background: #FEF3C7;
    color: var(--warning);
}

.badge--danger {
    background: #FEE2E2;
    color: var(--danger);
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Hide scrollbar for horizontal scroll containers */
.scroll-hide-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scroll-hide-scrollbar::-webkit-scrollbar {
    display: none;
}


/* ===== HEADER MENU BUTTON ===== */
.header__menu {
    font-size: 1.125rem;
    color: #1B4332;
    padding: 4px;
    flex-shrink: 0;
}

/* ===== SIDEBAR ===== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: #7ECFB3;
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}
.sidebar.active {
    transform: translateX(0);
}

.sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: none;
    background: linear-gradient(180deg, #7ECFB3 0%, #6BC4A6 100%); background-attachment: fixed;
}
.sidebar__profile {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: rgba(27,67,50,0.6);
}
.sidebar__user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar__nickname {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1B4332;
}
.sidebar__login-link {
    font-size: 0.75rem;
    color: #FF6B35;
    font-weight: 500;
}
.sidebar__close {
    font-size: 1.25rem;
    color: rgba(27,67,50,0.6);
    padding: 4px;
}

.sidebar__menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.sidebar__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    font-size: 0.875rem;
    color: #1B4332;
    transition: background 0.15s;
}
.sidebar__item:hover {
    background: linear-gradient(180deg, #7ECFB3 0%, #6BC4A6 100%); background-attachment: fixed;
}
.sidebar__item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
}
.sidebar__divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 16px;
}

.sidebar__footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.sidebar__version {
    font-size: 0.6875rem;
    color: rgba(27,67,50,0.6);
}

/* ===== LOCATION MODAL LIST ===== */
.location-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.location-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}
.location-item:hover {
    background: linear-gradient(180deg, #7ECFB3 0%, #6BC4A6 100%); background-attachment: fixed;
}
.location-item i {
    color: #FF6B35;
    width: 20px;
    text-align: center;
}

/* ===== MOBILE APP WIDTH - Tablet & Desktop ===== */
@media (min-width: 481px) {
    html { background: #2D3436; }
    body {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 30px rgba(0,0,0,0.1);
        position: relative;
    }
    .header {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
    .quick-actions {
        right: calc(50% - 240px + 16px);
    }
    .modal__content {
        max-width: 480px;
    }
}
/* ===== 5 Section Navigation Buttons (Global) ===== */
.nav-buttons { padding: 8px 16px 6px; background: var(--bg-white); display: flex; flex-direction: column; gap: 5px; }
.nav-buttons__row { display: flex; gap: 5px; }
.nav-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 9px 6px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 0.72rem;
    text-decoration: none; cursor: pointer; border: none; font-family: inherit;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08); transition: transform 0.15s;
}
.nav-btn:active { transform: scale(0.97); }
.nav-btn i { font-size: 0.85rem; }
.nav-btn--market { background: linear-gradient(135deg, #FF6B35, #FF8F65); }
.nav-btn--service { background: linear-gradient(135deg, #7C3AED, #A78BFA); }
.nav-btn--shop { background: linear-gradient(135deg, #059669, #34D399); }
.nav-btn--fresh { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.nav-btn--news { background: linear-gradient(135deg, #3B82F6, #60A5FA); }
/* ===== GREEN THEME - Section Card Layout ===== */
.main {
    background: transparent;
}
.main > section,
.main > div:not(.nav-buttons):not(.modal):not(.quick-actions) {
    margin: 6px 8px;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,0.7);
}
.main > .nav-buttons {
    margin: 6px 8px 2px;
    border-radius: 12px;
    border: 1.5px solid rgba(255,255,255,0.7);
    background: none;
}


/* Section-specific pastel backgrounds */
.main > section:nth-of-type(1) { background: rgba(255,255,255,0.3) !important; }
.main > section:nth-of-type(2) { background: #FFD6D6 !important; }
.main > section:nth-of-type(3) { background: #D6E8FF !important; }
.main > section:nth-of-type(4) { background: #FFE0CC !important; }
.main > section:nth-of-type(5) { background: #D1F2E8 !important; }
.main > section:nth-of-type(6) { background: #FFF3CD !important; }
.main > section:nth-of-type(7) { background: #EDE0F5 !important; }

/* Product list items */
.main .product-item { background: #EDE0F5; border-radius: 12px; }

/* Hide old section separators */
.main > div[style*="height:6px"],
.main > div[style*="height:8px"] {
    display: none;
}

/* Text colors on green/pastel bg */
.main .section-header__title,
.main .category-item__label {
    color: #1B4332;
}
.main .section-header__more {
    color: #2D6A4F;
}

/* Search bar visible */
.main .search-bar {
    background: rgba(255,255,255,0.9) !important;
    border-radius: 12px;
}

/* Cards keep white bg */
.main .shop-card,
.main .scroll-card,
.main .fresh-item,
.main .svc-review,
.main .provider-card,
.main .post-card,
.main .store-card,
.main .card {
    background: #FFFFFF;
    border-radius: 12px;
}

/* Category icons */
.main .category-item__icon {
    background: rgba(255,255,255,0.6) !important;
}

.strip-banner { border-radius: 12px; margin: 6px 8px; }

/* Inline text color overrides for green bg */
.main div[style*="color:#333"] {
    color: #1B4332 !important;
}
.main div[style*="color:var(--text-muted)"],
.main span[style*="color:var(--text-muted)"] {
    color: rgba(27,67,50,0.6) !important;
}
.main div[style*="color:var(--text-secondary)"],
.main span[style*="color:var(--text-secondary)"] {
    color: rgba(27,67,50,0.7) !important;
}

/* Product cards keep dark text */
.main .product-item *,
.main .shop-card *,
.main .svc-review *,
.main .provider-card *,
.main .post-card *,
.main .store-card *,
.main .card * {
    color: var(--text-primary);
}
.main .product-item__meta,
.main .product-item__stat {
    color: var(--text-muted);
}
.main .product-item__price {
    color: var(--primary);
}