/* header_style.css - 2026 M&S TECH 통합 버전 */

/* 1. 헤더 전체 고정 설정 */
header { 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10001;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 2. 헤더 컨테이너 */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 60px;
    width: 100%;
    height: 95px; 
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

/* 3. 로고 스타일 */
.logo { display: flex !important; align-items: center; }
.logo a img {
    height: 220px; 
    width: auto;
    clip-path: inset(50px 0px 50px 0px);
}

/* 4. 대분류 메뉴 (홈, 회사소개, 제품, 고객지원) */
.header_menu { display: flex !important; justify-content: center; }
.header_menu ul {
    display: flex !important;
    gap: 60px; 
    list-style: none;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}
.header_menu a {
    text-decoration: none;
    color: #333;
    font-size: 20px; 
    font-weight: 700;
}
.header_menu a.active { color: #ff4d4d; }

/* 5. 1차 드롭다운 박스 설정 */
.header_menu ul li.dropdown_menu { position: relative !important; }
.header_menu ul li.dropdown_menu .dropdown {
    display: none !important; 
    position: absolute;
    top: calc(100% + 30px); 
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff !important;
    min-width: 210px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    list-style: none;
    padding: 20px 0;
    margin: 0;
    border: 1px solid #eee;
}

.header_menu ul li.dropdown_menu .dropdown::before {
    content: "";
    position: absolute;
    top: -40px;
    left: 0;
    width: 100%;
    height: 40px;
    background: transparent; 
}

.header_menu ul li.dropdown_menu:hover .dropdown { display: block !important; }

/* 6. 드롭다운 내부 아이템 공통 */
.header_menu ul li.dropdown_menu .dropdown li {
    width: 100%;
    text-align: center;
    position: relative;
    list-style: none;
}

.header_menu ul li.dropdown_menu .dropdown li a {
    display: block !important; 
    padding: 16px 20px !important; 
    font-size: 18px; 
    color: #333 !important;
    box-sizing: border-box;
    font-weight: 400 !important;
    text-decoration: none;
    transition: background-color 0.2s;
}

.header_menu ul li.dropdown_menu .dropdown li a:hover {
    background-color: #ebebeb !important;
}

/* 7. 전체 제품보기 전용 스타일 */
.header_menu ul li.dropdown_menu .dropdown li.total-view-item {
    border-bottom: none !important; 
    position: relative;
    margin-bottom: 10px; 
    padding-bottom: 10px; 
}

.header_menu ul li.dropdown_menu .dropdown li.total-view-item::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background-color: #eee; 
}

.header_menu ul li.dropdown_menu .dropdown li.total-view-item a {
    font-weight: 900 !important; 
    color: #000 !important;
    font-size: 19px; 
}

/* 8. 2차 드롭다운 (트롬멜 등) - PC 버전 */
.header_menu ul li.dropdown_menu .dropdown li.has-submenu { position: relative !important; }
.header_menu ul li.dropdown_menu .dropdown li .submenu {
    display: none !important;
    position: absolute !important;
    top: -10px !important;
    left: 100% !important;
    background-color: #ffffff !important;
    min-width: 190px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    border: 1px solid #eee;
}

.header_menu ul li.dropdown_menu .dropdown li.has-submenu:hover > .submenu { 
    display: block !important; 
}

.header_menu ul li.dropdown_menu .dropdown li .submenu li a {
    text-align: left !important;
    font-size: 17px !important; 
    padding: 14px 25px !important;
    font-weight: 400 !important;
}

/* 9. 우측 아이콘 스타일 */
.header-icons { display: flex; align-items: center; }
.header-icons a { 
    font-size: 26px; 
    text-decoration: none; 
    color: #333; 
}

/* --- 모바일 섹션 (@media) --- */
@media (max-width: 1024px) {
    /* 1. 컨테이너 내부 여백 최소화 */
    .header-container {
        padding: 10px 15px !important; 
        height: 90px !important;
        margin-top: 0 !important;
        justify-content: center !important; 
        gap: 10px !important; 
    }

    /* 2. 로고 크기 축소 */
    .logo {
        flex-shrink: 1 !important; 
    }
    .logo a img {
        height: 120px !important; 
        clip-path: inset(25px 0px 25px 0px) !important;
    }

    /* 3. 메뉴 영역 설정 */
    .header_menu {
        flex: 2 !important; 
        width: auto !important;
        min-width: 0 !important;
    }

    .header_menu ul {
        display: flex !important;
        justify-content: space-around !important; 
        gap: 25px !important; 
        width: 100% !important;
    }

    .header_menu a {
        font-size: 14px !important; 
        padding: 10px 5px !important; 
    }

    /* [수정] 모바일 드롭다운 박스 크기 축소 및 위치 최적화 */
    .header_menu ul li.dropdown_menu .dropdown {
        min-width: 160px !important; /* 박스 가로폭 조금 더 축소 */
        padding: 10px 0 !important; /* 위아래 여백 축소 */
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    /* [수정] 맨 우측 '고객지원' 메뉴 잘림 방지 (우측 라인 정렬) */
    .header_menu ul li.dropdown_menu:last-child .dropdown {
        left: auto !important;
        right: 0 !important;
        transform: none !important;
    }

    .header_menu ul li.dropdown_menu .dropdown li a {
        padding: 12px 15px !important; /* 박스가 작아진 만큼 내부 패딩 조절 */
        font-size: 15px !important;
    }

    /* [수정] 모바일 하부 드롭다운 세로 확장 및 중앙 정렬 */
    .header_menu ul li.dropdown_menu .dropdown li .submenu {
        display: none !important;
        position: static !important; 
        width: 100% !important;
        box-shadow: none !important; 
        background-color: #f0f0f0 !important; 
        border: none !important;
        padding: 5px 0 !important;
        transform: none !important;
    }

    .header_menu ul li.dropdown_menu .dropdown li.has-submenu:hover > .submenu {
        display: block !important;
    }

    .header_menu ul li.dropdown_menu .dropdown li .submenu li a {
        padding: 10px 0 !important; 
        font-size: 14px !important;
        text-align: center !important; 
        font-weight: 400 !important;
    }

    .header_menu ul li.dropdown_menu .dropdown li .submenu li a::before {
        content: "· ";
        font-weight: bold;
        margin-right: 4px;
    }

    /* 4. 아이콘 영역 모바일에서 완전히 숨김 */
    .header-icons {
        display: none !important;
    }
}