/* 공통 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', sans-serif;
}

main {
    padding-top: 80px;
}

/* 헤더 스타일 */
#doz_header_wrap {
    position: fixed;
    width: 100%;
    top: 0;
    background-color: #fff;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#doz_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    width: 100%;
    height: 80px;
}

.logo {
    flex: 0 0 auto;
    padding-left: 40px;
    margin-right: 100px;
}

.logo img {
    max-width: 150px;
    height: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 1;
    position: relative;
    max-width: 1000px;
    margin-right: auto;
}

.nav-menu > li {
    position: static;
    flex: 1;
    text-align: center;
    padding: 0;
}

.nav-menu > li > a {
    text-decoration: none;
    color: #333;
    padding: 20px 0;
    font-size: 16px;
    font-weight: 600;
    display: block;
    transition: all 0.3s;
    white-space: nowrap;
}

.nav-menu > li > a:hover {
    color: #0a2752;
    font-size: 17px;
    transform: translateY(-1px);
}

.nav-menu > li > a:active {
    color: #0a2752;
    transform: translateY(1px);
}

.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    margin-left: auto;
    width: 40px;
    height: 40px;
    position: relative;
    transition: all 0.3s ease;
}

.mobile-menu-button span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #333;
    position: absolute;
    left: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-button span:nth-child(1) {
    top: 12px;
}

.mobile-menu-button span:nth-child(2) {
    top: 19px;
}

.mobile-menu-button span:nth-child(3) {
    top: 26px;
}

.mobile-menu-button.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 19px;
}

.mobile-menu-button.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-button.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 19px;
}

/* 메가 메뉴 스타일 */
.shared-mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
}

.shared-mega-menu.active {
    opacity: 1;
    visibility: visible;
    display: block;
}

/* 카카오톡 상담하기 버튼 스타일 */
#kakao-chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    cursor: pointer;
    display: block;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: filter 0.3s ease;
}

#kakao-chat-button img {
    width: 129.6px;
    height: 50px;
    border: none;
    outline: none;
    transition: filter 0.3s ease;
}

#kakao-chat-button:hover img {
    filter: brightness(90%);
}

#kakao-chat-button:active img {
    filter: brightness(95%);
}

.mega-menu {
    position: relative;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    padding: 20px 0;
    min-height: 160px;
}

/* 메가 메뉴 섹션 스타일 */
.mega-menu-section {
    position: absolute;
    padding: 20px;
    border-right: 1px solid #eee;
    background-color: #fff;
    transition: left 0.3s ease, width 0.3s ease;
}

.mega-menu-section:last-child {
    border-right: none;
}

.mega-menu-section h3 {
    color: #0a2752;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
    padding-bottom: 4px;
    border-bottom: 1px solid #0a2752;
    width: 100%;
    text-align: left;
}

.mega-menu-section ul {
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-section ul li {
    margin: 8px 0;
}

.mega-menu-section ul li a {
    text-decoration: none;
    color: #666;
    font-size: 13px;
    transition: all 0.3s ease;
    display: block;
    padding: 2px 0;
    padding-left: 0;
}

.mega-menu-section ul li a:hover {
    color: #0a2752;
    padding-left: 5px;
}

/* 메가 메뉴 닫기 버튼 */
.mega-menu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    display: none;
}

.mega-menu-close::before,
.mega-menu-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #333;
    top: 50%;
    left: 50%;
}

.mega-menu-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.mega-menu-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* 푸터 스타일 */
.footer-container {
    background-color: #f9f9f9;
    padding: 20px 0;
    margin-top: 0;
    border-top: 1px solid #eee;
    font-size: 11px;
    line-height: 1.3;
    position: relative;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    min-height: 120px;
    align-items: start;
}

.footer-left-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.footer-right-column {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-shrink: 0;
}

.footer-info {
    width: 100%;
    padding-right: 0;
}

.footer-details {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #666;
}

.footer-details li {
    margin-bottom: 2px;
    font-size: 11px;
}

.footer-details .biz-info {
    color: inherit;
    text-decoration: none;
}

.footer-details .biz-info:visited,
.footer-details .biz-info:hover,
.footer-details .biz-info:active,
.footer-details .biz-info:focus {
    color: inherit;
    outline: none;
}

.footer-links {
    display: flex;
    gap: 20px;
    margin: 5px 0 5px 0;
}

.footer-link {
    color: #666;
    text-decoration: none;
    font-size: 11px;
    transition: color 0.2s;
    cursor: pointer;
}

