/* 上部ナビゲーションの見やすさ改善 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1002;
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    min-height: 76px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    gap: 24px;
    min-height: 52px;
}

.logo-image {
    height: 48px;
    width: auto;
    transition: transform 0.2s ease;
    width: 240px;
    height: 60px;
    object-fit: contain;
}

.logo-image:hover {
    transform: scale(1.05);
}

.nav {
    display: flex;
    justify-content: center;
}

.nav ul {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav li {
    position: relative;
}

.nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
    background: transparent;
    position: relative;
    overflow: hidden;
}

.nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d63a2f;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 8px;
    z-index: -1;
}

.nav a:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 77, 79, 0.4);
}

.nav a:hover::before {
    opacity: 1;
}

.nav a.active {
    background: #d63a2f;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 77, 79, 0.3);
}

.cta-button {
    padding: 12px 24px;
    background: #d32f2f;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* モバイルメニューボタンとオーバーレイ */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1003;
}

.mobile-menu-toggle:hover {
    background: rgba(211, 47, 47, 0.1);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
    margin: 3px 0;
}

.mobile-menu-toggle.active span:first-child {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:last-child {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 70px;
    right: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav ul {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.mobile-nav li {
    margin: 0;
}

.mobile-nav a {
    display: block;
    padding: 1rem 2rem;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.mobile-nav a:hover {
    background: rgba(211, 47, 47, 0.05);
    color: #d32f2f;
    padding-left: 2.5rem;
}

.mobile-nav .cta-button-mobile {
    display: block;
    margin: 1rem 2rem;
    padding: 12px 24px;
    background: #d32f2f;
    color: white !important;
    text-align: center;
    border-radius: 25px;
    font-weight: 700;
    border-bottom: none;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: all 0.2s ease;
}

.mobile-nav .cta-button-mobile:hover {
    background: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    padding-left: 24px;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    height: calc(100vh - 76px);
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
}

/* レスポンシブ対応 - 900px～1200px: 部分的にハンバーガーメニュー */
@media (max-width: 1200px) and (min-width: 901px) {
    .header {
        min-height: 76px !important;
        height: 76px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .header-content {
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 16px !important;
        padding: 0 20px !important;
        flex-wrap: nowrap !important;
        height: 76px !important;
        min-height: 76px !important;
    }
    
    .logo {
        position: static !important;
        transform: none !important;
        margin-right: 20px !important;
        order: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .nav {
        display: flex !important;
        flex: 1 !important;
        order: 1 !important;
        width: auto !important;
        margin-top: 0 !important;
        align-items: center !important;
    }
    
    .nav ul {
        gap: 8px !important;
        flex-wrap: nowrap !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .nav a {
        padding: 10px 14px !important;
        font-size: 13px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* 会社概要とお問い合わせを非表示 */
    .nav li:nth-child(5) {
        display: none !important;
    }
    
    .cta-button {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        position: static !important;
        margin-left: auto !important;
        left: auto !important;
        right: 20px !important;
        transform: none !important;
        order: 2 !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .mobile-nav {
        display: block !important;
        top: 76px !important;
        height: calc(100vh - 76px) !important;
    }
    
    /* モバイルメニューにはすべてのメニューを表示 */
    .mobile-nav li {
        display: block !important;
    }
}

/* レスポンシブ対応 - 900px以下: 完全にハンバーガーメニュー */
@media (max-width: 900px) {
    .header {
        min-height: 76px !important;
        height: 76px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .nav {
        display: none !important;
    }
    
    .nav ul {
        display: none !important;
    }
    
    .cta-button {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        position: absolute !important;
        right: 15px !important;
        left: auto !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .mobile-nav {
        display: block !important;
        top: 76px !important;
        height: calc(100vh - 76px) !important;
    }
    
    /* モバイルメニューにすべて表示 */
    .mobile-nav li {
        display: block !important;
    }
    
    .header .logo {
        position: absolute !important;
        left: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        background: transparent !important;
        border-radius: 0 !important;
    }
    
    .header .logo:hover {
        transform: translateY(-50%) !important;
        left: 15px !important;
        background: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .header .logo-image {
        display: block !important;
    }
    
    .header .logo:hover .logo-image {
        transform: none !important;
        filter: none !important;
    }
    
    .header-content {
        position: relative !important;
        min-height: 76px !important;
        height: 76px !important;
        padding: 0 !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        display: flex !important;
    }
}

/* 768px以下: ロゴの位置調整 */
@media (max-width: 768px) {
    .header .logo {
        left: 5px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }
    
    .header .logo:hover,
    .header .logo:active,
    .header .logo:focus {
        left: 5px !important;
        padding: 0 !important;
        margin: 0 !important;
        transform: translateY(-50%) !important;
        background: transparent !important;
    }
    
    .logo a,
    .logo a:hover,
    .logo a:active,
    .logo a:focus,
    .logo a:focus-visible {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        transform: none !important;
        outline: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .logo picture,
    .logo img,
    .logo-image {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        transform: none !important;
        margin: 0 !important;
    }
}
