/* Base styles */
body {
    font-family: 'Roboto', 'Noto Sans KR', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

.mdl-layout__header {
    background-color: #2e458f;
}

.mdl-layout__content {
    width: 100%;
    max-width: 100%;
}

/* =====================================================
   헤더 그리드 레이아웃
   1fr(로고) | auto(메뉴) | 1fr(프로필)
   → 메뉴가 항상 정확히 중앙, 프로필은 오른쪽 끝
   ===================================================== */
.mdl-layout__header-row {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    padding: 0 20px !important;
    height: 64px !important;
    box-sizing: border-box;
}

/* 왼쪽: 로고 */
.mdl-layout-title {
    grid-column: 1;
    display: flex;
    align-items: center;
    gap: 0;
}

.header-logo-okcm {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    white-space: nowrap;
}

.header-logo-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 14px;
    flex-shrink: 0;
}

.header-logo-title {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
}

/* 중앙: 메뉴 링크 */
.nav-links-center {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 7px 20px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffe656;
}

/* 오른쪽: 프로필 영역 */
.header-right {
    grid-column: 3;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* 프로필 아이콘 */
.profile-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
}

.profile-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-profile-image-container {
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    transition: border-color 0.2s, transform 0.2s;
}

.profile-nav-item:hover .nav-profile-image-container {
    border-color: #ffe656;
    transform: scale(1.06);
}

.nav-profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 프로필 드롭다운 */
.profile-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    min-width: 140px;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
    z-index: 1000;
    overflow: hidden;
}

.profile-menu a,
.profile-menu button {
    color: #333;
    padding: 12px 18px;
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    transition: background 0.15s;
}

.profile-menu a:hover,
.profile-menu button:hover {
    background: #f5f5f5;
    color: #2e458f;
}

/* 홈으로 링크 */
.header-vdivider {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 12px;
    flex-shrink: 0;
}

.header-back-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: color 0.15s;
}

.header-back-link:hover {
    color: #ffffff;
}

/* 로그인 버튼 */
.login-btn {
    color: #ffffff !important;
    font-weight: 500;
}

/* 로그인 박스 */
.login-box {
    position: fixed;
    top: 72px;
    right: 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-box .auth-links {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
}

/* MDL overrides */
.mdl-layout__drawer {
    background-color: #f9f9f9;
}

.mdl-layout__drawer-button {
    display: none !important;
}

/* =====================================================
   등록 버튼 스타일 (공통 - order-search, product-search)
   ===================================================== */
a.register-btn,
a.register-btn:visited,
a.register-btn:hover {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: #222 !important;
    background: #ffffff !important;
    border: 1.5px solid #bbb !important;
    border-radius: 6px !important;
    padding: 6px 18px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}

a.register-btn:hover {
    background: #f5f5f5 !important;
    border-color: #888 !important;
    color: #000 !important;
}

/* =====================================================
   반응형: 화면 크기에 따라 메뉴 폰트/패딩 자동 조정
   ===================================================== */
@media screen and (max-width: 900px) {
    .mdl-layout__header-row {
        padding: 0 12px !important;
    }
    .nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }
    .mdl-layout-title a {
        font-size: 17px;
    }
}

@media screen and (max-width: 600px) {
    .nav-link {
        padding: 6px 8px;
        font-size: 12px;
    }
    .mdl-layout-title a {
        font-size: 15px;
    }
    .mdl-layout__header-row {
        padding: 0 8px !important;
    }
}
