@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
    --primary: #d83535;
    --text: #222;
    --gray: #777;
    --bg: #fff;
}

/* ===== 기본 레이아웃 ===== */
body {
    margin: 0;
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    background: var(--bg);
    -webkit-tap-highlight-color: transparent;
}

/* ===== 헤더 전체 ===== */
.jw-header {
    width: 100%;
    background: var(--bg);
    border-bottom: 1px solid #eee;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.jw-header-container {
    width: 70%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    box-sizing: border-box;
}

/* ===== 로고 ===== */
.jw-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.jw-logo img {
    height: 36px;
    width: auto;
    transition: all 0.3s ease;
}

.jw-logo span {
    font-weight: 700;
    font-size: 20px;
    color: var(--text);
}

/* ===== 네비게이션 ===== */
.jw-nav {
    display: flex;
    gap: 22px;
    justify-content: center;
    flex: 1;
}

.jw-nav a {
    text-decoration: none;
    color: var(--gray);
    font-weight: 500;
    font-size: 15px;
    position: relative;
    padding-bottom: 3px;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.jw-nav a.active {
    color: var(--primary);
    font-weight: 600;
}

.jw-nav a.active::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

/* ===== 검색창 ===== */
.jw-search {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 25px;
    padding: 6px 14px;
    height: 38px;
    box-sizing: border-box;
    gap: 6px;
    transition: all 0.3s ease;
}

.jw-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 120px;
}

.jw-search img {
    width: 20px;
    opacity: 0.6;
}

/* ===== 반응형 (핵심 수정) ===== */
@media (max-width: 768px) {
    .jw-header-container {
        width: 100%;
        flex-wrap: wrap;                 /* 줄바꿈 허용 */
        justify-content: flex-start;
        align-items: center;
        padding: 6px 10px;
        height: auto;
        gap: 4px;
    }

    /* 🔹 로고 + 카테고리 한 줄 */
    .jw-logo {
        order: 1;
        flex-shrink: 0;
    }

    .jw-logo img {
        height: 30px;                    /* 로고 크기 축소 */
    }

    .jw-nav {
        order: 2;
        flex: 1;
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        gap: 14px;
        padding-left: 10px;
    }
    .jw-nav::-webkit-scrollbar { display: none; }

    .jw-nav a {
        font-size: 14px;
        flex-shrink: 0;
    }

    /* 🔹 검색창 한 줄 아래 중앙 */
    .jw-search {
        order: 3;
        width: 100%;
        justify-content: center;
        background: #f5f5f5;
        border-radius: 20px;
        padding: 6px 12px;
        margin-top: 4px;
    }

    .jw-search input {
        width: 160px;
        text-align: center;
        font-size: 15px;
    }

    .jw-search img {
        width: 22px;
    }
}
/* ===== 검색창 ===== */
.jw-search {
    display: flex;
    align-items: center;          /* 세로 중앙정렬 */
    justify-content: center;      /* 가로 중앙정렬 */
    background: #f5f5f5;
    border-radius: 25px;
    padding: 6px 14px;
    height: 30px;                 /* 고정 높이로 정렬 안정화 */
    box-sizing: border-box;
    gap: 6px;                     /* 아이콘과 인풋 간격 */
}

.jw-search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    color: #333;
    text-align: center;           /* 중앙 정렬 */
}

.jw-search button {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jw-search img {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .jw-search {
        order: 3;
        width: 100%;
        justify-content: center;
        background: #f5f5f5;
        border-radius: 25px;
        padding: 6px 16px;
        margin-top: 6px;
        height: 30px;
    }

    .jw-search input {
        width: 80%;
        font-size: 15px;
        text-align: center;
    }

    .jw-search img {
        width: 22px;
        height: 22px;
        opacity: 0.65;
    }
}
@media (min-width: 1025px) {
    .jw-search input {
        width: 100%;
        font-size: 15px;
    }
}