.footer-social {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer-social .social-link img {
    width: 20px;
    height: 20px;
    transition: opacity 0.2s;
}

.kcp-verification {
    display: flex;
    align-items: center;
}

.kcp-verification img {
    width: 66px;
    height: auto;
    transition: opacity 0.2s;
}

.footer-copyright {
    text-align: center;
    color: #888;
    font-size: 10px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

/* 모달 스타일 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

/* 모달 컨테이너 스타일 */
.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 8px;
    padding: 20px 30px 30px 30px;
    z-index: 2001;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-container.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 모달 컨텐츠 스타일 */
.modal-content {
    max-height: calc(80vh - 120px);
    overflow-y: auto;
    padding-right: 30px;
    margin-right: -15px;
    position: relative;
}

.modal-content h2 {
    font-size: 24px;
    margin: -20px -30px 20px -30px;
    padding: 0 30px 0 30px;
    color: #0a2752;
    border-bottom: 2px solid #0a2752;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
    height: 50px;
    display: flex;
    align-items: center;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333;
    font-size: 14px;
}

.modal-content p:first-of-type {
    margin-top: 40px;
}

/* 모달 닫기 버튼 */
.modal-close {
    position: absolute;
    top: 30px;
    right: 20px;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #333;
    top: 50%;
    left: 50%;
}

.modal-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* 스크롤바 스타일 */
.modal-content::-webkit-scrollbar {
    width: 6px;
    margin-left: 15px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
    margin-top: 90px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile styles */
@media (max-width: 767px) {
    #kakao-chat-button {
        bottom: 15px;
        right: 15px;
    }
    
    #kakao-chat-button img {
        width: 103.68px;
        height: 40px;
    }
    
    #doz_header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        min-height: 60px;
        height: auto;
    }

    .logo {
        padding: 0;
        margin: 0;
        text-align: left;
        height: auto;
    }

    .logo img {
        max-width: 120px;
        max-height: 30px;
    }

    .nav-menu {
        display: none;
        height: auto;
    }

    .mobile-menu-button {
        display: block;
    }

    .shared-mega-menu {
        top: 70px;
        height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 0;
    }

    .mega-menu {
        flex-direction: column;
        padding: 0 15px;
        height: auto;
        gap: 8px;
    }

    .mega-menu-section {
        position: static !important;
        width: 100% !important;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 8px 15px;
        margin-bottom: 10px;
        transform: none !important;
        min-height: auto;
    }

    .mega-menu-close {
        display: none !important;
    }

    .footer-content {
        padding: 0 20px;
    }
    
    .footer-right-column {
        flex-direction: column;
        align-items: flex-end;
        gap: 15px;
    }

    .footer-info {
        font-size: 0.9em;
    }

    .footer-details {
        word-break: break-word;
    }

    main {
        padding-top: 60px;
    }

    .mega-menu-section ul li a {
        font-size: 16px;
    }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 1023px) {
    #doz_header {
        flex-direction: column;
        padding: 10px 20px;
        height: 120px;
        min-height: 120px;
        justify-content: center;
    }

    .logo {
        padding-left: 0;
        margin-right: 0;
        margin-bottom: 10px;
        text-align: center;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .logo img {
        max-width: 120px;
        max-height: 30px;
        width: auto;
    }

    .nav-menu {
        width: 100%;
        margin: 10px 0 0 0;
        height: 40px;
        align-items: center;
    }

    .shared-mega-menu {
        position: fixed;
        top: 120px;
        height: 180px;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .mega-menu {
        flex-direction: row;
        justify-content: space-between;
        padding: 20px;
        height: auto;
        min-height: auto;
    }

    .mega-menu-section {
        position: static !important;
        width: calc(25% - 15px) !important;
        height: auto;
        min-height: auto;
        border-right: 1px solid #eee;
        padding: 15px;
        transform: none !important;
        margin-bottom: 15px;
    }

    .mega-menu-close {
        display: block !important;
    }

    main {
        padding-top: 120px;
    }

    .footer-content {
        padding: 0 30px;
    }

    .footer-info {
        padding-right: 0;
    }

    .footer-right-column {
        flex-direction: row;
        gap: 20px;
        justify-content: flex-end;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .footer-content {
        padding: 0 40px;
    }

    .footer-right-column {
        flex-direction: row;
        gap: 30px;
        justify-content: flex-end;
    }

    .footer-info {
        max-width: 800px;
    }

    .mega-menu-close {
        display: none;
    }

    .nav-menu {
        display: flex !important;
    }

    .mobile-menu-button {
        display: none;
    }
}

/* 모바일 및 태블릿에서 터치 효과 제거 */
@media (max-width: 1023px) {
    * {
        -webkit-tap-highlight-color: transparent !important;
    }

    a, button, 
    .nav-menu > li,
    .nav-menu > li > a,
    .mega-menu-section a,
    .footer-link,
    .social-link,
    .modal-close,
    #kakao-chat-button,
    .mobile-menu-button {
        -webkit-tap-highlight-color: transparent !important;
        -webkit-touch-callout: none !important;
        outline: none !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }

    *:focus {
        outline: none !important;
    }

    input, 
    textarea {
        user-select: text !important;
        -webkit-user-select: text !important;
    }
}

/* 인쇄 스타일 */
@media print {
    .shared-mega-menu,
    #kakao-chat-button,
    .modal-overlay,
    .mobile-menu-button {
        display: none !important;
    }

    .footer-container {
        position: fixed;
        bottom: 0;
        width: 100%;
    }

    body {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* 하이컨트래스트 모드 지원 */
@media (forced-colors: active) {
    .mobile-menu-button span {
        background-color: ButtonText;
    }

    .modal-close::before,
    .modal-close::after {
        background-color: ButtonText;
    }

    .mega-menu-section {
        border-color: ButtonBorder;
    }
}

/* 접근성 관련 스타일 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* 포커스 표시 스타일 */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #0a2752;
    outline-offset: 2px;
}

/* 포커스 표시 숨김 (마우스 사용 시) */
.no-focus-outline a:focus,
.no-focus-outline button:focus,
.no-focus-outline input:focus,
.no-focus-outline select:focus,
.no-focus-outline textarea:focus {
    outline: none;
}

/* 공유 호버 효과 */
.footer-social .social-link img,
.kcp-verification img {
    transition: opacity 0.2s;
}

.footer-social .social-link:hover img,
.kcp-verification:hover img {
    opacity: 0.8;
}